1
0
Fork 0
mirror of https://github.com/marty-oehme/scripts.git synced 2024-12-22 07:58:08 +00:00

Minor tweaks

This commit is contained in:
Maboroshy 2017-09-14 22:25:44 +03:00 committed by GitHub
parent 96abe16fa7
commit ba259c6e2f

View file

@ -251,9 +251,6 @@ if __name__ == '__main__':
if file[-5:] == '.lock': if file[-5:] == '.lock':
os.remove(script_path + os.sep + file) os.remove(script_path + os.sep + file)
lockfile_path = script_path + os.sep + str(int(time.time())) + '.lock'
open(lockfile_path, 'w').close()
arg_parser = argparse.ArgumentParser(description='A script to turn everything in the inbox directory to markdown notes.') arg_parser = argparse.ArgumentParser(description='A script to turn everything in the inbox directory to markdown notes.')
arg_parser.add_argument('-i', '--inbox', action='store', dest='inbox_dir', required=True, arg_parser.add_argument('-i', '--inbox', action='store', dest='inbox_dir', required=True,
help="Full absolute path to the inbox directory to organize") help="Full absolute path to the inbox directory to organize")
@ -335,6 +332,9 @@ if __name__ == '__main__':
write_note_and_delete(obj_to_write) write_note_and_delete(obj_to_write)
lockfile_path = script_path + os.sep + str(int(time.time())) + '.lock'
open(lockfile_path, 'w').close()
event_handler = FsEventHandler() event_handler = FsEventHandler()
observer = watchdog.observers.Observer() observer = watchdog.observers.Observer()
observer.schedule(event_handler, scan_path, recursive=True) observer.schedule(event_handler, scan_path, recursive=True)