From 3637530281d3a7adc073cccb7e7ae93a6ff235c5 Mon Sep 17 00:00:00 2001 From: ful1e5 <24286590+ful1e5@users.noreply.github.com> Date: Sat, 10 Oct 2020 17:22:14 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Old=20files=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.py | 55 ---------------------------- helper.py | 65 --------------------------------- hotspots.json | 99 --------------------------------------------------- log.py | 6 ---- 4 files changed, 225 deletions(-) delete mode 100644 config.py delete mode 100644 helper.py delete mode 100644 hotspots.json delete mode 100644 log.py diff --git a/config.py b/config.py deleted file mode 100644 index 0375c1fe..00000000 --- a/config.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python - -import os -import tempfile -import json - -bitmaps_dir = "./bitmaps" -out_dir = "./themes" - -# Build Config -delay = 35 -sizes = [22, 24, 28, 32, 40, 48, 56, 64, 72, 80, 88, 96] - -# Configs For Each Theme in bitmaps directory -configs = [] -for directory in os.listdir(bitmaps_dir): - name = directory - temp_folder = tempfile.mkdtemp() - configs.append(dict( - name=name, - bitmaps_dir=os.path.join(bitmaps_dir, directory), - temp_folder=temp_folder, - x11_out=name, - win_out=name + "-" + "Windows")) - -# getting author name -with open("./package.json") as f: - data = json.loads(f.read()) - author = data["author"] - version = data["version"] - -# Windows Cursors Config -windows_cursors = { - "left_ptr_watch.ani": "AppStarting.ani", - "left_ptr.cur": "Arrow.cur", - "crosshair.cur": "Cross.cur", - "hand2.cur": "Hand.cur", - "pencil.cur": "Handwriting.cur", - "dnd-ask.cur": "Help.cur", - "xterm.cur": "IBeam.cur", - "circle.cur": "NO.cur", - "all-scroll.cur": "SizeAll.cur", - "bd_double_arrow.cur": "SizeNESW.cur", - "sb_v_double_arrow.cur": "SizeNS.cur", - "fd_double_arrow.cur": "SizeNWSE.cur", - "sb_h_double_arrow.cur": "SizeWE.cur", - "sb_up_arrow.cur": "UpArrow.cur", - "wait.ani": "Wait.ani", -} - -# Windows install.inf file content -with open("./scripts/windows.inf") as f: - data = f.read() - window_install_inf_content = data.replace( - "", name+" Cursors").replace("", author) diff --git a/helper.py b/helper.py deleted file mode 100644 index 092f9d6e..00000000 --- a/helper.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python - -import shutil -import json -import sys - -from os import path, listdir, rename, remove -from config import name, version, bitmaps_dir, out_dir, window_install_inf_content, windows_cursors - - -def window_bundle(win_out_dir: str) -> 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) - - 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(window_install_inf_content) - - -def init_build() -> None: - """ - Print build version. - Remove previously built packages && Check Bitmaps. - """ - print("⚡ Bibata Builder Version %s" % version) - - # cleanup old packages - if path.exists(out_dir): - shutil.rmtree(out_dir) - - # Checking Bitmaps directory - if not path.exists(bitmaps_dir): - print( - "⚠ BITMAPS NOT FOUND.\n\n`yarn install && yarn render` to Generates Bitmaps") - sys.exit(1) - - -def pack_it(config) -> None: - """ - Create Crisp 📦 Packages for Windows & X11 Cursor Theme. - """ - try: - x11_out_dir = path.join(out_dir, config['x11_out']) - win_out_dir = path.join(out_dir, config['win_out']) - - # Rename directory - shutil.move(path.join(config['temp_folder'], - config['name'], "x11"), x11_out_dir) - - shutil.move(path.join(config['temp_folder'], - config['name'], "win"), win_out_dir) - - # create install.inf file in Windows Theme - window_bundle(win_out_dir) - except: - pass diff --git a/hotspots.json b/hotspots.json deleted file mode 100644 index 2271367a..00000000 --- a/hotspots.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "all_scroll": { "xhot": 100, "yhot": 100 }, - "dotbox": { "xhot": 100, "yhot": 100 }, - "move": { "xhot": 100, "yhot": 100 }, - "plus": { "xhot": 100, "yhot": 100 }, - "vertical_text": { "xhot": 100, "yhot": 100 }, - "wait": { "xhot": 100, "yhot": 100 }, - "wayland_cursor": { "xhot": 100, "yhot": 100 }, - "x_cursor": { "xhot": 100, "yhot": 100 }, - "xterm": { "xhot": 100, "yhot": 100 }, - - "bd_double_arrow": { "xhot": 98, "yhot": 100 }, - "fd_double_arrow": { "xhot": 98, "yhot": 100 }, - - "bottom_left_corner": { "xhot": 31, "yhot": 172 }, - "bottom_right_corner": { "xhot": 170, "yhot": 172 }, - - "bottom_side": { "xhot": 100, "yhot": 164 }, - "bottom_tee": { "xhot": 100, "yhot": 164 }, - - "center_ptr": { "xhot": 98, "yhot": 131 }, - - "circle": { "xhot": 48, "yhot": 25 }, - "context_menu": { "xhot": 48, "yhot": 25 }, - "copy": { "xhot": 48, "yhot": 25 }, - "link": { "xhot": 48, "yhot": 25 }, - "pointer_move": { "xhot": 48, "yhot": 25 }, - - "cross": { "xhot": 98, "yhot": 96 }, - - "crossed_circle": { "xhot": 100, "yhot": 100 }, - - "crosshair": { "xhot": 99, "yhot": 99 }, - - "dnd_ask": { "xhot": 86, "yhot": 79 }, - "dnd_copy": { "xhot": 86, "yhot": 79 }, - "dnd_link": { "xhot": 86, "yhot": 79 }, - "dnd_move": { "xhot": 86, "yhot": 79 }, - "dnd_no_drop": { "xhot": 86, "yhot": 79 }, - - "dnd_none": { "xhot": 99, "yhot": 98 }, - - "grabbing": { "xhot": 106, "yhot": 79 }, - - "hand1": { "xhot": 113, "yhot": 95 }, - - "hand2": { "xhot": 88, "yhot": 32 }, - - "left_ptr_watch": { "xhot": 50, "yhot": 28 }, - - "left_ptr": { "xhot": 53, "yhot": 36 }, - - "left_side": { "xhot": 35, "yhot": 100 }, - - "left_tee": { "xhot": 165, "yhot": 95 }, - - "ll_angle": { "xhot": 34, "yhot": 165 }, - - "lr_angle": { "xhot": 167, "yhot": 164 }, - - "pencil": { "xhot": 37, "yhot": 161 }, - - "question_arrow": { "xhot": 102, "yhot": 102 }, - - "right_ptr": { "xhot": 150, "yhot": 29 }, - - "right_side": { "xhot": 163, "yhot": 98 }, - - "right_tee": { "xhot": 30, "yhot": 96 }, - - "sb_down_arrow": { "xhot": 100, "yhot": 126 }, - - "sb_h_double_arrow": { "xhot": 100, "yhot": 100 }, - "sb_v_double_arrow": { "xhot": 100, "yhot": 100 }, - - "sb_left_arrow": { "xhot": 86, "yhot": 100 }, - - "sb_right_arrow": { "xhot": 113, "yhot": 100 }, - - "sb_up_arrow": { "xhot": 99, "yhot": 86 }, - - "tcross": { "xhot": 98, "yhot": 100 }, - - "top_left_corner": { "xhot": 29, "yhot": 27 }, - - "top_right_corner": { "xhot": 170, "yhot": 28 }, - - "top_side": { "xhot": 98, "yhot": 34 }, - - "top_tee": { "xhot": 98, "yhot": 29 }, - - "ul_angle": { "xhot": 34, "yhot": 35 }, - - "ur_angle": { "xhot": 164, "yhot": 34 }, - - "zoom_in": { "xhot": 90, "yhot": 89 }, - - "zoom_out": { "xhot": 93, "yhot": 90 } -} diff --git a/log.py b/log.py deleted file mode 100644 index e59183ce..00000000 --- a/log.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python - -import logging - -logging.basicConfig(filename='build.log', filemode='w', - format='%(name)s - %(levelname)s - %(message)s', level=logging.DEBUG)