From ba259c6e2f2548ae54b8988a5e14acf381c6cc3a Mon Sep 17 00:00:00 2001 From: Maboroshy Date: Thu, 14 Sep 2017 22:25:44 +0300 Subject: [PATCH] Minor tweaks --- inbox/inbox.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inbox/inbox.py b/inbox/inbox.py index cebcd42..713fe39 100644 --- a/inbox/inbox.py +++ b/inbox/inbox.py @@ -251,9 +251,6 @@ if __name__ == '__main__': if file[-5:] == '.lock': 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.add_argument('-i', '--inbox', action='store', dest='inbox_dir', required=True, help="Full absolute path to the inbox directory to organize") @@ -335,6 +332,9 @@ if __name__ == '__main__': 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() observer = watchdog.observers.Observer() observer.schedule(event_handler, scan_path, recursive=True)