Bibata_Cursor/builder/cursor.py

60 lines
1.7 KiB
Python
Raw Normal View History

2020-10-08 02:29:27 -04:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
2020-10-09 03:17:47 -04:00
from .bundler import Bundler
from .config import ConfigProvider, hotspots, sizes, delay
2020-10-08 08:15:11 -04:00
from clickgen import build_x11_cursor_theme, build_cursor_theme, build_win_cursor_theme
2020-10-08 02:29:27 -04:00
class CursorBuilder():
"""
2020-10-08 08:15:11 -04:00
Bibata cursors builder 🚀
2020-10-08 02:29:27 -04:00
"""
2020-10-09 03:17:47 -04:00
def __init__(self, name: str, config: ConfigProvider) -> None:
2020-10-08 08:15:11 -04:00
self.__name = name
2020-10-09 03:17:47 -04:00
self.__config = config
self.__bundler = Bundler(name, config)
2020-10-08 08:15:11 -04:00
2020-10-09 03:17:47 -04:00
def build_x11_cursors(self) -> None:
2020-10-08 08:15:11 -04:00
print('🌈 Building %s Theme ...' % self.__name)
build_x11_cursor_theme(
name=self.__name,
image_dir=self.__config.bitmaps_dir,
2020-10-09 03:17:47 -04:00
cursor_sizes=sizes,
hotspots=hotspots,
out_path=self.__config.temp_out_dir,
2020-10-08 08:15:11 -04:00
archive=False,
2020-10-09 03:17:47 -04:00
delay=delay
2020-10-08 08:15:11 -04:00
)
2020-10-09 03:17:47 -04:00
self.__bundler.x11_bundle()
def build_win_cursors(self) -> None:
2020-10-08 08:15:11 -04:00
print('🌈 Building %s Theme ...' % self.__name)
build_win_cursor_theme(
name=self.__name,
image_dir=self.__config.bitmaps_dir,
2020-10-09 03:17:47 -04:00
cursor_sizes=sizes,
hotspots=hotspots,
out_path=self.__config.temp_out_dir,
2020-10-08 08:15:11 -04:00
archive=False,
2020-10-09 03:17:47 -04:00
delay=delay
2020-10-08 08:15:11 -04:00
)
2020-10-08 02:29:27 -04:00
2020-10-09 03:17:47 -04:00
self.__bundler.win_bundle()
def build_cursors(self) -> None:
2020-10-08 08:15:11 -04:00
print('🌈 Building %s Theme ...' % self.__name)
build_cursor_theme(
name=self.__name,
image_dir=self.__config.bitmaps_dir,
2020-10-09 03:17:47 -04:00
cursor_sizes=sizes,
hotspots=hotspots,
out_path=self.__config.temp_out_dir,
2020-10-08 08:15:11 -04:00
archive=False,
2020-10-09 03:17:47 -04:00
delay=delay
2020-10-08 08:15:11 -04:00
)
2020-10-09 03:17:47 -04:00
self.__bundler.bundle()