🔧 Separate configs

This commit is contained in:
ful1e5 2020-10-10 17:20:01 +05:30
parent 4d82790f80
commit b9ad8dbf6a
3 changed files with 33 additions and 30 deletions

View file

@ -1,7 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tempfile
from .bundler import Bundler
from .config import ConfigProvider, hotspots, sizes, delay
from clickgen import build_x11_cursor_theme, build_cursor_theme, build_win_cursor_theme
@ -12,14 +11,14 @@ class CursorBuilder():
Build Bibata Windows & X11 cursors 🚀.
"""
def __init__(self, name: str, config: ConfigProvider) -> None:
def __init__(self, config: ConfigProvider) -> None:
"""
docstring
"""
self.__name = name
self.__config = config
self.__bundler = Bundler(name, config)
self.tmpdir = tempfile.mkdtemp()
self.__name = config.name
self.__bitmaps_dir = config.bitmaps_dir
self.__bundler = Bundler(config)
self.__tmpdir = config.tmpdir
def build_x11_cursors(self) -> None:
"""
@ -28,15 +27,15 @@ class CursorBuilder():
print('🌈 Building %s Theme ...' % self.__name)
build_x11_cursor_theme(
name=self.__name,
image_dir=self.__config.bitmaps_dir,
image_dir=self.__bitmaps_dir,
cursor_sizes=sizes,
hotspots=hotspots,
out_path=self.tmpdir,
out_path=self.__tmpdir,
archive=False,
delay=delay
)
self.__bundler.x11_bundle(self.tmpdir)
self.__bundler.x11_bundle()
def build_win_cursors(self) -> None:
"""
@ -45,15 +44,15 @@ class CursorBuilder():
print('🌈 Building %s Theme ...' % self.__name)
build_win_cursor_theme(
name=self.__name,
image_dir=self.__config.bitmaps_dir,
image_dir=self.__bitmaps_dir,
cursor_sizes=sizes,
hotspots=hotspots,
out_path=self.tmpdir,
out_path=self.__tmpdir,
archive=False,
delay=delay
)
self.__bundler.win_bundle(self.tmpdir)
self.__bundler.win_bundle()
def build_cursors(self) -> None:
"""
@ -62,12 +61,12 @@ class CursorBuilder():
print('🌈 Building %s Theme ...' % self.__name)
build_cursor_theme(
name=self.__name,
image_dir=self.__config.bitmaps_dir,
image_dir=self.__bitmaps_dir,
cursor_sizes=sizes,
hotspots=hotspots,
out_path=self.tmpdir,
out_path=self.__tmpdir,
archive=False,
delay=delay
)
self.__bundler.bundle(self.tmpdir)
self.__bundler.bundle()