From 5f99e0565a5730165a498695bcbba4716108e82b Mon Sep 17 00:00:00 2001 From: ful1e5 <24286590+KaizIqbal@users.noreply.github.com> Date: Mon, 10 Aug 2020 11:26:24 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=20Crisp=20Windows=20Cursor=20packa?= =?UTF-8?q?ge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helper.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/helper.py b/helper.py index 96bb8ca..2b3b642 100644 --- a/helper.py +++ b/helper.py @@ -2,8 +2,8 @@ import shutil import json import sys -from config import name, temp_folder, bitmaps_dir, win_out, x11_out -from os import path, listdir +from config import name, temp_folder, bitmaps_dir, win_out, x11_out, window_install_inf, windows_cursors +from os import path, listdir, rename, remove package_dir = "./packages" @@ -12,9 +12,21 @@ win_out_dir = path.join(package_dir, win_out) def window_bundle() -> None: + # Remove & Rename cursors + # If Key found => Rename else Remove + for cursor in listdir(win_out_dir): + old_path = path.join(win_out_dir, cursor) - # TODO: Where is Body !!!!! - pass + try: + new_path = path.join(win_out_dir, windows_cursors[cursor]) + rename(old_path, new_path) + except KeyError: + remove(old_path) + + # creating install.inf file + install_inf_path = path.join(win_out_dir, "install.inf") + with open(install_inf_path, "w") as file: + file.write(install_inf_path) def init_build() -> None: