check, with edit option: ask to check if changes
This commit is contained in:
parent
fab895ec6b
commit
6a9ef0ed67
|
@ -38,13 +38,27 @@ def manage_check(target, option):
|
||||||
# Manage option
|
# Manage option
|
||||||
#--------------
|
#--------------
|
||||||
if option == 'Edit':
|
if option == 'Edit':
|
||||||
|
curr_hash = tyto.get_filesum(db.uri_file, True)
|
||||||
tyto.edit_file(db.uri_file)
|
tyto.edit_file(db.uri_file)
|
||||||
return
|
new_hash = tyto.get_filesum(db.uri_file, True)
|
||||||
|
if curr_hash != new_hash:
|
||||||
|
ask = ''
|
||||||
|
try:
|
||||||
|
ask = input('-> Check your changes ? ')
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print('')
|
||||||
|
logs.out("255", '', True)
|
||||||
|
if not ask in ['y', 'Y']:
|
||||||
|
logs.out("255", '', True)
|
||||||
|
else:
|
||||||
|
option = 'Force'
|
||||||
|
|
||||||
elif option == 'Show':
|
elif option == 'Show':
|
||||||
article_raw = open(db.uri_file).read()
|
article_raw = open(db.uri_file).read()
|
||||||
for line in article_raw.rsplit('\n'):
|
for line in article_raw.rsplit('\n'):
|
||||||
print(line)
|
print(line)
|
||||||
return
|
return
|
||||||
|
|
||||||
# Just read the DB from command
|
# Just read the DB from command
|
||||||
elif option == 'DB':
|
elif option == 'DB':
|
||||||
if db.db_exists:
|
if db.db_exists:
|
||||||
|
|
|
@ -194,8 +194,8 @@ def create_main_page(target, article_bottom):
|
||||||
def create_html_infos_section(process):
|
def create_html_infos_section(process):
|
||||||
# Need to reload the DB to get last time updated
|
# Need to reload the DB to get last time updated
|
||||||
exec(open(db.post_db).read(), globals())
|
exec(open(db.post_db).read(), globals())
|
||||||
global post_pub
|
|
||||||
|
|
||||||
|
global post_pub
|
||||||
if process == 'wip':
|
if process == 'wip':
|
||||||
date_raw = date_wip # <time datetime=
|
date_raw = date_wip # <time datetime=
|
||||||
date_pub = date_wip.rsplit(' ')[0]
|
date_pub = date_wip.rsplit(' ')[0]
|
||||||
|
|
Loading…
Reference in New Issue