add a to_dict() for States, and then I can use a 1-liner to set a var in jscript

This commit is contained in:
2025-10-02 18:20:31 +10:00
parent e526d99389
commit 2b9e0e19a2

View File

@@ -85,9 +85,13 @@ class States(PA):
self.default_folder_noo=u.default_storage_noo self.default_folder_noo=u.default_storage_noo
self.default_search_noo=u.default_search_noo self.default_search_noo=u.default_search_noo
self.cwd=self.root self.cwd=self.root
return return
def to_dict(self):
# Automatically include all instance attributes
return {key: value for key, value in vars(self).items()}
################################################################################ ################################################################################
# /states -> GET only -> prints out list of all prefs (simple for now) # /states -> GET only -> prints out list of all prefs (simple for now)
################################################################################ ################################################################################