From 75c8701258be92c33e87799a8daa1349991166ed Mon Sep 17 00:00:00 2001 From: Abdulkaiz Khatri <24286590+ful1e5@users.noreply.github.com> Date: Thu, 21 Dec 2023 10:35:58 +0530 Subject: [PATCH] prepare: v2.2.0 Addressed the https://github.com/ful1e5/Bibata_Cursor/issues/154 --- CHANGELOG.md | 295 +++++++++++++++++---------------- src/clickgen/__init__.py | 2 +- src/clickgen/packer/windows.py | 33 ++-- 3 files changed, 175 insertions(+), 155 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe20129..dfebf41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,99 +7,105 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased] +## [v2.2.0] - 21 December 2023 + +### Issues Fixes + +- Windows `install.inf` cursor registry in wrong order Fixed (more info https://github.com/ful1e5/Bibata_Cursor/issues/154) + ## [v2.1.9] - 23 September 2023 ### Issues Fixes -- typo: Fixed typo in windows packaging registry `AppStarteng` -> `AppStarting` +- typo: Fixed typo in windows packaging registry `AppStarteng` -> `AppStarting` ## [v2.1.8] - 14 September 2023 ### Changes -- chore: `x11_name` is optional in cursor configs +- chore: `x11_name` is optional in cursor configs ### Issues Fixes -- typo: Fixed typo in windows packaging registry `Unavailiable` -> `Unavailable` +- typo: Fixed typo in windows packaging registry `Unavailiable` -> `Unavailable` ## [v2.1.7] - 13 September 2023 ### What's New? -- Generate `install.inf` based on directory's cursor files dynamically. - (Related to ful1e5/Bibata_Cursor#124, ful1e5/Bibata_Cursor#133) +- Generate `install.inf` based on directory's cursor files dynamically. + (Related to ful1e5/Bibata_Cursor#124, ful1e5/Bibata_Cursor#133) ### Changes -- dev: include `clickgen.*` modules with `find` method in package +- dev: include `clickgen.*` modules with `find` method in package ### Issues Fixes -- Parse config files as `Path` in `configparser` module (Fixes ful1e5/Bibata_Cursor#143) +- Parse config files as `Path` in `configparser` module (Fixes ful1e5/Bibata_Cursor#143) ## [v2.1.6] - 01 September 2023 ### Issues Fixes -- Included `clickgen.libs` directory in distributing package #60 +- Included `clickgen.libs` directory in distributing package #60 ## [v2.1.5] - 31 August 2023 ### Changes -- ci: Use actions/checkout@v3 -- ci: Use `ubuntu-latest` in Linux Runner -- ci: Use distributed local package from `dist/` directory for performing tests -- ci: `test` operation renamed to `pytest` +- ci: Use actions/checkout@v3 +- ci: Use `ubuntu-latest` in Linux Runner +- ci: Use distributed local package from `dist/` directory for performing tests +- ci: `test` operation renamed to `pytest` ### Issues Fixes -- XCursor symlink generated in wrong directory bug fixed -- Short parameter for `-v` added for `ctgen --version` +- XCursor symlink generated in wrong directory bug fixed +- Short parameter for `-v` added for `ctgen --version` ## [v2.1.4] - 29 August 2023 ### Deprecation -- In the `ctgen` configuration file, the `[config]` section no longer supports the `win_size` and `x11_sizes` options. Check [changelog-08172023](https://github.com/ful1e5/clickgen/discussions/59#discussioncomment-6747666) +- In the `ctgen` configuration file, the `[config]` section no longer supports the `win_size` and `x11_sizes` options. Check [changelog-08172023](https://github.com/ful1e5/clickgen/discussions/59#discussioncomment-6747666) ### What's New? -- Prettier Logs in `ctgen` CLI. -- Change size of individual cursor assigning `win_sizes` and `x11_sizes` to individual cursor config in `ctgen` CLI -- Support `.yaml` and `.json` manifest config files for `ctgen` -- Support for `Python 3.11` has been added, along with test suites for it. +- Prettier Logs in `ctgen` CLI. +- Change size of individual cursor assigning `win_sizes` and `x11_sizes` to individual cursor config in `ctgen` CLI +- Support `.yaml` and `.json` manifest config files for `ctgen` +- Support for `Python 3.11` has been added, along with test suites for it. ### Changes -- Added 'attrs>=15.0.0' dependency for safely import `dataclass` class -- Using `[build](https://pypa-build.readthedocs.io/en/stable/index.html)` instead of `wheel` for building pypi distributing packages -- Updated ubuntu version in CI +- Added 'attrs>=15.0.0' dependency for safely import `dataclass` class +- Using `[build](https://pypa-build.readthedocs.io/en/stable/index.html)` instead of `wheel` for building pypi distributing packages +- Updated ubuntu version in CI ## [v2.1.3] - 10 October 2022 ### Changed -- Fix blurry Windows Cursors ful1e5/Bibata_Cursor#119 +- Fix blurry Windows Cursors ful1e5/Bibata_Cursor#119 ## [v2.1.2] - 06 October 2022 ### Changed -- Fix distortion transparency in XCursors exports ful1e5/Bibata_Cursor#118 +- Fix distortion transparency in XCursors exports ful1e5/Bibata_Cursor#118 ## [v2.1.1] - 30 August 2022 ### Changed -- Fix size argument type with **windows** platform in `ctgen` script +- Fix size argument type with **windows** platform in `ctgen` script ## [v2.1.0] - 19 August 2022 ### Changed -- Fixed sub modules error in `clickgen.*` +- Fixed sub modules error in `clickgen.*` ## [v2.0.0] - 16 August 2022 @@ -111,23 +117,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Building logs added in `ctgen` -- add: python 3.7 support -- add: **Windows** and **macOS** support fixed #24 -- init: `cursor`, `configparser`, `packer`, `parser` and `writer` module -- 'Twitter' and 'Download' links added on PYPI page -- Added cursor generator cli: `clickgen -h` -- Added cursor theme generator cli: `ctgen -h` (supports config file) -- Uninstall script added in Windows cursors theme. +- Building logs added in `ctgen` +- add: python 3.7 support +- add: **Windows** and **macOS** support fixed #24 +- init: `cursor`, `configparser`, `packer`, `parser` and `writer` module +- 'Twitter' and 'Download' links added on PYPI page +- Added cursor generator cli: `clickgen -h` +- Added cursor theme generator cli: `ctgen -h` (supports config file) +- Uninstall script added in Windows cursors theme. ### Changed -- `KeyNotFound` Exception fixed while reading cursor configuration in `configparser` module -- ctgen (cli): fixed platform assignment type in '-p/--platform' argument -- windows-writer: fixed slow animation in `.ani` cursors (60jifs(1000ms) -> 2 jifs(33ms)) -- chore: updated template variables inside `packer.windows` -- make: install all dependencies with `make install_deps` command -- chore: directory renamed `examples` -> `samples` +- `KeyNotFound` Exception fixed while reading cursor configuration in `configparser` module +- ctgen (cli): fixed platform assignment type in '-p/--platform' argument +- windows-writer: fixed slow animation in `.ani` cursors (60jifs(1000ms) -> 2 jifs(33ms)) +- chore: updated template variables inside `packer.windows` +- make: install all dependencies with `make install_deps` command +- chore: directory renamed `examples` -> `samples` ## [v2.0.0-beta.2] - 09 July 2022 @@ -137,180 +143,181 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- python 3.10 support -- `Makefile` at the project root added for development operations command -- Generate `stubfiles` from `make stubgen` command -- `make clean` command for cleaning clickgen cache -- `make dev` command for development purpose -- `make docs_gen` command for generating docs -- Build `xcursorgen` with extra flags -- `xcursorgen.c` formatted with tool **[indent](https://www.gnu.org/software/indent/)** -- Linting & typing fixes inside `clickgen.builders` -- `Linting`, `pip package caching`, and `stubgen` commands inside [workflows/app-publish.yml](./.github/workflows/app-publish.yml) -- `ConfigFrame` typing added inside `WindowsCursor` class -- `clickgen.builders` module docs init -- docstring `param type` and `rtype` typing with **"or"** inside `Optional` and `Union` -- `WindowsCursor` docstring init -- `tests` module docstring init -- use built-in typing inside `clickgen.*` -- `from_bitmap` classmethod init inside `XCursor` class -- `from_bitmap` classmethod init inside `WindowsCursor` class -- GitHub Sponsorships added -- feat: uninstall script added in `WindowsPackager` ful1e5/apple_cursor#79 -- feat: run `pip install` command according to make target (use for dev env setup) -- chore: moved `package_data` config to `setup.cfg` -- chore: removed `resample` parameter from `Bitmap.resize()` +- python 3.10 support +- `Makefile` at the project root added for development operations command +- Generate `stubfiles` from `make stubgen` command +- `make clean` command for cleaning clickgen cache +- `make dev` command for development purpose +- `make docs_gen` command for generating docs +- Build `xcursorgen` with extra flags +- `xcursorgen.c` formatted with tool **[indent](https://www.gnu.org/software/indent/)** +- Linting & typing fixes inside `clickgen.builders` +- `Linting`, `pip package caching`, and `stubgen` commands inside [workflows/app-publish.yml](./.github/workflows/app-publish.yml) +- `ConfigFrame` typing added inside `WindowsCursor` class +- `clickgen.builders` module docs init +- docstring `param type` and `rtype` typing with **"or"** inside `Optional` and `Union` +- `WindowsCursor` docstring init +- `tests` module docstring init +- use built-in typing inside `clickgen.*` +- `from_bitmap` classmethod init inside `XCursor` class +- `from_bitmap` classmethod init inside `WindowsCursor` class +- GitHub Sponsorships added +- feat: uninstall script added in `WindowsPackager` ful1e5/apple_cursor#79 +- feat: run `pip install` command according to make target (use for dev env setup) +- chore: moved `package_data` config to `setup.cfg` +- chore: removed `resample` parameter from `Bitmap.resize()` ### Changed -- clean `xcursorgen` build cache automatically on `make` command -- `CI` pip caching system key changed to `setup.py` -- Proper typing inheritation inside `clickgen/core.pyi` -- Linting & Typing fixed in `XCursor` Class `clickgen/builder.py` -- `xcursorgen/makefile` renamed to `xcursorgen/Makefile` -- WindowsCursor support `options` instead of `args` -- clickgen pip dependencies _installation_ method changed inside [workflows/app-ci.yml](./.github/workflows/app-ci.yml) -- Only `python3` syntax (removed `(object) inheritation`) -- `clickgen.utils.timer` & `clickgen.utils.debug` removed -- formatting inside `CHANGELOG.md` -- CI: run ci on every branch push -- refactor: init `setup.cfg` -- lsp warning fixed in `tests` module -- removed emoji from `README.md` -- chore: compact `Makefile` with variables -- coverage: assign default value of `data` parameter in `clickgen/util.py` -- fix: updated donation link and fixed type warning in `setup.py` -- refactor: source moved to `src/*` directory -- chore: tox init -- make-stubgen: generate type interface(.pyi) files without `MODULES` variable -- refactor: `scripts` -> `src/clickgen/scripts` +- clean `xcursorgen` build cache automatically on `make` command +- `CI` pip caching system key changed to `setup.py` +- Proper typing inheritation inside `clickgen/core.pyi` +- Linting & Typing fixed in `XCursor` Class `clickgen/builder.py` +- `xcursorgen/makefile` renamed to `xcursorgen/Makefile` +- WindowsCursor support `options` instead of `args` +- clickgen pip dependencies _installation_ method changed inside [workflows/app-ci.yml](./.github/workflows/app-ci.yml) +- Only `python3` syntax (removed `(object) inheritation`) +- `clickgen.utils.timer` & `clickgen.utils.debug` removed +- formatting inside `CHANGELOG.md` +- CI: run ci on every branch push +- refactor: init `setup.cfg` +- lsp warning fixed in `tests` module +- removed emoji from `README.md` +- chore: compact `Makefile` with variables +- coverage: assign default value of `data` parameter in `clickgen/util.py` +- fix: updated donation link and fixed type warning in `setup.py` +- refactor: source moved to `src/*` directory +- chore: tox init +- make-stubgen: generate type interface(.pyi) files without `MODULES` variable +- refactor: `scripts` -> `src/clickgen/scripts` ## [v1.1.9] - 22 March 2021 ### Added -- Couple of **linting** problem fixes -- **Bitmap** and **CursorsAlias** member access outside the context manager -- Check `make` command in `setup.py` -- Better typing experience -- Configure readthedocs with `sphinx` -- Added **docs** badge in `README.md` +- Couple of **linting** problem fixes +- **Bitmap** and **CursorsAlias** member access outside the context manager +- Check `make` command in `setup.py` +- Better typing experience +- Configure readthedocs with `sphinx` +- Added **docs** badge in `README.md` ### Changed -- Fixed Pillow vulnerabilities by bumped it to `8.1.1` -- python caching updated in `app-ci.yml` -- `Literal` typing removed from `clickgen.util` & `clickgen.core` -- Fixed #23 packaging issue of `XPackager` -- Fixed #22 Inside `util.PNGProvider` +- Fixed Pillow vulnerabilities by bumped it to `8.1.1` +- python caching updated in `app-ci.yml` +- `Literal` typing removed from `clickgen.util` & `clickgen.core` +- Fixed #23 packaging issue of `XPackager` +- Fixed #22 Inside `util.PNGProvider` ## [v1.1.8] - 24 January 2021 ### Added -- Code Coverage ~100% -- The new CLI -- New `XCursor` & `Windows Cursor` building approach -- python `.pyi` static type file (stub file) init -- X11 & Windows themes _packaging_ compatibility -- **Semi-animated** theme supports for Windows & X11 -- `timer` & `debug` development utility init. +- Code Coverage ~100% +- The new CLI +- New `XCursor` & `Windows Cursor` building approach +- python `.pyi` static type file (stub file) init +- X11 & Windows themes _packaging_ compatibility +- **Semi-animated** theme supports for Windows & X11 +- `timer` & `debug` development utility init. ### Changed -- Handle **Cursor config file** in `tmp` directory -- Cursor's database in python `Dict` format -- Vast changes in `clickgen` importing. -- GitHub workflow with `matrix` -- fixed #12 +- Handle **Cursor config file** in `tmp` directory +- Cursor's database in python `Dict` format +- Vast changes in `clickgen` importing. +- GitHub workflow with `matrix` +- fixed #12 ## [v1.1.7] - 5 October 2020 ### Added -- New Stable version **v1.1.7** -- Archlinux/Manjaro installation docs -- CLI usage in [README.md](./README.md) +- New Stable version **v1.1.7** +- Archlinux/Manjaro installation docs +- CLI usage in [README.md](./README.md) ### Changed -- skip `Pillow` is already installed +- skip `Pillow` is already installed ## [v1.1.6] - 24 September 2020 ### Changed -- `vertical resize` wrong implementation fix (KDE Cursor) #13 -- Remove unnecessary cursors from `left_ptr` -- Remove `./` from all **symbolic link** cursors -- Untraced `pkginfo.in` file -- Update `Pillow` to 7.2.0 +- `vertical resize` wrong implementation fix (KDE Cursor) #13 +- Remove unnecessary cursors from `left_ptr` +- Remove `./` from all **symbolic link** cursors +- Untraced `pkginfo.in` file +- Update `Pillow` to 7.2.0 ### Added -- clickgen **info** in [README.md](./README.md) +- clickgen **info** in [README.md](./README.md) ## [v1.1.5-beta] - 29 July 2020 ### Changed -- Typo fixed +- Typo fixed ## [1.1.4-beta] - 20 July 2020 ### Added -- **configsgen** - _a tool for automating cursor `configs` generation from images._ -- **build function** - _a shortcut functions for build a `cursor theme`._ +- **configsgen** - _a tool for automating cursor `configs` generation from images._ +- **build function** - _a shortcut functions for build a `cursor theme`._ ### Changed -- individual `logging` support -- added more _logs_ -- fixed _built-in_ **conflicts** -- `import` packages manner changed +- individual `logging` support +- added more _logs_ +- fixed _built-in_ **conflicts** +- `import` packages manner changed ## [v1.1.3-alpha] - 24 June 2020 -- docker image **publishing workflow** fixed +- docker image **publishing workflow** fixed ## [v1.1.2-alpha] - 23 June 2020 ### Added -- Docker image available on **Github Docker Registry** -- `clickgen CLI` added with the pip package +- Docker image available on **Github Docker Registry** +- `clickgen CLI` added with the pip package ### Changed -- Remove default command-line arguments in `win.py` aka **anicursorgen** -- Exited with an error if `exception` occurred. -- Empty cursor theme `archive` generation **fixed**. +- Remove default command-line arguments in `win.py` aka **anicursorgen** +- Exited with an error if `exception` occurred. +- Empty cursor theme `archive` generation **fixed**. ## [v1.1.1-alpha] - 12 June 2020 ### Changed -- Windows cursors extension `null` to `.ani` or `.cur` in linker module. -- Restructure **test** -- Logo **Alignment fix** in `README.md` -- CI Pipeline -- GitHub workflow name changed -- badges in `README.md` +- Windows cursors extension `null` to `.ani` or `.cur` in linker module. +- Restructure **test** +- Logo **Alignment fix** in `README.md` +- CI Pipeline +- GitHub workflow name changed +- badges in `README.md` ## [v1.1.0-alpha] - 9 June 2020 ### Added -- Initial release 🎊 -- Logo and badges -- CI/CD Pipelines -- **auto-install** `pip requirements` -- `xcursorgen.so` file included in the packaging -- auto-generated **symlinks** based on input configs -- `.tar` archive & `directory` as out **package**. +- Initial release 🎊 +- Logo and badges +- CI/CD Pipelines +- **auto-install** `pip requirements` +- `xcursorgen.so` file included in the packaging +- auto-generated **symlinks** based on input configs +- `.tar` archive & `directory` as out **package**. -[unreleased]: https://github.com/ful1e5/clickgen/compare/v2.1.9...main +[unreleased]: https://github.com/ful1e5/clickgen/compare/v2.2.0...main +[v2.2.0]: https://github.com/ful1e5/clickgen/compare/v2.1.9...v2.2.0 [v2.1.9]: https://github.com/ful1e5/clickgen/compare/v2.1.8...v2.1.9 [v2.1.8]: https://github.com/ful1e5/clickgen/compare/v2.1.7...v2.1.8 [v2.1.7]: https://github.com/ful1e5/clickgen/compare/v2.1.6...v2.1.7 diff --git a/src/clickgen/__init__.py b/src/clickgen/__init__.py index 5ca8ff4..1562e47 100644 --- a/src/clickgen/__init__.py +++ b/src/clickgen/__init__.py @@ -1,4 +1,4 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -__version__ = "2.1.9" +__version__ = "2.2.0" diff --git a/src/clickgen/packer/windows.py b/src/clickgen/packer/windows.py index 10a31c1..be93971 100644 --- a/src/clickgen/packer/windows.py +++ b/src/clickgen/packer/windows.py @@ -75,24 +75,26 @@ ), } +# NOTE: DO NOT CHANGE ORDER OF THIS LIST +# https://github.com/ful1e5/Bibata_Cursor/issues/154#issuecomment-1783938013 all_wreg = [ - 'HKCU,"Control Panel\\Cursors",AppStarting,0x00020000,"%10%\\%CUR_DIR%\\%work%"', 'HKCU,"Control Panel\\Cursors",Arrow,0x00020000,"%10%\\%CUR_DIR%\\%pointer%"', + 'HKCU,"Control Panel\\Cursors",Help,0x00020000,"%10%\\%CUR_DIR%\\%help%"', + 'HKCU,"Control Panel\\Cursors",AppStarting,0x00020000,"%10%\\%CUR_DIR%\\%work%"', + 'HKCU,"Control Panel\\Cursors",Wait,0x00020000,"%10%\\%CUR_DIR%\\%busy%"', 'HKCU,"Control Panel\\Cursors",crosshair,0x00020000,"%10%\\%CUR_DIR%\\%cross%"', 'HKCU,"Control Panel\\Cursors",precisionhair,0x00020000,"%10%\\%CUR_DIR%\\%cross%"', - 'HKCU,"Control Panel\\Cursors",Hand,0x00020000,"%10%\\%CUR_DIR%\\%link%"', - 'HKCU,"Control Panel\\Cursors",Help,0x00020000,"%10%\\%CUR_DIR%\\%help%"', 'HKCU,"Control Panel\\Cursors",IBeam,0x00020000,"%10%\\%CUR_DIR%\\%text%"', - 'HKCU,"Control Panel\\Cursors",No,0x00020000,"%10%\\%CUR_DIR%\\%unavailable%"', 'HKCU,"Control Panel\\Cursors",NWPen,0x00020000,"%10%\\%CUR_DIR%\\%handwriting%"', - 'HKCU,"Control Panel\\Cursors",Grab,0x00020000,"%10%\\%CUR_DIR%\\%move%"', - 'HKCU,"Control Panel\\Cursors",SizeAll,0x00020000,"%10%\\%CUR_DIR%\\%move%"', - 'HKCU,"Control Panel\\Cursors",SizeNESW,0x00020000,"%10%\\%CUR_DIR%\\%dgn2%"', + 'HKCU,"Control Panel\\Cursors",No,0x00020000,"%10%\\%CUR_DIR%\\%unavailable%"', 'HKCU,"Control Panel\\Cursors",SizeNS,0x00020000,"%10%\\%CUR_DIR%\\%vert%"', - 'HKCU,"Control Panel\\Cursors",SizeNWSE,0x00020000,"%10%\\%CUR_DIR%\\%dgn1%"', 'HKCU,"Control Panel\\Cursors",SizeWE,0x00020000,"%10%\\%CUR_DIR%\\%horz%"', + 'HKCU,"Control Panel\\Cursors",SizeNWSE,0x00020000,"%10%\\%CUR_DIR%\\%dgn1%"', + 'HKCU,"Control Panel\\Cursors",SizeNESW,0x00020000,"%10%\\%CUR_DIR%\\%dgn2%"', + 'HKCU,"Control Panel\\Cursors",Grab,0x00020000,"%10%\\%CUR_DIR%\\%move%"', + 'HKCU,"Control Panel\\Cursors",SizeAll,0x00020000,"%10%\\%CUR_DIR%\\%move%"', 'HKCU,"Control Panel\\Cursors",UpArrow,0x00020000,"%10%\\%CUR_DIR%\\%alternate%"', - 'HKCU,"Control Panel\\Cursors",Wait,0x00020000,"%10%\\%CUR_DIR%\\%busy%"', + 'HKCU,"Control Panel\\Cursors",Hand,0x00020000,"%10%\\%CUR_DIR%\\%link%"', 'HKCU,"Control Panel\\Cursors",Pin,0x00020000,"%10%\\%CUR_DIR%\\%pin%"', 'HKCU,"Control Panel\\Cursors",Person,0x00020000,"%10%\\%CUR_DIR%\\%person%"', 'HKCU,"Control Panel\\Cursors",Pan,0x00020000,"%10%\\%CUR_DIR%\\%pan%"', @@ -116,7 +118,18 @@ def pack_win( sreg, scur, sstr, wreg_list = [], [], [], [] - for f in sorted(set(files)): + # Define a custom sorting key function + def custom_sort_key(file_path): + stem = file_path.stem.lower() + for item in all_wreg: + if f"%{stem}%" in item: + return all_wreg.index(item) + return len(all_wreg) + + # Sort files using the custom sorting key + files = sorted(set(files), key=custom_sort_key) + + for f in files: stem = f.stem.lower() sreg.append(f"%10%\\%CUR_DIR%\\%{stem}%") scur.append(f.name)