[core] get output for list of themes/modules
This commit is contained in:
parent
2ab575d190
commit
87915a34e9
4 changed files with 178 additions and 69 deletions
|
@ -3,6 +3,7 @@ import io
|
|||
import json
|
||||
import logging
|
||||
import copy
|
||||
import glob
|
||||
|
||||
import core.event
|
||||
import util.algorithm
|
||||
|
@ -16,6 +17,17 @@ PATHS=[
|
|||
os.path.expanduser('~/.config/bumblebee-status/themes'),
|
||||
]
|
||||
|
||||
def themes():
|
||||
themes_dict = {}
|
||||
|
||||
for path in PATHS:
|
||||
for filename in glob.iglob('{}/*.json'.format(path)):
|
||||
if 'test' not in filename:
|
||||
themes_dict[os.path.basename(filename).replace('.json', '')] = 1
|
||||
result = list(themes_dict.keys())
|
||||
result.sort()
|
||||
return result
|
||||
|
||||
def merge_replace(value, new_value, key):
|
||||
if not isinstance(value, dict):
|
||||
return new_value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue