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
|
||||
#--------------
|
||||
if option == 'Edit':
|
||||
curr_hash = tyto.get_filesum(db.uri_file, True)
|
||||
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':
|
||||
article_raw = open(db.uri_file).read()
|
||||
for line in article_raw.rsplit('\n'):
|
||||
print(line)
|
||||
return
|
||||
|
||||
# Just read the DB from command
|
||||
elif option == 'DB':
|
||||
if db.db_exists:
|
||||
|
|
|
@ -194,8 +194,8 @@ def create_main_page(target, article_bottom):
|
|||
def create_html_infos_section(process):
|
||||
# Need to reload the DB to get last time updated
|
||||
exec(open(db.post_db).read(), globals())
|
||||
global post_pub
|
||||
|
||||
global post_pub
|
||||
if process == 'wip':
|
||||
date_raw = date_wip # <time datetime=
|
||||
date_pub = date_wip.rsplit(' ')[0]
|
||||
|
|
Loading…
Reference in New Issue