v2.2
Steve Nyemba 2 weeks ago
parent 295050796f
commit 28a832268d

@ -33,8 +33,8 @@ version {meta.__version__}
{meta.__license__}""" {meta.__license__}"""
PASSED = ' '.join(['[',colored(u'\u2713', 'green'),']']) PASSED = ' '.join(['[',colored('\u2713', 'green'),']'])
FAILED= ' '.join(['[',colored(u'\u2717','red'),']']) FAILED= ' '.join(['[',colored('\u2717','red'),']'])
INVALID_FOLDER = """ INVALID_FOLDER = """
{FAILED} Unable to proceed, could not find project manifest. It should be qcms-manifest.json {FAILED} Unable to proceed, could not find project manifest. It should be qcms-manifest.json
@ -323,13 +323,25 @@ def handle_theme (
_root = os.sep.join( manifest.split(os.sep)[:-1]+[_config['layout']['root']]) _root = os.sep.join( manifest.split(os.sep)[:-1]+[_config['layout']['root']])
if show : if show :
_df = pd.DataFrame({"available":themes.List()}) _available = themes.List()
if _df.shape[0] > 0 : _df = pd.DataFrame({"available":_available})
values = themes.installed(_root) # if _df.shape[0] > 0 :
values.sort() if _available :
values = values + np.repeat(f"""{FAILED}""", _df.shape[0] - len(values)).tolist() _installed = themes.installed(_root)
values.sort() _available.sort()
_df['installed'] = values _marks = []
for _themeName in _available :
_symbol = '\u2713' if _themeName in _installed else '\u2717'
if _config['system']['theme'] == _themeName :
_symbol = '\u2605'
# colored('\u2713', 'green')
# _symbol = _symbol.replace('[ ','').replace(' ]','')
_marks.append( str(_symbol))
_df = pd.DataFrame({"available":_available,"installed":_marks})
# values.sort()
# values = values + np.repeat(f"""{FAILED}""", _df.shape[0] - len(values)).tolist()
# values.sort()
# _df['installed'] = values
else: else:
_df = f"""{FAILED} No themes were found in registry,\ncurl {themes.URL}/api/themes/List (QCMS_HOST_URL should be set)""" _df = f"""{FAILED} No themes were found in registry,\ncurl {themes.URL}/api/themes/List (QCMS_HOST_URL should be set)"""
print (_df) print (_df)

@ -11,7 +11,7 @@ This would avoid crashes but would come at the expense of a lack of consistent v
""" """
import requests import requests
import os import os
URL = os.environ['QCMS_HOME_URL'] if 'QCMS_HOME_URL' in os.environ else 'https://dev.the-phi.com/qcms' URL = os.environ['QCMS_HOST_URL'] if 'QCMS_HOST_URL' in os.environ else 'https://dev.the-phi.com/qcms'
def current (_system) : def current (_system) :
return _system['theme'] return _system['theme']
def List (_url = URL) : def List (_url = URL) :

Loading…
Cancel
Save