Compare commits

...

2 commits

Author SHA1 Message Date
1269e379a5 Remove unneeded note. 2025-01-01 20:48:25 +01:00
b954086f51 Add edge case documentation. 2025-01-01 20:47:23 +01:00
2 changed files with 3 additions and 3 deletions

View file

@ -108,6 +108,7 @@ The changing_times dictionary is used to specify the times of the day when your
*** The other dictionaries
The other dictionaries must always have the names of the wallpaper sets from used_sets. If you have one wallpaper set, you need one additional dictionary, if you have two you need two etc. The standard config uses nature and anime, these names can be whatever you please as long as they are the same as the ones specified in used_sets.
The keys in the dictionary once again do not matter, the names of the keys in each dictionary must be strings and be absolute paths. They should not include spaces unless prefaced by a backslash.
*/NOTE/*: No wallpaper set should ever be called ~fFTojkvCLIkGVlC6vUo4701djCZczmJDiyHKj4Qdj0zwkLyETsPxP88DLmY9In0I~. A wallpaper set with this name can never be chosen. If you only have one set and it is called this, it will result in an endless loop of rerolling a random wallpaper set. This should not matter to anyone, as this would be a supremely weird way to call your wallpaper set (I recommend more descriptive names), and this exact string is incredibly unlikely to appear in a random character generator, but you have been warned.
* TODOs

View file

@ -13,7 +13,7 @@ global logger
logger = logging.getLogger("wallman")
class _ConfigLib:
# Initializes the most important config values. TODO: Add handling for the empty config edge case
# Initializes the most important config values. TODO: Add handling for the empty config edge case and the FileNotFound case
def __init__(self) -> None:
self.config_file: ConfigFile = self._initialize_config() # Full config
# Dictionaries
@ -140,7 +140,7 @@ class ConfigValidity(_ConfigLib):
def _check_general_validity(self) -> bool:
# FIXME!
# HACK: Adjust it to check for the actually required variables existing rather than check if a number of options is set, which is highly error prone.
# TODO: Adjust it to check for the actually required variables existing rather than check if a number of options is set, which is highly error prone.
if len(self.config_general) < 3:
try:
self._set_fallback_wallpaper()
@ -211,7 +211,6 @@ class ConfigValidity(_ConfigLib):
class WallpaperLogic(_ConfigLib):
def __init__(self) -> None:
super().__init__()
# NOTE: This looks a bit ugly. Consider pros and cons of adding this into _ConfigLib
self.chosen_wallpaper_set: str = "fFTojkvCLIkGVlC6vUo4701djCZczmJDiyHKj4Qdj0zwkLyETsPxP88DLmY9In0I"
# NOTE: This function could be in a different file because it's not needed in the case only 1 wallpaper per set is needed.