'Refactored by Sourcery'

Co-authored-by: Sourcery AI <>
This commit is contained in:
sourcery-ai[bot] 2021-09-04 10:02:49 +07:00 committed by GitHub
parent 9325fb1d06
commit cd003605b0
Signed by untrusted user: GitHub
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 15 deletions

View File

@ -612,14 +612,19 @@ class GoogleDriveHelper:
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):

View File

@ -16,32 +16,30 @@ if os.path.exists('drive_folder'):
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)