👷 Cursor builder init

This commit is contained in:
ful1e5 2020-10-08 11:59:27 +05:30
parent f4d64e6ce6
commit b0454304a9
4 changed files with 70 additions and 7 deletions

View file

@ -1,4 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .cursor import CursorBuilder
from .provider import ConfigProvider
__version__: str = "1.0.1"

16
builder/cursor.py Normal file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import builder
from .provider import ConfigProvider
class CursorBuilder():
"""
docstring
"""
def __init__(self, config: ConfigProvider):
print("⚡ Bibata Builder Version %s" % builder.__version__)
self.__config = config

13
builder/packager.py Normal file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .provider import ConfigProvider
class Packager():
"""
Create Crisp 📦 Packages for Windows & X11 Cursor Theme.
"""
def __init__(self, config: ConfigProvider):
self.__config = config

View file

@ -2,26 +2,57 @@
# -*- coding: utf-8 -*-
import os
import sys
import builder
from os import path
from os import path, listdir
import shutil
class ConfigProvider(object):
class ConfigProvider():
"""
Configure `Bibata` building process.
Configure `Bibata` building process.
"""
# Build Config
__delay = 35
__sizes = [22, 24, 28, 32, 40, 48, 56, 64, 72, 80, 88, 96]
# 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",
}
def __init__(self, bitmaps_dir: str, out_dir: str) -> None:
self._bitmaps_dir: str = bitmaps_dir
self._out_dir: str = out_dir
if (path.isdir(out_dir)):
# 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)
os.mkdir(out_dir)
self.__bitmaps_dir: str = bitmaps_dir
self.__out_dir: str = out_dir
def get_windows_script(self, theme_name: str, author: str) -> str:
with open(path.join(builder.__path__[0], "windows.inf")) as f: