mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-05-27 13:34:20 -04:00
🚀 Bibata builder pkg_info module.
This commit is contained in:
parent
31469678e8
commit
aeba37dadd
5 changed files with 53 additions and 34 deletions
37
build.py
37
build.py
|
@ -5,23 +5,32 @@ import sys
|
|||
import argparse
|
||||
from argparse import ArgumentParser
|
||||
from os import path, listdir
|
||||
from typing import List
|
||||
|
||||
from builder import __info__
|
||||
from builder.pkg_info import info
|
||||
from builder.config import ConfigProvider
|
||||
from builder.cursor import CursorBuilder
|
||||
|
||||
|
||||
def get_args_parser() -> ArgumentParser:
|
||||
"""Parse command line arguments"""
|
||||
parser = argparse.ArgumentParser(description=__info__)
|
||||
parser = argparse.ArgumentParser(description=info["description"])
|
||||
|
||||
parser.add_argument("-x", "--x11", action="store_true", default=False,
|
||||
help=("Bundle X11 cursors from bitmaps"
|
||||
" (default: %(default)s)"))
|
||||
parser.add_argument(
|
||||
"-x",
|
||||
"--x11",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help=("Bundle X11 cursors from bitmaps" " (default: %(default)s)"),
|
||||
)
|
||||
|
||||
parser.add_argument("-w", "--windows", action="store_true", default=False,
|
||||
help=("Bundle Windows cursors from bitmaps"
|
||||
" (default: %(default)s)"))
|
||||
parser.add_argument(
|
||||
"-w",
|
||||
"--windows",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help=("Bundle Windows cursors from bitmaps" " (default: %(default)s)"),
|
||||
)
|
||||
|
||||
return parser
|
||||
|
||||
|
@ -38,11 +47,11 @@ def build() -> None:
|
|||
out_dir = "./themes"
|
||||
|
||||
# print builder information
|
||||
print(__info__)
|
||||
print(info["version"])
|
||||
|
||||
bitmaps_dirs = listdir(bitmaps_dir)
|
||||
configs: list[ConfigProvider] = []
|
||||
builders: list[CursorBuilder] = []
|
||||
configs: List[ConfigProvider] = []
|
||||
builders: List[CursorBuilder] = []
|
||||
|
||||
for index, name in enumerate(bitmaps_dirs):
|
||||
theme_bitmaps_dir = path.join(bitmaps_dir, name)
|
||||
|
@ -50,11 +59,11 @@ def build() -> None:
|
|||
builders.append(CursorBuilder(configs[index]))
|
||||
|
||||
for builder in builders:
|
||||
if (args.x11 == args.windows):
|
||||
if args.x11 == args.windows:
|
||||
builder.build_cursors()
|
||||
elif(args.x11):
|
||||
elif args.x11:
|
||||
builder.build_x11_cursors()
|
||||
elif(args.windows):
|
||||
elif args.windows:
|
||||
builder.build_win_cursors()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue