methods docs & import sorting

This commit is contained in:
ful1e5 2021-03-23 20:01:38 +05:30
parent b495940b97
commit bde717165b
4 changed files with 45 additions and 45 deletions

View file

@ -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:

View file

@ -10,7 +10,6 @@ URL = "https://github.com/ful1e5/Bibata_Cursor"
# XCursor
X_DELAY: int = 13
# Windows Cursor
WIN_DELAY = 1

View file

@ -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.
: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.
:info: (Dict) Content theme name & comment
```
: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:

View file

@ -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 = [