move main code to a function
This commit is contained in:
parent
8a2203ade7
commit
69f8a6470b
1 changed files with 33 additions and 27 deletions
|
@ -37,6 +37,9 @@ def folder_id(folder_name):
|
|||
return file1['id']
|
||||
|
||||
|
||||
def main():
|
||||
global seen, drive
|
||||
|
||||
read_seen()
|
||||
|
||||
gauth = GoogleAuth(settings_file=os.path.expanduser('~/.config/drive-download/settings.yaml'))
|
||||
|
@ -51,7 +54,7 @@ file_names_dupes = [f for f, count in collections.Counter(file_names).items() if
|
|||
if len(file_names_dupes) > 0:
|
||||
print('Duplicate filenames on Drive!')
|
||||
for fn in sorted(file_names_dupes):
|
||||
print(fn)
|
||||
print(shlex.quote(fn))
|
||||
sys.exit(1)
|
||||
|
||||
for file1 in file_list:
|
||||
|
@ -70,4 +73,7 @@ for file1 in file_list:
|
|||
print("{} exists locally!".format(shlex.quote(local_filename)))
|
||||
sys.exit(2)
|
||||
|
||||
|
||||
main()
|
||||
|
||||
# vim:tw=100:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue