You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/configurationhandler.py
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,9 @@
1
-
importconstantsasFancyfetchConstants
2
-
importjson5asJSONFiveLibrary
1
+
importsharedasFancyfetchShared
2
+
importjson5asJSONFiveLibrary# type: ignore # This line commonly errors stating that json5 cannot be found, oddly only when working with Nuitka, to my experience.
3
+
# Though json5 is perfectly available to the code, Nuitka finds and includes it, so I have no clue what is happening here.
print(f"File {Filename} not found in {Directory}")
12
+
raiseValueError(f"You attempted to use the constant {Filename.rstrip('.py')}, but a constant definition for it could not be found, it must be a direct child of {Directory}!")
raiseValueError(f"An error occured while processing the definition for the constant {Filename.rstrip('.py')}. A spec for the file could not be generated.")
raiseValueError(f"An error occured while processing the definition for the constant {Filename.rstrip('.py')}. Widget definitions must define the class `Widget`.")
23
+
24
+
WidgetClass=getattr(Module, 'Widget')
25
+
WidgetInstance=WidgetClass()
26
+
27
+
ifnothasattr(WidgetInstance, 'Get'):
28
+
raiseValueError(f"An error occured while processing the definition for the constant {Filename.rstrip('.py')}. Widget classes must define the method `Get`.")
CONFIG_Spacing=Configuration.get("spacing", 5) # Default to 5 if not set.
87
89
CONFIG_ASCII=Configuration.get("ascii", ["You have no ASCII defined!","Set the 'ascii' key in your config!","Or run fancyfetch with the '--regen'/'-r' flag!"]) # Default to a warning if not set.
88
90
89
-
CONFIG_Layout=Configuration.get("layout", ["hello","datetime","credits"]) # Default to ["hello", "datetime"] if not set.
91
+
CONFIG_Layout=Configuration.get("layout", ["os","hostname"]) # Default to ["hello", "datetime"] if not set.
0 commit comments