New main command, rebuild index
This commit is contained in:
34
src/main.py
34
src/main.py
@@ -17,12 +17,19 @@ def print_usage_and_exit():
|
|||||||
import | check '_in' folder for new apps
|
import | check '_in' folder for new apps
|
||||||
tracker | update tracking domains
|
tracker | update tracking domains
|
||||||
icons | check & download missing icons
|
icons | check & download missing icons
|
||||||
|
index | rebuild index & root html
|
||||||
run [bundle_id] [...] | recombine and rebuild apps
|
run [bundle_id] [...] | recombine and rebuild apps
|
||||||
del [bundle_id] [...] | remove app and rebuild index
|
del [bundle_id] [...] | remove app and rebuild index
|
||||||
''')
|
''')
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
def rebuild_index(inclRoot=False):
|
||||||
|
html_index.process()
|
||||||
|
if inclRoot: # TODO: remove check if root contains dynamic content
|
||||||
|
html_root.process()
|
||||||
|
|
||||||
|
|
||||||
def del_id(bundle_ids):
|
def del_id(bundle_ids):
|
||||||
print('removing apps from website:')
|
print('removing apps from website:')
|
||||||
if bundle_ids == ['*']:
|
if bundle_ids == ['*']:
|
||||||
@@ -37,7 +44,7 @@ def del_id(bundle_ids):
|
|||||||
update_index = True
|
update_index = True
|
||||||
print('')
|
print('')
|
||||||
if update_index:
|
if update_index:
|
||||||
html_index.process()
|
rebuild_index()
|
||||||
|
|
||||||
|
|
||||||
def combine_and_update(bundle_ids, where=None):
|
def combine_and_update(bundle_ids, where=None):
|
||||||
@@ -50,8 +57,7 @@ def combine_and_update(bundle_ids, where=None):
|
|||||||
print('no new bundle, not rebuilding index')
|
print('no new bundle, not rebuilding index')
|
||||||
return
|
return
|
||||||
bundle_download.process(new_ids)
|
bundle_download.process(new_ids)
|
||||||
html_index.process()
|
rebuild_index()
|
||||||
html_root.process()
|
|
||||||
|
|
||||||
|
|
||||||
def import_update():
|
def import_update():
|
||||||
@@ -87,19 +93,21 @@ try:
|
|||||||
params = args[1:]
|
params = args[1:]
|
||||||
if cmd == 'import':
|
if cmd == 'import':
|
||||||
import_update()
|
import_update()
|
||||||
elif cmd == 'del':
|
elif cmd == 'tracker':
|
||||||
if len(params) == 0:
|
tracker_update()
|
||||||
print_usage_and_exit()
|
# tracker_download.combine_all('x')
|
||||||
del_id(params) # ['_manually']
|
elif cmd == 'icons':
|
||||||
|
if bundle_download.download_missing_icons(force=False):
|
||||||
|
rebuild_index()
|
||||||
|
elif cmd == 'index':
|
||||||
|
rebuild_index(inclRoot=True)
|
||||||
elif cmd == 'run':
|
elif cmd == 'run':
|
||||||
if len(params) == 0:
|
if len(params) == 0:
|
||||||
print_usage_and_exit()
|
print_usage_and_exit()
|
||||||
combine_and_update(params) # ['*'], where=['test.com']
|
combine_and_update(params) # ['*'], where=['test.com']
|
||||||
elif cmd == 'icons':
|
elif cmd == 'del':
|
||||||
if bundle_download.download_missing_icons(force=False):
|
if len(params) == 0:
|
||||||
html_index.process()
|
print_usage_and_exit()
|
||||||
elif cmd == 'tracker':
|
del_id(params) # ['_manually']
|
||||||
tracker_update()
|
|
||||||
# tracker_download.combine_all('x')
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
mylib.err('critical', e)
|
mylib.err('critical', e)
|
||||||
|
|||||||
Reference in New Issue
Block a user