diff --git a/builder/bbpkg/configure.py b/builder/bbpkg/configure.py index 4b89fef7..4f4cbda4 100644 --- a/builder/bbpkg/configure.py +++ b/builder/bbpkg/configure.py @@ -1,7 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from typing import Any, Dict, Tuple, TypeVar +from pathlib import Path +from typing import Any, Dict, Tuple, TypeVar, Union from clickgen.util import PNGProvider @@ -15,24 +16,20 @@ def to_tuple(x: X) -> Tuple[X, X]: return (x, x) -def get_config(bitmaps_dir, **kwargs) -> Dict[str, Any]: - """Return configuration of `Bibata` pointers. +def get_config(bitmaps_dir: Union[str, Path], **kwargs) -> Dict[str, Any]: + """Return configuration of `Bibata`. - ``` - Args: + :param bitmaps_dir: Path to .png file's directory. + :type bitmaps_dir: Union[str, Path] - :bitmaps_dir: (str | Path) Path to .png file's directory. + :param x_sizes: List of pixel-sizes for xcursors. + :type x_sizes: List[int] + :param win_canvas_size: Windows cursor's canvas pixel-size. + :type win_canvas_size: int - Keywords Args: - - :x_sizes: (List[int]) List of pixel-sizes for xcursors. - - :win_canvas_size: (int) Windows cursor's canvas pixel-size. - - :win_size: (int) Pixel-size for Windows cursor. - - ``` + :param win_size: Pixel-size for Windows cursor. + :type win_size: int Example: diff --git a/builder/bbpkg/constants.py b/builder/bbpkg/constants.py index 8feb55e0..b8bd14b7 100644 --- a/builder/bbpkg/constants.py +++ b/builder/bbpkg/constants.py @@ -10,7 +10,6 @@ URL = "https://github.com/ful1e5/Bibata_Cursor" # XCursor X_DELAY: int = 13 - # Windows Cursor WIN_DELAY = 1 diff --git a/builder/bbpkg/generator.py b/builder/bbpkg/generator.py index 26991ad1..3d20f4bb 100644 --- a/builder/bbpkg/generator.py +++ b/builder/bbpkg/generator.py @@ -4,13 +4,12 @@ from pathlib import Path from typing import Any, Dict, NamedTuple +from bbpkg.constants import AUTHOR, URL +from bbpkg.symlinks import add_missing_xcursor from clickgen.builders import WindowsCursor, XCursor from clickgen.core import CursorAlias from clickgen.packagers import WindowsPackager, XPackager -from bbpkg.constants import AUTHOR, URL -from bbpkg.symlinks import add_missing_xcursor - class Info(NamedTuple): name: str @@ -20,14 +19,16 @@ class Info(NamedTuple): def xbuild(config: Dict[str, Dict[str, Any]], x_out_dir: Path, info: Info) -> None: """Build `Bibata` cursor theme for only `X11`(UNIX) platform. - ``` - :config: (Dict) `Bibata` configuration. + :param config: `Bibata` configuration. + :type config: Dict[str, Dict[str, Any]] - :x_out_dir: (Path) Path to the output directory, - Where the `X11` cursor theme package will generate. - It also creates a directory if not exists. - :info: (Dict) Content theme name & comment - ``` + :param x_out_dir: Path to the output directory, \ + Where the `X11` cursor theme package will generate.\ + It also creates a directory if not exists. + :type x_out_dir: Path + + :param info: Content theme name & comment + :type info: Info """ for _, item in config.items(): @@ -48,14 +49,16 @@ def xbuild(config: Dict[str, Dict[str, Any]], x_out_dir: Path, info: Info) -> No def wbuild(config: Dict[str, Dict[str, Any]], win_out_dir: Path, info: Info) -> None: """Build `Bibata` cursor theme for only `Windows` platforms. - ``` - :config: (Dict) `Bibata` configuration. + :param config: `Bibata` configuration. + :type config: Dict[str, Dict[str, Any]] - :win_out_dir: (Path) Path to the output directory, - Where the `Windows` cursor theme package will generate. - It also creates a directory if not exists. - :info: (Dict) Content theme name & comment - ``` + :param win_out_dir: Path to the output directory,\ + Where the `Windows` cursor theme package will \ + generate. It also creates a directory if not exists. + :type win_out_dir: Path + + :param info: Content theme name & comment + :type info: Dict """ for _, item in config.items(): @@ -88,18 +91,16 @@ def build( ) -> None: """Build `Bibata` cursor theme for `X11` & `Windows` platforms. - ``` - :config: (Dict) `Bibata` configuration. + :param config: `Bibata` configuration. + :type config: Dict[str, Dict[str, Any]] - :x_out_dir: (Path) Path to the output directory, - Where the `X11` cursor theme package will generate. - It also creates a directory if not exists. + :param win_out_dir: Path to the output directory,\ + Where the `Windows` cursor theme package will \ + generate. It also creates a directory if not exists. + :type win_out_dir: Path - :win_out_dir: (Path) Path to the output directory, - Where the `Windows` cursor theme package will generate. - It also creates a directory if not exists. - :info: (Dict) Content theme name & comment - ``` + :param info: Content theme name & comment + :type info: Dict """ def win_build(item: Dict[str, Any], alias: CursorAlias) -> None: diff --git a/builder/bbpkg/symlinks.py b/builder/bbpkg/symlinks.py index bb2578fe..278028e6 100644 --- a/builder/bbpkg/symlinks.py +++ b/builder/bbpkg/symlinks.py @@ -2,14 +2,17 @@ # -*- coding: utf-8 -*- import os +from pathlib import Path +from typing import Union from clickgen.util import chdir -def add_missing_xcursor(directory) -> None: +def add_missing_xcursor(directory: Union[str, Path]) -> None: """Add missing `XCursor` to the Unix cursor package. - :directory: (Path|str) directory where XCursors are available. + :param directory: directory where XCursors are available. + :type directory: Union[str, Path] """ symlinks = [