Skip to content

Commit

Permalink
vocadb_tag.py: use system config folder
Browse files Browse the repository at this point in the history
so that the script can be run from any location
  • Loading branch information
szc126 committed Sep 20, 2021
1 parent d3149e6 commit 94ca3db
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion vocadb_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@
import urllib3
import runpy

cfg = runpy.run_path('config.vocadb_tag.py')
# https://stackoverflow.com/a/53222876
cfg = os.path.join(
(
os.environ.get('APPDATA') or
os.environ.get('XDG_CONFIG_HOME') or
os.path.join(os.environ['HOME'], '.config') or
"."
),
"config.vocadb_tag.py"
)
cfg = runpy.run_path(cfg)

dbs = {
'vocadb': 'VocaDB',
Expand Down

0 comments on commit 94ca3db

Please sign in to comment.