From 9bdf4d104a299577634061bcf698d1c9e5708cce Mon Sep 17 00:00:00 2001 From: Matthias Baumgartner Date: Sat, 4 Mar 2023 15:58:43 +0100 Subject: config loading --- tagit/config/loader.py | 4 -- tagit/config/settings.json | 22 ------- tagit/config/settings.yaml | 10 +++ tagit/config/user-defaults.json | 134 ---------------------------------------- tagit/config/user-defaults.yaml | 130 +++++++++++++++++++------------------- 5 files changed, 75 insertions(+), 225 deletions(-) delete mode 100644 tagit/config/settings.json create mode 100644 tagit/config/settings.yaml delete mode 100644 tagit/config/user-defaults.json (limited to 'tagit/config') diff --git a/tagit/config/loader.py b/tagit/config/loader.py index 87ac328..47a51fa 100644 --- a/tagit/config/loader.py +++ b/tagit/config/loader.py @@ -54,10 +54,8 @@ def load_settings(path=None, verbose=0): searchpaths += SETTINGS_PATH # create default user config on first start - first_start = False user_config = os.path.expanduser(os.path.join('~', TAGITRC)) if os.path.exists(DEFAULT_USER_CONFIG) and not os.path.exists(user_config): - first_start = True shutil.copy(DEFAULT_USER_CONFIG, user_config) # scan searchpaths @@ -76,8 +74,6 @@ def load_settings(path=None, verbose=0): # update verbosity from argument cfg.set(('session', 'verbose'), max(cfg('session', 'verbose'), verbose)) - # set first start according to previous user config existence - cfg.set(('session', 'first_start'), first_start) return cfg ## EOF ## diff --git a/tagit/config/settings.json b/tagit/config/settings.json deleted file mode 100644 index 8fd4754..0000000 --- a/tagit/config/settings.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "ui": { - "standalone": { - "keytriggers": [ - ], - "buttondocks": { - "filter": [ - ], - "navigation_left": [ - ], - "navigation_right": [ - ], - "status": [ - ] - }, - "context": { - "root": [ - ] - } - } - } -} diff --git a/tagit/config/settings.yaml b/tagit/config/settings.yaml new file mode 100644 index 0000000..e9264d4 --- /dev/null +++ b/tagit/config/settings.yaml @@ -0,0 +1,10 @@ +ui: + standalone: + keytriggers: [] + buttondocks: + navigation_left: [] + navigation_right: [] + filter: [] + status: [] + context: + root: [] diff --git a/tagit/config/user-defaults.json b/tagit/config/user-defaults.json deleted file mode 100644 index 1ff7ab4..0000000 --- a/tagit/config/user-defaults.json +++ /dev/null @@ -1,134 +0,0 @@ -{ - "session": { - "first_start": false, - "paths": { - "searchlog": "~/.tagit.log" - } - }, - "storage": { - "index": { - "preview_size": [ - 50, - 200, - 400 - ] - } - }, - "ui": { - "standalone": { - "window_size": "1024x768", - "browser": { - "maxrows": 8, - "maxcols": 8 - }, - "buttondocks": { - "sidebar_left": [ - "Menu", - "ShowDashboard", - "AddTag", - "EditTag", - "CreateGroup", - "DissolveGroup", - "SelectAll", - "SelectNone", - "SelectInvert", - "SelectAdditive", - "SelectSubtractive", - "SelectSingle", - "SelectMulti", - "SelectRange" - ] - }, - "tiledocks": { - "dashboard": { - "Buttons": { - "buttons": [ - "ShowBrowsing", - "CreateSession", - "CreateTempSession", - "LoadSession", - "ReloadSession", - "ImportObjects", - "ItemExport", - "UpdateSelectedObjects", - "ShowHelp", - "ShowSettings" - ] - }, - "LibSummary": {}, - "Hints": {}, - "TagHistogram": {}, - "Tagcloud": {}, - "Searchtree": {} - }, - "sidebar_right": { - "Info": {}, - "CursorTags": {}, - "Venn": {} - } - }, - "search": { - "sort_blacklist": [ - "entity", - "flash", - "latitude", - "longitude", - "mime", - "author", - "camera", - "attributes" - ] - }, - "context": { - "app": [ - "ShowSettings", - "ShowHelp", - "ShowConsole" - ], - "session": [ - "ItemExport", - "ImportObjects" - ], - "search": [ - "ShowSelected", - "RemoveSelected" - ], - "browser": [ - "ZoomIn", - "ZoomOut" - ], - "select": [ - "SelectAll", - "SelectNone", - "SelectInvert", - "SelectSingle", - "SelectMulti", - "SelectRange", - "SelectAdditive", - "SelectSubtractive" - ], - "clipboard": [ - "ClipboardCopy", - "ClipboardPaste" - ], - "tagging": [ - "AddTag", - "EditTag", - "SetRank1", - "SetRank3", - "SetRank5" - ], - "grouping": [ - "CreateGroup", - "DissolveGroup", - "AddToGroup", - "RepresentGroup", - "RemoveFromGroup" - ], - "root": [ - "CloseSessionAndExit" - ] - } - } - } -} diff --git a/tagit/config/user-defaults.yaml b/tagit/config/user-defaults.yaml index 3ec23d0..6ec51c6 100644 --- a/tagit/config/user-defaults.yaml +++ b/tagit/config/user-defaults.yaml @@ -1,56 +1,93 @@ session: - first_start: false - paths: - searchlog: ~/.tagit.log -storage: - index: - preview_size: - - 50 - - 200 - - 400 + bsfs: + Graph: + backend: + SparqlStore: {} + user: 'http://example.com/me' + script: + - Search ui: standalone: + window_size: [1440, 810] + #maximize: True + keytriggers: + - MoveCursorUp + - MoveCursorDown + - MoveCursorLeft + - MoveCursorRight + - MoveCursorLast + - MoveCursorFirst + - NextPage + - PreviousPage + - ScrollDown + - ScrollUp + - ZoomIn + - ZoomOut + - Select + - SelectAll + - SelectNone + - SelectMulti + - SelectRange + - AddToken + - GoBack + - GoForth + - AddTag + - EditTag + - Search + - ShowSelected + - RemoveSelected browser: + cols: 4 + rows: 3 maxcols: 8 maxrows: 8 buttondocks: + navigation_left: + - MoveCursorFirst + - PreviousPage + - ScrollUp + navigation_right: + - ScrollDown + - NextPage + - MoveCursorLast + filter: + - GoBack + - GoForth + status: + - ZoomIn + - ZoomOut sidebar_left: - - Menu - - ShowDashboard - AddTag - EditTag - - CreateGroup - - DissolveGroup + - ShowSelected + - RemoveSelected - SelectAll - SelectNone - SelectInvert - - SelectAdditive - - SelectSubtractive - SelectSingle - - SelectMulti - SelectRange + - SelectMulti + - SelectAdditive + - SelectSubtractive context: app: - - ShowSettings - ShowHelp - ShowConsole + - ShowSettings browser: - ZoomIn - ZoomOut - clipboard: - - ClipboardCopy - - ClipboardPaste - grouping: - - CreateGroup - - DissolveGroup - - AddToGroup - - RepresentGroup - - RemoveFromGroup - root: - - CloseSessionAndExit + - MoveCursorFirst + - PreviousPage + - ScrollUp + - ScrollDown + - NextPage + - MoveCursorLast search: - ShowSelected - RemoveSelected + - GoForth + - GoBack select: - SelectAll - SelectNone @@ -60,46 +97,9 @@ ui: - SelectRange - SelectAdditive - SelectSubtractive - session: - - ItemExport - - ImportObjects tagging: - AddTag - EditTag - - SetRank1 - - SetRank3 - - SetRank5 - search: - sort_blacklist: - - entity - - flash - - latitude - - longitude - - mime - - author - - camera - - attributes tiledocks: - dashboard: - Buttons: - buttons: - - ShowBrowsing - - CreateSession - - CreateTempSession - - LoadSession - - ReloadSession - - ImportObjects - - ItemExport - - UpdateSelectedObjects - - ShowHelp - - ShowSettings - Hints: {} - LibSummary: {} - Searchtree: {} - TagHistogram: {} - Tagcloud: {} sidebar_right: - CursorTags: {} Info: {} - Venn: {} - window_size: 1024x768 -- cgit v1.2.3