diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py index c67376a..0d1282e 100644 --- a/src/var/lib/tyto/program/check.py +++ b/src/var/lib/tyto/program/check.py @@ -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: diff --git a/src/var/lib/tyto/program/html.py b/src/var/lib/tyto/program/html.py index 48c9573..fb7488f 100644 --- a/src/var/lib/tyto/program/html.py +++ b/src/var/lib/tyto/program/html.py @@ -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 #