csc-cia-stne 0.1.5__py3-none-any.whl → 0.1.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- csc_cia_stne/google_drive.py +20 -2
- {csc_cia_stne-0.1.5.dist-info → csc_cia_stne-0.1.7.dist-info}/METADATA +1 -1
- {csc_cia_stne-0.1.5.dist-info → csc_cia_stne-0.1.7.dist-info}/RECORD +6 -6
- {csc_cia_stne-0.1.5.dist-info → csc_cia_stne-0.1.7.dist-info}/WHEEL +0 -0
- {csc_cia_stne-0.1.5.dist-info → csc_cia_stne-0.1.7.dist-info}/licenses/LICENCE +0 -0
- {csc_cia_stne-0.1.5.dist-info → csc_cia_stne-0.1.7.dist-info}/top_level.txt +0 -0
csc_cia_stne/google_drive.py
CHANGED
@@ -350,15 +350,16 @@ class GoogleDrive:
|
|
350
350
|
fileId=file.get("id"), mimeType=mimeType
|
351
351
|
)
|
352
352
|
file_path = f"{path}{file["name"]}"
|
353
|
-
with open(
|
353
|
+
with open(file_path, "wb") as f:
|
354
354
|
f.write(request.execute())
|
355
355
|
return {
|
356
356
|
"success": True,
|
357
357
|
"result": file_path,
|
358
|
+
"error": None,
|
358
359
|
}
|
359
360
|
|
360
361
|
except Exception as e:
|
361
|
-
return {"success": False, "result": None}
|
362
|
+
return {"success": False, "result": None, "error": str(e)}
|
362
363
|
|
363
364
|
def download_others_files(self, file: str, path: str):
|
364
365
|
"""
|
@@ -425,3 +426,20 @@ class GoogleDrive:
|
|
425
426
|
return {"success": True, "result": values}
|
426
427
|
except Exception as e:
|
427
428
|
return {"success": False, "result": None, "error": str(e)}
|
429
|
+
|
430
|
+
def delete_file(self, id_file:str):
|
431
|
+
"""
|
432
|
+
Exclui um arquivo do Google Drive pelo seu ID.
|
433
|
+
Args:
|
434
|
+
id_file (str): O ID do arquivo a ser excluído.
|
435
|
+
Returns:
|
436
|
+
dict: Um dicionário indicando se a exclusão foi bem-sucedida.
|
437
|
+
- {"success": True} se o arquivo foi excluído com sucesso.
|
438
|
+
- {"success": False, "error": <mensagem de erro>} se ocorreu uma exceção.
|
439
|
+
"""
|
440
|
+
|
441
|
+
try:
|
442
|
+
self.service.files().delete(fileId=id_file).execute()
|
443
|
+
return {"success": True}
|
444
|
+
except Exception as e:
|
445
|
+
return {"success": False, "error": str(e)}
|
@@ -5,7 +5,7 @@ csc_cia_stne/email.py,sha256=K0DcgxTPKa_Rz_SJekjbW8Nw_1L9s_iuDDxZ-69bZfM,8387
|
|
5
5
|
csc_cia_stne/ftp.py,sha256=M9WCaq2hm56jGyszNaPinliFaZS0BNrT7VrVPMjkMg4,10988
|
6
6
|
csc_cia_stne/gcp_bigquery.py,sha256=foq8azvvv_f7uikMDslX9RcUIrx7RAS-Sn0AGW0QFQc,7231
|
7
7
|
csc_cia_stne/gcp_bucket.py,sha256=nP77BtagZ7jQq6lS88ZEa1qshzBza6e_LvhgS3_JJJk,10268
|
8
|
-
csc_cia_stne/google_drive.py,sha256=
|
8
|
+
csc_cia_stne/google_drive.py,sha256=6A_Um3FUAzT9rpAH8S94X5cVgFmD_99KfMytI0p3mGA,17050
|
9
9
|
csc_cia_stne/karavela.py,sha256=jJCYX43D49gGuzmwwK6bN9XVnv2dXdp9iHnnV5H1LMQ,4794
|
10
10
|
csc_cia_stne/logger_json.py,sha256=CXxSCOFGMymDi8XE9SKnPKjW4D0wJLqDLnxqePS26i8,3187
|
11
11
|
csc_cia_stne/logger_rich.py,sha256=fklgkBb4rblKQd7YZ3q-eWfhGg9eflO2k2-z4pGh_yo,5201
|
@@ -36,8 +36,8 @@ csc_cia_stne/utilitarios/web_screen/__init__.py,sha256=5QcOPXKd95SvP2DoZiHS0gaU6
|
|
36
36
|
csc_cia_stne/utilitarios/web_screen/web_screen_abstract.py,sha256=PjL8Vgfj_JdKidia7RFyCkro3avYLQu4RZRos41sh3w,3241
|
37
37
|
csc_cia_stne/utilitarios/web_screen/web_screen_botcity.py,sha256=Xi5YJjl2pcxlX3OimqcBWRNXZEpAE7asyUjDJ4Oho5U,12297
|
38
38
|
csc_cia_stne/utilitarios/web_screen/web_screen_selenium.py,sha256=JLIcPJE9ZX3Pd6zG6oTRMqqUAY063UzLY3ReRlxmiSM,15581
|
39
|
-
csc_cia_stne-0.1.
|
40
|
-
csc_cia_stne-0.1.
|
41
|
-
csc_cia_stne-0.1.
|
42
|
-
csc_cia_stne-0.1.
|
43
|
-
csc_cia_stne-0.1.
|
39
|
+
csc_cia_stne-0.1.7.dist-info/licenses/LICENCE,sha256=LPGMtgKki2C3KEZP7hDhA1HBrlq5JCHkIeStUCLEMx4,1073
|
40
|
+
csc_cia_stne-0.1.7.dist-info/METADATA,sha256=GkXsvzHqf4lVNteEBDDSSq1lpOk4sNbcgVF6N2E6z5A,1463
|
41
|
+
csc_cia_stne-0.1.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
42
|
+
csc_cia_stne-0.1.7.dist-info/top_level.txt,sha256=ldo7GVv3tQx5KJvwBzdZzzQmjPys2NDVVn1rv0BOF2Q,13
|
43
|
+
csc_cia_stne-0.1.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|