mirror of
https://github.com/marty-oehme/scripts.git
synced 2024-12-22 07:58:08 +00:00
Add files via upload
This commit is contained in:
parent
1961bb8695
commit
f0e82411c9
1 changed files with 5 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import time
|
||||||
|
|
||||||
merge_to_first = sys.argv[1]
|
merge_to_first = sys.argv[1]
|
||||||
delete_merged = sys.argv[2]
|
delete_merged = sys.argv[2]
|
||||||
|
@ -19,6 +20,9 @@ else:
|
||||||
len(note_list),
|
len(note_list),
|
||||||
os.path.splitext(os.path.basename(note_list[0]))[0],
|
os.path.splitext(os.path.basename(note_list[0]))[0],
|
||||||
os.path.splitext(note_list[0])[1])
|
os.path.splitext(note_list[0])[1])
|
||||||
|
if os.path.isfile(output_path):
|
||||||
|
output_path = os.path.splitext(output_path)[0] + '_' + str(int(time.time())) + os.path.splitext(note_list[0])[1]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(output_path, 'w') as output:
|
with open(output_path, 'w') as output:
|
||||||
output.write('\n\n'.join(note_content_list))
|
output.write('\n\n'.join(note_content_list))
|
||||||
|
@ -27,4 +31,4 @@ except:
|
||||||
else:
|
else:
|
||||||
if delete_merged == 'true':
|
if delete_merged == 'true':
|
||||||
for note_path in note_list:
|
for note_path in note_list:
|
||||||
os.remove(note_path)
|
os.remove(note_path)
|
||||||
|
|
Loading…
Reference in a new issue