Update class names of all themes in a folder.
Updating only a single file? Use SyndiShanX's online tool instead: https://syndishanx.github.io/Website/Update_Classes.html
- classchanges by ItsMeSarah for tracking class changes.
- discordscripts by NyxIsBad (aka. nightflower) for the formatted changes list.
- and especially Update-Classes by SyndiShanX for the inspiration.
⚠ Make a backup of your themes before using this script.
- Open terminal in your client mod's directory
- Download this tool
git clone https://github.com/Saltssaumure/ClassUpdate
- Edit config.ini if desired
- See section below for detailed info
- Run the script
cd ./ClassUpdate
python ./replace.py
Files marked with ↻
will be updated by the script if using the default config.
WorseDiscord/
├── themes/
│ ├── CoolTheme.theme.css ↻
│ ├── DarkMode2.theme.css ↻
│ ├── another.theme.css ↻
│ └── testfolder/
│ ├── test.theme.css ↻
│ ├── something.css ↻
│ └── wargh.txt
├── MyCoolWebsite/
│ ├── site.html
│ └── main.css
└── ClassUpdate (this tool)/
├── replace.py
└── README.md
The config for this script is stored in config.ini
and can be edited with your favourite text editor (eg. Notepad++).
- The location of the themes directory to update.
- A path relative to the
ClassUpdate
directory. - Default:
themes
- The file extension of the files to update.
- Default:
css
- Whether or not to use a local (instead of online) changes file.
- Use
yes
orno
. - Default:
no
- The location of the changes file.
- If using local diff, a path relative to the
replace.py
file. - If using online diff, a full URL.
- If using local diff, a path relative to the
- Default:
https://raw.githubusercontent.com/SyndiShanX/Update-Classes/main/Changes.txt
The config.ini
has two profiles provided, DEFAULT
and local
. You can also create new profiles to store various configs.
- Add a section to
config.ini
starting with the name of the profile in square brackets:[UpdateScss]
- Underneath, copy and edit variables you wish to change from the
DEFAULT
profile. Any missing variables will inherit its value fromDEFAULT
automatically. This example profile will updatescss
files inMyThemes
directory using the online changes file athttps://raw.githubusercontent.com/SyndiShanX/Update-Classes/main/Changes.txt
:[UpdateScss] ThemeDirectory: MyThemes FileExtension: scss
- Save your changes before running
replace.py
. Enter your profile name when prompted, without square brackets.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- TL;DR;NAL: Do whatever you want with this, as long as you allow others to do the same.
- Post an issue.
- Make a pull request if you're extra cool.
- Post on my support server.