Skip to content

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
Co-authored-by: Sourcery AI <>
  • Loading branch information
sourcery-ai[bot] authored Sep 4, 2021
1 parent 9325fb1 commit cd00360
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
21 changes: 13 additions & 8 deletions bot/helper/mirror_utils/upload_utils/gdriveTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,14 +612,19 @@ def drive_query(self, parent_id, fileName):
if name != '':
query += f"name contains '{name}' and "
query += "trashed = false"
response = self.__service.files().list(supportsTeamDrives=True,
includeTeamDriveItems=True,
q=query,
spaces='drive',
pageSize=200,
fields='files(id, name, mimeType, size)',
orderBy='name asc').execute()
return response
return (
self.__service.files()
.list(
supportsTeamDrives=True,
includeTeamDriveItems=True,
q=query,
spaces='drive',
pageSize=200,
fields='files(id, name, mimeType, size)',
orderBy='name asc',
)
.execute()
)


def drive_list(self, fileName, stopDup=False):
Expand Down
12 changes: 5 additions & 7 deletions driveid.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,30 @@
print("\n\n"\
" DO YOU WISH TO KEEP THE ABOVE DETAILS THAT YOU PREVIOUSLY ADDED???? ENTER (y/n)\n"\
" IF NOTHING SHOWS ENTER n")
while (1):
while 1:
choice = input()
if choice == 'y' or choice == 'Y':
if choice in ['y', 'Y']:
msg = f'{lines}'
break
elif choice == 'n' or choice == 'N':
elif choice in ['n', 'N']:
break
else:
print("\n\n DO YOU WISH TO KEEP THE ABOVE DETAILS ???? y/n <=== this is option ..... OPEN YOUR EYES & READ...")
num = int(input(" How Many Drive/Folder You Likes To Add : "))
count = 1
while count <= num :
for count in range(1, num + 1):
print(f"\n > DRIVE - {count}\n")
name = input(" Enter Drive NAME (anything) : ")
id = input(" Enter Drive ID : ")
index = input(" Enter Drive INDEX URL (optional) : ")
if not name or not id:
print("\n\n ERROR : Dont leave the name/id without filling.")
exit(1)
exit(1)
name=name.replace(" ", "_")
if index:
if index[-1] == "/":
index = index[:-1]
else:
index = ''
count+=1
msg += f"{name} {id} {index}\n"
with open('drive_folder', 'w') as file:
file.truncate(0)
Expand Down

0 comments on commit cd00360

Please sign in to comment.