mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-05-23 19:46:57 -04:00
📦 XPackager from "clickgen.packagers"
This commit is contained in:
parent
dcc0a99845
commit
b495940b97
2 changed files with 1 additions and 28 deletions
|
@ -6,10 +6,9 @@ from typing import Any, Dict, NamedTuple
|
|||
|
||||
from clickgen.builders import WindowsCursor, XCursor
|
||||
from clickgen.core import CursorAlias
|
||||
from clickgen.packagers import WindowsPackager
|
||||
from clickgen.packagers import WindowsPackager, XPackager
|
||||
|
||||
from bbpkg.constants import AUTHOR, URL
|
||||
from bbpkg.packager import XPackager
|
||||
from bbpkg.symlinks import add_missing_xcursor
|
||||
|
||||
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from pathlib import Path
|
||||
from string import Template
|
||||
from typing import Dict
|
||||
|
||||
THEME_FILES_TEMPLATES: Dict[str, Template] = {
|
||||
"cursor.theme": Template("[Icon Theme]\nName=$theme_name\nInherits=$theme_name"),
|
||||
"index.theme": Template(
|
||||
'[Icon Theme]\nName=$theme_name\nComment=$comment\nInherits="hicolor"'
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
def XPackager(directory: Path, theme_name: str, comment: str) -> None:
|
||||
""" Create a crispy `XCursors` theme package. """
|
||||
|
||||
# Writing all .theme files
|
||||
files: Dict[str, str] = {}
|
||||
for file, template in THEME_FILES_TEMPLATES.items():
|
||||
files[file] = template.safe_substitute(theme_name=theme_name, comment=comment)
|
||||
|
||||
for f, data in files.items():
|
||||
fp: Path = directory / f
|
||||
fp.write_text(data)
|
Loading…
Add table
Add a link
Reference in a new issue