|
|
|
@ -33,8 +33,8 @@ version {meta.__version__}
|
|
|
|
|
|
|
|
|
|
{meta.__license__}"""
|
|
|
|
|
|
|
|
|
|
PASSED = ' '.join(['[',colored(u'\u2713', 'green'),']'])
|
|
|
|
|
FAILED= ' '.join(['[',colored(u'\u2717','red'),']'])
|
|
|
|
|
PASSED = ' '.join(['[',colored('\u2713', 'green'),']'])
|
|
|
|
|
FAILED= ' '.join(['[',colored('\u2717','red'),']'])
|
|
|
|
|
|
|
|
|
|
INVALID_FOLDER = """
|
|
|
|
|
{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']])
|
|
|
|
|
|
|
|
|
|
if show :
|
|
|
|
|
_df = pd.DataFrame({"available":themes.List()})
|
|
|
|
|
if _df.shape[0] > 0 :
|
|
|
|
|
values = themes.installed(_root)
|
|
|
|
|
values.sort()
|
|
|
|
|
values = values + np.repeat(f"""{FAILED}""", _df.shape[0] - len(values)).tolist()
|
|
|
|
|
values.sort()
|
|
|
|
|
_df['installed'] = values
|
|
|
|
|
_available = themes.List()
|
|
|
|
|
_df = pd.DataFrame({"available":_available})
|
|
|
|
|
# if _df.shape[0] > 0 :
|
|
|
|
|
if _available :
|
|
|
|
|
_installed = themes.installed(_root)
|
|
|
|
|
_available.sort()
|
|
|
|
|
_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:
|
|
|
|
|
_df = f"""{FAILED} No themes were found in registry,\ncurl {themes.URL}/api/themes/List (QCMS_HOST_URL should be set)"""
|
|
|
|
|
print (_df)
|
|
|
|
|