diff options
author | Matthias Baumgartner <dev@igsor.net> | 2023-01-06 22:55:36 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2023-01-06 22:55:36 +0100 |
commit | 1a8d8f8a37e78f48da88dd69e785234d822425ed (patch) | |
tree | 8c1003075aec91026908c191cba0fe366539740b /tagit/config | |
parent | ceaaef069d8ffda23fce320ce66c86e0226f1046 (diff) | |
download | tagit-1a8d8f8a37e78f48da88dd69e785234d822425ed.tar.gz tagit-1a8d8f8a37e78f48da88dd69e785234d822425ed.tar.bz2 tagit-1a8d8f8a37e78f48da88dd69e785234d822425ed.zip |
load from config, switch to browsing
Diffstat (limited to 'tagit/config')
-rw-r--r-- | tagit/config/loader.py | 4 | ||||
-rw-r--r-- | tagit/config/port-config.yaml | 114 | ||||
-rw-r--r-- | tagit/config/settings.py | 12 | ||||
-rw-r--r-- | tagit/config/user-defaults.yaml | 112 |
4 files changed, 237 insertions, 5 deletions
diff --git a/tagit/config/loader.py b/tagit/config/loader.py index 489b063..87ac328 100644 --- a/tagit/config/loader.py +++ b/tagit/config/loader.py @@ -17,7 +17,7 @@ from .settings import Settings TAGITRC = '.tagitrc' -DEFAULT_USER_CONFIG = os.path.join(os.path.dirname(__file__), 'user-defaults.json') +DEFAULT_USER_CONFIG = os.path.join(os.path.dirname(__file__), 'user-defaults.yaml') SETTINGS_PATH = [ # user home @@ -26,7 +26,7 @@ SETTINGS_PATH = [ '/usr/share/tagit/settings', '/usr/share/tagit/keybindings', # module defaults - os.path.join(os.path.dirname(__file__), 'settings.json'), + os.path.join(os.path.dirname(__file__), 'settings.yaml'), ] # exports diff --git a/tagit/config/port-config.yaml b/tagit/config/port-config.yaml new file mode 100644 index 0000000..038dc07 --- /dev/null +++ b/tagit/config/port-config.yaml @@ -0,0 +1,114 @@ +session: + first_start: false + paths: + searchlog: ~/.tagit.log +storage: + index: + preview_size: + - 50 + - 200 + - 400 +ui: + standalone: + plane: browsing + browser: + maxcols: 8 + maxrows: 8 + buttondocks: + sidebar_left: [] + #- Menu + #- ShowDashboard + #- AddTag + #- EditTag + #- CreateGroup + #- DissolveGroup + #- SelectAll + #- SelectNone + #- SelectInvert + #- SelectAdditive + #- SelectSubtractive + #- SelectSingle + #- SelectMulti + #- SelectRange + context: + app: + - ShowSettings + - ShowHelp + - ShowConsole + - ShowBrowsing + # browser: + # - ZoomIn + # - ZoomOut + # clipboard: + # - ClipboardCopy + # - ClipboardPaste + # grouping: + # - CreateGroup + # - DissolveGroup + # - AddToGroup + # - RepresentGroup + # - RemoveFromGroup + # root: + # - CloseSessionAndExit + # search: + # - ShowSelected + # - RemoveSelected + # select: + # - SelectAll + # - SelectNone + # - SelectInvert + # - SelectSingle + # - SelectMulti + # - SelectRange + # - SelectAdditive + # - SelectSubtractive + # session: + # - SaveSession + # - SaveSessionAs + # - ItemExport + # - ImportObjects + # tagging: + # - AddTag + # - EditTag + # - SetRank1 + # - SetRank3 + # - SetRank5 + search: + sort_blacklist: + - entity + - flash + - latitude + - longitude + - mime + - author + - camera + - attributes + tabs: + max: 2 + tiledocks: + dashboard: {} + #Buttons: + # buttons: + # - ShowBrowsing + # - CreateSession + # - CreateTempSession + # - LoadSession + # - ReloadSession + # - ImportObjects + # - SaveSession + # - SaveSessionAs + # - ItemExport + # - UpdateSelectedObjects + # - SyncSelectedObjects + # - ShowHelp + # - ShowSettings + #Hints: {} + #LibSummary: {} + #Searchtree: {} + #TagHistogram: {} + #Tagcloud: {} + sidebar_right: {} + #CursorTags: {} + #Info: {} + #Venn: {} + window_size: 1024x768 diff --git a/tagit/config/settings.py b/tagit/config/settings.py index 21ab594..190268c 100644 --- a/tagit/config/settings.py +++ b/tagit/config/settings.py @@ -12,6 +12,9 @@ import json import os import typing +# external imports +import yaml # FIXME: mb/port/convenicence + # tagit imports from tagit.utils import errors, fst, is_list @@ -60,11 +63,14 @@ class Settings(abc.MutableMapping, abc.Hashable, abc.Callable): if os.path.exists(source): config_path = os.path.realpath(source) with open(source, 'r') as ifile: - config = json.load(ifile) + #config = json.load(ifile) + config = yaml.safe_load(ifile) # FIXME: mb/port/convenicence else: - config = json.loads(source) + #config = json.loads(source) + config = yaml.safe_load(source) # FIXME: mb/port/convenicence elif isinstance(source, io.TextIOBase): # opened file - config = json.load(source) + #config = json.load(source) + config = yaml.safe_load(source) # FIXME: mb/port/convenicence else: raise TypeError('expected dict, path, or file-like') diff --git a/tagit/config/user-defaults.yaml b/tagit/config/user-defaults.yaml new file mode 100644 index 0000000..b7a70c4 --- /dev/null +++ b/tagit/config/user-defaults.yaml @@ -0,0 +1,112 @@ +session: + first_start: false + paths: + searchlog: ~/.tagit.log +storage: + index: + preview_size: + - 50 + - 200 + - 400 +ui: + standalone: + browser: + maxcols: 8 + maxrows: 8 + buttondocks: + sidebar_left: + - Menu + - ShowDashboard + - AddTag + - EditTag + - CreateGroup + - DissolveGroup + - SelectAll + - SelectNone + - SelectInvert + - SelectAdditive + - SelectSubtractive + - SelectSingle + - SelectMulti + - SelectRange + context: + app: + - ShowSettings + - ShowHelp + - ShowConsole + browser: + - ZoomIn + - ZoomOut + clipboard: + - ClipboardCopy + - ClipboardPaste + grouping: + - CreateGroup + - DissolveGroup + - AddToGroup + - RepresentGroup + - RemoveFromGroup + root: + - CloseSessionAndExit + search: + - ShowSelected + - RemoveSelected + select: + - SelectAll + - SelectNone + - SelectInvert + - SelectSingle + - SelectMulti + - SelectRange + - SelectAdditive + - SelectSubtractive + session: + - SaveSession + - SaveSessionAs + - ItemExport + - ImportObjects + tagging: + - AddTag + - EditTag + - SetRank1 + - SetRank3 + - SetRank5 + search: + sort_blacklist: + - entity + - flash + - latitude + - longitude + - mime + - author + - camera + - attributes + tabs: + max: 2 + tiledocks: + dashboard: + Buttons: + buttons: + - ShowBrowsing + - CreateSession + - CreateTempSession + - LoadSession + - ReloadSession + - ImportObjects + - SaveSession + - SaveSessionAs + - ItemExport + - UpdateSelectedObjects + - SyncSelectedObjects + - ShowHelp + - ShowSettings + Hints: {} + LibSummary: {} + Searchtree: {} + TagHistogram: {} + Tagcloud: {} + sidebar_right: + CursorTags: {} + Info: {} + Venn: {} + window_size: 1024x768 |