Skip to content

Commit 2cb1a19

Browse files
committed
Upload dev version
Upload dev version
1 parent 7256c47 commit 2cb1a19

5 files changed

Lines changed: 26 additions & 9 deletions

File tree

file_automation/__init__.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,22 @@
55
read_zip_file, unzip_file, unzip_all
66

77
from file_automation.remote.google_drive.driver_instance import driver_instance
8+
from file_automation.remote.google_drive.search.search_drive import \
9+
search_all_file, search_field, search_file_mimetype
10+
from file_automation.remote.google_drive.upload.upload_to_driver import \
11+
upload_dir_to_folder, upload_to_folder, upload_dir_to_drive, upload_to_drive
12+
from file_automation.remote.google_drive.dir.folder_manager import add_folder
13+
from file_automation.remote.google_drive.share.share_file import \
14+
share_file_to_anyone, share_file_to_domain, share_file_to_user
15+
from file_automation.remote.google_drive.delete.delete_manager import delete_file
16+
from file_automation.remote.google_drive.download.download_file import download_file, download_file_from_folder
817

918
__all__ = [
1019
"copy_file", "rename_file", "remove_file", "copy_all_file_to_dir", "copy_specify_extension_file",
1120
"copy_dir", "create_dir", "copy_specify_extension_file", "remove_dir_tree",
1221
"zip_dir", "zip_file", "zip_info", "zip_file_info", "set_zip_password", "unzip_file", "read_zip_file",
13-
"unzip_all", "driver_instance",
22+
"unzip_all", "driver_instance", "search_all_file", "search_field", "search_file_mimetype",
23+
"upload_dir_to_folder", "upload_to_folder", "upload_dir_to_drive", "upload_to_drive",
24+
"add_folder", "share_file_to_anyone", "share_file_to_domain", "share_file_to_user",
25+
"delete_file", "download_file", "download_file_from_folder"
1426
]

file_automation/remote/google_drive/driver_instance.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111

1212
class GoogleDrive(object):
1313

14-
def __init__(self, token_path: str, credentials_path: str):
14+
def __init__(self):
1515
self.google_drive_instance = None
1616
self.creds = None
1717
self.service = None
1818
self.scopes = ["https://www.googleapis.com/auth/drive"]
19+
20+
def later_init(self, token_path: str, credentials_path: str):
1921
token_path = Path(token_path)
2022
credentials_path = Path(credentials_path)
2123
creds = None
@@ -50,4 +52,5 @@ def __init__(self, token_path: str, credentials_path: str):
5052
)
5153

5254

53-
driver_instance = GoogleDrive(str(Path(Path.cwd(), "token.json")), str(Path(Path.cwd(), "credentials.json")))
55+
driver_instance = GoogleDrive()
56+

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ requires = ["setuptools>=61.0"]
55
build-backend = "setuptools.build_meta"
66

77
[project]
8-
name = "automation_file"
9-
version = "0.0.4"
8+
name = "automation_file_dev"
9+
version = "0.0.6"
1010
authors = [
1111
{ name = "JE-Chen", email = "zenmailman@gmail.com" },
1212
]

dev.toml renamed to stable.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ requires = ["setuptools>=61.0"]
55
build-backend = "setuptools.build_meta"
66

77
[project]
8-
name = "automation_file_dev"
9-
version = "0.0.5"
8+
name = "automation_file"
9+
version = "0.0.4"
1010
authors = [
1111
{ name = "JE-Chen", email = "zenmailman@gmail.com" },
1212
]

tests/unit_test/remote/google_drive/quick_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
from pathlib import Path
2+
3+
from file_automation import driver_instance
14
from file_automation.remote.google_drive.search.search_drive import search_all_file
2-
from file_automation.remote.google_drive.upload.upload_to_driver import upload_dir_to_folder
35

6+
driver_instance.later_init(str(Path(Path.cwd(), "token.json")), str(Path(Path.cwd(), "credentials.json")))
47
print(search_all_file())
5-
print(upload_dir_to_folder(r"1J-m5cHqkXumaHqlHfL90BySEqWsG9zbP", r"C:\Users\JeffreyChen\Desktop\Paper"))

0 commit comments

Comments
 (0)