From 6b106a0060a7bb9a3262bec65c08a0f476e6d7d7 Mon Sep 17 00:00:00 2001 From: JE-Chen45 Date: Tue, 8 Aug 2023 11:17:13 +0800 Subject: [PATCH] Rename package and update version Rename package and update version --- .../__init__.py | 30 ++++++++--------- .../__main__.py | 14 ++++---- .../local/__init__.py | 0 .../local/dir/__init__.py | 0 .../local/dir/dir_process.py | 4 +-- .../local/file/__init__.py | 0 .../local/file/file_process.py | 4 +-- .../local/zip/__init__.py | 0 .../local/zip/zip_process.py | 4 +-- .../remote/__init__.py | 0 .../remote/google_drive/__init__.py | 0 .../remote/google_drive/delete/__init__.py | 0 .../google_drive/delete/delete_manager.py | 4 +-- .../remote/google_drive/dir/__init__.py | 0 .../remote/google_drive/dir/folder_manager.py | 4 +-- .../remote/google_drive/download/__init__.py | 0 .../google_drive/download/download_file.py | 4 +-- .../remote/google_drive/driver_instance.py | 2 +- .../remote/google_drive/search/__init__.py | 0 .../google_drive/search/search_drive.py | 4 +-- .../remote/google_drive/share/__init__.py | 0 .../remote/google_drive/share/share_file.py | 4 +-- .../remote/google_drive/upload/__init__.py | 0 .../google_drive/upload/upload_to_driver.py | 4 +-- .../utils/__init__.py | 0 .../utils/callback/__init__.py | 0 .../callback/callback_function_executor.py | 26 +++++++-------- .../utils/exception/__init__.py | 0 .../utils/exception/exception_tags.py | 0 .../utils/exception/exceptions.py | 0 .../utils/executor/__init__.py | 0 .../utils/executor/action_executor.py | 32 +++++++++---------- .../utils/file_process/__init__.py | 0 .../utils/file_process/get_dir_file_list.py | 0 .../utils/json/__init__.py | 0 .../utils/json/json_file.py | 6 ++-- .../utils/logging/__init__.py | 0 .../utils/logging/loggin_instance.py | 0 .../utils/package_manager/__init__.py | 0 .../package_manager/package_manager_class.py | 2 +- .../utils/project/__init__.py | 0 .../utils/project/create_project_structure.py | 8 ++--- .../utils/project/template/__init__.py | 0 .../project/template/template_executor.py | 0 .../project/template/template_keyword.py | 0 .../utils/scheduler/__init__.py | 0 .../utils/scheduler/extend_apscheduler.py | 0 .../utils/socket_server/__init__.py | 0 .../file_automation_socket_server.py | 2 +- dev.toml | 2 +- pyproject.toml | 2 +- tests/unit_test/executor/executor_test.py | 2 +- tests/unit_test/local/dir/dir_test.py | 2 +- tests/unit_test/local/file/test_file.py | 4 +-- tests/unit_test/local/zip/zip_test.py | 4 +-- .../remote/google_drive/quick_test.py | 4 +-- 56 files changed, 89 insertions(+), 89 deletions(-) rename {file_automation => automation_file}/__init__.py (62%) rename {file_automation => automation_file}/__main__.py (80%) rename {file_automation => automation_file}/local/__init__.py (100%) rename {file_automation => automation_file}/local/dir/__init__.py (100%) rename {file_automation => automation_file}/local/dir/dir_process.py (93%) rename {file_automation => automation_file}/local/file/__init__.py (100%) rename {file_automation => automation_file}/local/file/file_process.py (96%) rename {file_automation => automation_file}/local/zip/__init__.py (100%) rename {file_automation => automation_file}/local/zip/zip_process.py (96%) rename {file_automation => automation_file}/remote/__init__.py (100%) rename {file_automation => automation_file}/remote/google_drive/__init__.py (100%) rename {file_automation => automation_file}/remote/google_drive/delete/__init__.py (100%) rename {file_automation => automation_file}/remote/google_drive/delete/delete_manager.py (80%) rename {file_automation => automation_file}/remote/google_drive/dir/__init__.py (100%) rename {file_automation => automation_file}/remote/google_drive/dir/folder_manager.py (85%) rename {file_automation => automation_file}/remote/google_drive/download/__init__.py (100%) rename {file_automation => automation_file}/remote/google_drive/download/download_file.py (93%) rename {file_automation => automation_file}/remote/google_drive/driver_instance.py (96%) rename {file_automation => automation_file}/remote/google_drive/search/__init__.py (100%) rename {file_automation => automation_file}/remote/google_drive/search/search_drive.py (94%) rename {file_automation => automation_file}/remote/google_drive/share/__init__.py (100%) rename {file_automation => automation_file}/remote/google_drive/share/share_file.py (94%) rename {file_automation => automation_file}/remote/google_drive/upload/__init__.py (100%) rename {file_automation => automation_file}/remote/google_drive/upload/upload_to_driver.py (96%) rename {file_automation => automation_file}/utils/__init__.py (100%) rename {file_automation => automation_file}/utils/callback/__init__.py (100%) rename {file_automation => automation_file}/utils/callback/callback_function_executor.py (84%) rename {file_automation => automation_file}/utils/exception/__init__.py (100%) rename {file_automation => automation_file}/utils/exception/exception_tags.py (100%) rename {file_automation => automation_file}/utils/exception/exceptions.py (100%) rename {file_automation => automation_file}/utils/executor/__init__.py (100%) rename {file_automation => automation_file}/utils/executor/action_executor.py (88%) rename {file_automation => automation_file}/utils/file_process/__init__.py (100%) rename {file_automation => automation_file}/utils/file_process/get_dir_file_list.py (100%) rename {file_automation => automation_file}/utils/json/__init__.py (100%) rename {file_automation => automation_file}/utils/json/json_file.py (87%) rename {file_automation => automation_file}/utils/logging/__init__.py (100%) rename {file_automation => automation_file}/utils/logging/loggin_instance.py (100%) rename {file_automation => automation_file}/utils/package_manager/__init__.py (100%) rename {file_automation => automation_file}/utils/package_manager/package_manager_class.py (98%) rename {file_automation => automation_file}/utils/project/__init__.py (100%) rename {file_automation => automation_file}/utils/project/create_project_structure.py (91%) rename {file_automation => automation_file}/utils/project/template/__init__.py (100%) rename {file_automation => automation_file}/utils/project/template/template_executor.py (100%) rename {file_automation => automation_file}/utils/project/template/template_keyword.py (100%) rename {file_automation => automation_file}/utils/scheduler/__init__.py (100%) rename {file_automation => automation_file}/utils/scheduler/extend_apscheduler.py (100%) rename {file_automation => automation_file}/utils/socket_server/__init__.py (100%) rename {file_automation => automation_file}/utils/socket_server/file_automation_socket_server.py (97%) diff --git a/file_automation/__init__.py b/automation_file/__init__.py similarity index 62% rename from file_automation/__init__.py rename to automation_file/__init__.py index 2010543..a97bd38 100644 --- a/file_automation/__init__.py +++ b/automation_file/__init__.py @@ -1,28 +1,28 @@ -from file_automation.local.dir.dir_process import copy_dir, rename_dir, create_dir, remove_dir_tree -from file_automation.local.file.file_process import copy_file, remove_file, rename_file, copy_specify_extension_file, \ +from automation_file.local.dir.dir_process import copy_dir, rename_dir, create_dir, remove_dir_tree +from automation_file.local.file.file_process import copy_file, remove_file, rename_file, copy_specify_extension_file, \ copy_all_file_to_dir -from file_automation.local.zip.zip_process import zip_dir, zip_file, zip_info, zip_file_info, set_zip_password, \ +from automation_file.local.zip.zip_process import zip_dir, zip_file, zip_info, zip_file_info, set_zip_password, \ read_zip_file, unzip_file, unzip_all -from file_automation.remote.google_drive.delete.delete_manager import drive_delete_file -from file_automation.remote.google_drive.dir.folder_manager import drive_add_folder -from file_automation.remote.google_drive.download.download_file import drive_download_file, \ +from automation_file.remote.google_drive.delete.delete_manager import drive_delete_file +from automation_file.remote.google_drive.dir.folder_manager import drive_add_folder +from automation_file.remote.google_drive.download.download_file import drive_download_file, \ drive_download_file_from_folder -from file_automation.remote.google_drive.driver_instance import driver_instance -from file_automation.remote.google_drive.search.search_drive import \ +from automation_file.remote.google_drive.driver_instance import driver_instance +from automation_file.remote.google_drive.search.search_drive import \ drive_search_all_file, drive_search_field, drive_search_file_mimetype -from file_automation.remote.google_drive.share.share_file import \ +from automation_file.remote.google_drive.share.share_file import \ drive_share_file_to_anyone, drive_share_file_to_domain, drive_share_file_to_user -from file_automation.remote.google_drive.upload.upload_to_driver import \ +from automation_file.remote.google_drive.upload.upload_to_driver import \ drive_upload_dir_to_folder, drive_upload_to_folder, drive_upload_dir_to_drive, drive_upload_to_drive -from file_automation.utils.executor.action_executor import execute_action, execute_files, add_command_to_executor -from file_automation.utils.file_process.get_dir_file_list import get_dir_files_as_list -from file_automation.utils.json.json_file import read_action_json -from file_automation.utils.project.create_project_structure import create_project_dir +from automation_file.utils.executor.action_executor import execute_action, execute_files, add_command_to_executor +from automation_file.utils.file_process.get_dir_file_list import get_dir_files_as_list +from automation_file.utils.json.json_file import read_action_json +from automation_file.utils.project.create_project_structure import create_project_dir __all__ = [ "copy_file", "rename_file", "remove_file", "copy_all_file_to_dir", "copy_specify_extension_file", "copy_dir", "create_dir", "remove_dir_tree", "zip_dir", "zip_file", "zip_info", - "zip_file_info", "set_zip_password", "unzip_file", "read_zip_file", + "zip_file_info", "set_zip_password", "unzip_file", "read_zip_file", "rename_dir", "unzip_all", "driver_instance", "drive_search_all_file", "drive_search_field", "drive_search_file_mimetype", "drive_upload_dir_to_folder", "drive_upload_to_folder", "drive_upload_dir_to_drive", "drive_upload_to_drive", "drive_add_folder", "drive_share_file_to_anyone", "drive_share_file_to_domain", "drive_share_file_to_user", diff --git a/file_automation/__main__.py b/automation_file/__main__.py similarity index 80% rename from file_automation/__main__.py rename to automation_file/__main__.py index 992370c..f6836ea 100644 --- a/file_automation/__main__.py +++ b/automation_file/__main__.py @@ -3,16 +3,16 @@ import json import sys -from file_automation.utils.exception.exception_tags import \ +from automation_file.utils.exception.exception_tags import \ argparse_get_wrong_data -from file_automation.utils.exception.exceptions import \ +from automation_file.utils.exception.exceptions import \ ArgparseException -from file_automation.utils.executor.action_executor import execute_action -from file_automation.utils.executor.action_executor import execute_files -from file_automation.utils.file_process.get_dir_file_list import \ +from automation_file.utils.executor.action_executor import execute_action +from automation_file.utils.executor.action_executor import execute_files +from automation_file.utils.file_process.get_dir_file_list import \ get_dir_files_as_list -from file_automation.utils.json.json_file import read_action_json -from file_automation.utils.project.create_project_structure import create_project_dir +from automation_file.utils.json.json_file import read_action_json +from automation_file.utils.project.create_project_structure import create_project_dir if __name__ == "__main__": try: diff --git a/file_automation/local/__init__.py b/automation_file/local/__init__.py similarity index 100% rename from file_automation/local/__init__.py rename to automation_file/local/__init__.py diff --git a/file_automation/local/dir/__init__.py b/automation_file/local/dir/__init__.py similarity index 100% rename from file_automation/local/dir/__init__.py rename to automation_file/local/dir/__init__.py diff --git a/file_automation/local/dir/dir_process.py b/automation_file/local/dir/dir_process.py similarity index 93% rename from file_automation/local/dir/dir_process.py rename to automation_file/local/dir/dir_process.py index d1e9285..cb00ce7 100644 --- a/file_automation/local/dir/dir_process.py +++ b/automation_file/local/dir/dir_process.py @@ -2,8 +2,8 @@ import sys from pathlib import Path -from file_automation.utils.exception.exceptions import DirNotExistsException -from file_automation.utils.logging.loggin_instance import file_automation_logger +from automation_file.utils.exception.exceptions import DirNotExistsException +from automation_file.utils.logging.loggin_instance import file_automation_logger def copy_dir(dir_path: str, target_dir_path: str) -> None: diff --git a/file_automation/local/file/__init__.py b/automation_file/local/file/__init__.py similarity index 100% rename from file_automation/local/file/__init__.py rename to automation_file/local/file/__init__.py diff --git a/file_automation/local/file/file_process.py b/automation_file/local/file/file_process.py similarity index 96% rename from file_automation/local/file/file_process.py rename to automation_file/local/file/file_process.py index ca5cc07..9e90ed3 100644 --- a/file_automation/local/file/file_process.py +++ b/automation_file/local/file/file_process.py @@ -2,8 +2,8 @@ import sys from pathlib import Path -from file_automation.utils.exception.exceptions import FileNotExistsException, DirNotExistsException -from file_automation.utils.logging.loggin_instance import file_automation_logger +from automation_file.utils.exception.exceptions import FileNotExistsException, DirNotExistsException +from automation_file.utils.logging.loggin_instance import file_automation_logger def copy_file(file_path: str, target_path: str) -> None: diff --git a/file_automation/local/zip/__init__.py b/automation_file/local/zip/__init__.py similarity index 100% rename from file_automation/local/zip/__init__.py rename to automation_file/local/zip/__init__.py diff --git a/file_automation/local/zip/zip_process.py b/automation_file/local/zip/zip_process.py similarity index 96% rename from file_automation/local/zip/zip_process.py rename to automation_file/local/zip/zip_process.py index c09f57a..25cde44 100644 --- a/file_automation/local/zip/zip_process.py +++ b/automation_file/local/zip/zip_process.py @@ -3,8 +3,8 @@ from shutil import make_archive from typing import List -from file_automation.utils.exception.exceptions import ZIPGetWrongFileException -from file_automation.utils.logging.loggin_instance import file_automation_logger +from automation_file.utils.exception.exceptions import ZIPGetWrongFileException +from automation_file.utils.logging.loggin_instance import file_automation_logger def zip_dir(dir_we_want_to_zip: str, zip_name: str) -> None: diff --git a/file_automation/remote/__init__.py b/automation_file/remote/__init__.py similarity index 100% rename from file_automation/remote/__init__.py rename to automation_file/remote/__init__.py diff --git a/file_automation/remote/google_drive/__init__.py b/automation_file/remote/google_drive/__init__.py similarity index 100% rename from file_automation/remote/google_drive/__init__.py rename to automation_file/remote/google_drive/__init__.py diff --git a/file_automation/remote/google_drive/delete/__init__.py b/automation_file/remote/google_drive/delete/__init__.py similarity index 100% rename from file_automation/remote/google_drive/delete/__init__.py rename to automation_file/remote/google_drive/delete/__init__.py diff --git a/file_automation/remote/google_drive/delete/delete_manager.py b/automation_file/remote/google_drive/delete/delete_manager.py similarity index 80% rename from file_automation/remote/google_drive/delete/delete_manager.py rename to automation_file/remote/google_drive/delete/delete_manager.py index cd6f9d4..148b20f 100644 --- a/file_automation/remote/google_drive/delete/delete_manager.py +++ b/automation_file/remote/google_drive/delete/delete_manager.py @@ -2,8 +2,8 @@ from googleapiclient.errors import HttpError -from file_automation.remote.google_drive.driver_instance import driver_instance -from file_automation.utils.logging.loggin_instance import file_automation_logger +from automation_file.remote.google_drive.driver_instance import driver_instance +from automation_file.utils.logging.loggin_instance import file_automation_logger def drive_delete_file(file_id: str) -> Union[Dict[str, str], None]: diff --git a/file_automation/remote/google_drive/dir/__init__.py b/automation_file/remote/google_drive/dir/__init__.py similarity index 100% rename from file_automation/remote/google_drive/dir/__init__.py rename to automation_file/remote/google_drive/dir/__init__.py diff --git a/file_automation/remote/google_drive/dir/folder_manager.py b/automation_file/remote/google_drive/dir/folder_manager.py similarity index 85% rename from file_automation/remote/google_drive/dir/folder_manager.py rename to automation_file/remote/google_drive/dir/folder_manager.py index 24f2f06..b6c0fb1 100644 --- a/file_automation/remote/google_drive/dir/folder_manager.py +++ b/automation_file/remote/google_drive/dir/folder_manager.py @@ -2,8 +2,8 @@ from googleapiclient.errors import HttpError -from file_automation.remote.google_drive.driver_instance import driver_instance -from file_automation.utils.logging.loggin_instance import file_automation_logger +from automation_file.remote.google_drive.driver_instance import driver_instance +from automation_file.utils.logging.loggin_instance import file_automation_logger def drive_add_folder(folder_name: str) -> Union[dict, None]: diff --git a/file_automation/remote/google_drive/download/__init__.py b/automation_file/remote/google_drive/download/__init__.py similarity index 100% rename from file_automation/remote/google_drive/download/__init__.py rename to automation_file/remote/google_drive/download/__init__.py diff --git a/file_automation/remote/google_drive/download/download_file.py b/automation_file/remote/google_drive/download/download_file.py similarity index 93% rename from file_automation/remote/google_drive/download/download_file.py rename to automation_file/remote/google_drive/download/download_file.py index 531347e..4e58631 100644 --- a/file_automation/remote/google_drive/download/download_file.py +++ b/automation_file/remote/google_drive/download/download_file.py @@ -5,8 +5,8 @@ from googleapiclient.errors import HttpError from googleapiclient.http import MediaIoBaseDownload -from file_automation.remote.google_drive.driver_instance import driver_instance -from file_automation.utils.logging.loggin_instance import file_automation_logger +from automation_file.remote.google_drive.driver_instance import driver_instance +from automation_file.utils.logging.loggin_instance import file_automation_logger def drive_download_file(file_id: str, file_name: str) -> BytesIO: diff --git a/file_automation/remote/google_drive/driver_instance.py b/automation_file/remote/google_drive/driver_instance.py similarity index 96% rename from file_automation/remote/google_drive/driver_instance.py rename to automation_file/remote/google_drive/driver_instance.py index 274c42a..1b8a0e0 100644 --- a/file_automation/remote/google_drive/driver_instance.py +++ b/automation_file/remote/google_drive/driver_instance.py @@ -6,7 +6,7 @@ from googleapiclient.discovery import build from googleapiclient.errors import HttpError -from file_automation.utils.logging.loggin_instance import file_automation_logger +from automation_file.utils.logging.loggin_instance import file_automation_logger class GoogleDrive(object): diff --git a/file_automation/remote/google_drive/search/__init__.py b/automation_file/remote/google_drive/search/__init__.py similarity index 100% rename from file_automation/remote/google_drive/search/__init__.py rename to automation_file/remote/google_drive/search/__init__.py diff --git a/file_automation/remote/google_drive/search/search_drive.py b/automation_file/remote/google_drive/search/search_drive.py similarity index 94% rename from file_automation/remote/google_drive/search/search_drive.py rename to automation_file/remote/google_drive/search/search_drive.py index df79739..5272c84 100644 --- a/file_automation/remote/google_drive/search/search_drive.py +++ b/automation_file/remote/google_drive/search/search_drive.py @@ -2,8 +2,8 @@ from googleapiclient.errors import HttpError -from file_automation.remote.google_drive.driver_instance import driver_instance -from file_automation.utils.logging.loggin_instance import file_automation_logger +from automation_file.remote.google_drive.driver_instance import driver_instance +from automation_file.utils.logging.loggin_instance import file_automation_logger def drive_search_all_file() -> Union[dict, None]: diff --git a/file_automation/remote/google_drive/share/__init__.py b/automation_file/remote/google_drive/share/__init__.py similarity index 100% rename from file_automation/remote/google_drive/share/__init__.py rename to automation_file/remote/google_drive/share/__init__.py diff --git a/file_automation/remote/google_drive/share/share_file.py b/automation_file/remote/google_drive/share/share_file.py similarity index 94% rename from file_automation/remote/google_drive/share/share_file.py rename to automation_file/remote/google_drive/share/share_file.py index badf64b..1fc3b36 100644 --- a/file_automation/remote/google_drive/share/share_file.py +++ b/automation_file/remote/google_drive/share/share_file.py @@ -2,8 +2,8 @@ from googleapiclient.errors import HttpError -from file_automation.remote.google_drive.driver_instance import driver_instance -from file_automation.utils.logging.loggin_instance import file_automation_logger +from automation_file.remote.google_drive.driver_instance import driver_instance +from automation_file.utils.logging.loggin_instance import file_automation_logger def drive_share_file_to_user( diff --git a/file_automation/remote/google_drive/upload/__init__.py b/automation_file/remote/google_drive/upload/__init__.py similarity index 100% rename from file_automation/remote/google_drive/upload/__init__.py rename to automation_file/remote/google_drive/upload/__init__.py diff --git a/file_automation/remote/google_drive/upload/upload_to_driver.py b/automation_file/remote/google_drive/upload/upload_to_driver.py similarity index 96% rename from file_automation/remote/google_drive/upload/upload_to_driver.py rename to automation_file/remote/google_drive/upload/upload_to_driver.py index 1cf0afa..12ef917 100644 --- a/file_automation/remote/google_drive/upload/upload_to_driver.py +++ b/automation_file/remote/google_drive/upload/upload_to_driver.py @@ -4,8 +4,8 @@ from googleapiclient.errors import HttpError from googleapiclient.http import MediaFileUpload -from file_automation.remote.google_drive.driver_instance import driver_instance -from file_automation.utils.logging.loggin_instance import file_automation_logger +from automation_file.remote.google_drive.driver_instance import driver_instance +from automation_file.utils.logging.loggin_instance import file_automation_logger def drive_upload_to_drive(file_path: str, file_name: str = None) -> Union[dict, None]: diff --git a/file_automation/utils/__init__.py b/automation_file/utils/__init__.py similarity index 100% rename from file_automation/utils/__init__.py rename to automation_file/utils/__init__.py diff --git a/file_automation/utils/callback/__init__.py b/automation_file/utils/callback/__init__.py similarity index 100% rename from file_automation/utils/callback/__init__.py rename to automation_file/utils/callback/__init__.py diff --git a/file_automation/utils/callback/callback_function_executor.py b/automation_file/utils/callback/callback_function_executor.py similarity index 84% rename from file_automation/utils/callback/callback_function_executor.py rename to automation_file/utils/callback/callback_function_executor.py index be5dd1e..99c6a04 100644 --- a/file_automation/utils/callback/callback_function_executor.py +++ b/automation_file/utils/callback/callback_function_executor.py @@ -1,23 +1,23 @@ import typing -from file_automation.local.dir.dir_process import copy_dir, create_dir, remove_dir_tree -from file_automation.local.file.file_process import copy_file, remove_file, rename_file, copy_specify_extension_file, \ +from automation_file.local.dir.dir_process import copy_dir, create_dir, remove_dir_tree +from automation_file.local.file.file_process import copy_file, remove_file, rename_file, copy_specify_extension_file, \ copy_all_file_to_dir -from file_automation.local.zip.zip_process import zip_dir, zip_file, zip_info, zip_file_info, set_zip_password, \ +from automation_file.local.zip.zip_process import zip_dir, zip_file, zip_info, zip_file_info, set_zip_password, \ read_zip_file, unzip_file, unzip_all -from file_automation.remote.google_drive.delete.delete_manager import drive_delete_file -from file_automation.remote.google_drive.dir.folder_manager import drive_add_folder -from file_automation.remote.google_drive.download.download_file import drive_download_file, drive_download_file_from_folder -from file_automation.remote.google_drive.driver_instance import driver_instance -from file_automation.remote.google_drive.search.search_drive import \ +from automation_file.remote.google_drive.delete.delete_manager import drive_delete_file +from automation_file.remote.google_drive.dir.folder_manager import drive_add_folder +from automation_file.remote.google_drive.download.download_file import drive_download_file, drive_download_file_from_folder +from automation_file.remote.google_drive.driver_instance import driver_instance +from automation_file.remote.google_drive.search.search_drive import \ drive_search_all_file, drive_search_field, drive_search_file_mimetype -from file_automation.remote.google_drive.share.share_file import \ +from automation_file.remote.google_drive.share.share_file import \ drive_share_file_to_anyone, drive_share_file_to_domain, drive_share_file_to_user -from file_automation.remote.google_drive.upload.upload_to_driver import \ +from automation_file.remote.google_drive.upload.upload_to_driver import \ drive_upload_dir_to_folder, drive_upload_to_folder, drive_upload_dir_to_drive, drive_upload_to_drive -from file_automation.utils.exception.exception_tags import get_bad_trigger_function, get_bad_trigger_method -from file_automation.utils.exception.exceptions import CallbackExecutorException -from file_automation.utils.logging.loggin_instance import file_automation_logger +from automation_file.utils.exception.exception_tags import get_bad_trigger_function, get_bad_trigger_method +from automation_file.utils.exception.exceptions import CallbackExecutorException +from automation_file.utils.logging.loggin_instance import file_automation_logger class CallbackFunctionExecutor(object): diff --git a/file_automation/utils/exception/__init__.py b/automation_file/utils/exception/__init__.py similarity index 100% rename from file_automation/utils/exception/__init__.py rename to automation_file/utils/exception/__init__.py diff --git a/file_automation/utils/exception/exception_tags.py b/automation_file/utils/exception/exception_tags.py similarity index 100% rename from file_automation/utils/exception/exception_tags.py rename to automation_file/utils/exception/exception_tags.py diff --git a/file_automation/utils/exception/exceptions.py b/automation_file/utils/exception/exceptions.py similarity index 100% rename from file_automation/utils/exception/exceptions.py rename to automation_file/utils/exception/exceptions.py diff --git a/file_automation/utils/executor/__init__.py b/automation_file/utils/executor/__init__.py similarity index 100% rename from file_automation/utils/executor/__init__.py rename to automation_file/utils/executor/__init__.py diff --git a/file_automation/utils/executor/action_executor.py b/automation_file/utils/executor/action_executor.py similarity index 88% rename from file_automation/utils/executor/action_executor.py rename to automation_file/utils/executor/action_executor.py index aa6c344..76c7ee6 100644 --- a/file_automation/utils/executor/action_executor.py +++ b/automation_file/utils/executor/action_executor.py @@ -3,29 +3,29 @@ from inspect import getmembers, isbuiltin from typing import Union, Any -from file_automation.local.dir.dir_process import copy_dir, create_dir, remove_dir_tree -from file_automation.local.file.file_process import copy_file, remove_file, rename_file, copy_specify_extension_file, \ +from automation_file.local.dir.dir_process import copy_dir, create_dir, remove_dir_tree +from automation_file.local.file.file_process import copy_file, remove_file, rename_file, copy_specify_extension_file, \ copy_all_file_to_dir, create_file -from file_automation.local.zip.zip_process import zip_dir, zip_file, zip_info, zip_file_info, set_zip_password, \ +from automation_file.local.zip.zip_process import zip_dir, zip_file, zip_info, zip_file_info, set_zip_password, \ read_zip_file, unzip_file, unzip_all -from file_automation.remote.google_drive.delete.delete_manager import drive_delete_file -from file_automation.remote.google_drive.dir.folder_manager import drive_add_folder -from file_automation.remote.google_drive.download.download_file import drive_download_file, \ +from automation_file.remote.google_drive.delete.delete_manager import drive_delete_file +from automation_file.remote.google_drive.dir.folder_manager import drive_add_folder +from automation_file.remote.google_drive.download.download_file import drive_download_file, \ drive_download_file_from_folder -from file_automation.remote.google_drive.driver_instance import driver_instance -from file_automation.remote.google_drive.search.search_drive import \ +from automation_file.remote.google_drive.driver_instance import driver_instance +from automation_file.remote.google_drive.search.search_drive import \ drive_search_all_file, drive_search_field, drive_search_file_mimetype -from file_automation.remote.google_drive.share.share_file import \ +from automation_file.remote.google_drive.share.share_file import \ drive_share_file_to_anyone, drive_share_file_to_domain, drive_share_file_to_user -from file_automation.remote.google_drive.upload.upload_to_driver import \ +from automation_file.remote.google_drive.upload.upload_to_driver import \ drive_upload_dir_to_folder, drive_upload_to_folder, drive_upload_dir_to_drive, drive_upload_to_drive -from file_automation.utils.exception.exception_tags import add_command_exception, executor_list_error, \ +from automation_file.utils.exception.exception_tags import add_command_exception, executor_list_error, \ action_is_null_error, cant_execute_action_error -from file_automation.utils.exception.exceptions import ExecuteActionException, AddCommandException -from file_automation.utils.json.json_file import read_action_json -from file_automation.utils.logging.loggin_instance import file_automation_logger -from file_automation.utils.package_manager.package_manager_class import package_manager -from file_automation.utils.scheduler.extend_apscheduler import scheduler_manager +from automation_file.utils.exception.exceptions import ExecuteActionException, AddCommandException +from automation_file.utils.json.json_file import read_action_json +from automation_file.utils.logging.loggin_instance import file_automation_logger +from automation_file.utils.package_manager.package_manager_class import package_manager +from automation_file.utils.scheduler.extend_apscheduler import scheduler_manager class Executor(object): diff --git a/file_automation/utils/file_process/__init__.py b/automation_file/utils/file_process/__init__.py similarity index 100% rename from file_automation/utils/file_process/__init__.py rename to automation_file/utils/file_process/__init__.py diff --git a/file_automation/utils/file_process/get_dir_file_list.py b/automation_file/utils/file_process/get_dir_file_list.py similarity index 100% rename from file_automation/utils/file_process/get_dir_file_list.py rename to automation_file/utils/file_process/get_dir_file_list.py diff --git a/file_automation/utils/json/__init__.py b/automation_file/utils/json/__init__.py similarity index 100% rename from file_automation/utils/json/__init__.py rename to automation_file/utils/json/__init__.py diff --git a/file_automation/utils/json/json_file.py b/automation_file/utils/json/json_file.py similarity index 87% rename from file_automation/utils/json/json_file.py rename to automation_file/utils/json/json_file.py index abb4727..ebf3b86 100644 --- a/file_automation/utils/json/json_file.py +++ b/automation_file/utils/json/json_file.py @@ -2,9 +2,9 @@ from pathlib import Path from threading import Lock -from file_automation.utils.exception.exception_tags import cant_find_json_error, cant_save_json_error -from file_automation.utils.exception.exceptions import JsonActionException -from file_automation.utils.logging.loggin_instance import file_automation_logger +from automation_file.utils.exception.exception_tags import cant_find_json_error, cant_save_json_error +from automation_file.utils.exception.exceptions import JsonActionException +from automation_file.utils.logging.loggin_instance import file_automation_logger _lock = Lock() diff --git a/file_automation/utils/logging/__init__.py b/automation_file/utils/logging/__init__.py similarity index 100% rename from file_automation/utils/logging/__init__.py rename to automation_file/utils/logging/__init__.py diff --git a/file_automation/utils/logging/loggin_instance.py b/automation_file/utils/logging/loggin_instance.py similarity index 100% rename from file_automation/utils/logging/loggin_instance.py rename to automation_file/utils/logging/loggin_instance.py diff --git a/file_automation/utils/package_manager/__init__.py b/automation_file/utils/package_manager/__init__.py similarity index 100% rename from file_automation/utils/package_manager/__init__.py rename to automation_file/utils/package_manager/__init__.py diff --git a/file_automation/utils/package_manager/package_manager_class.py b/automation_file/utils/package_manager/package_manager_class.py similarity index 98% rename from file_automation/utils/package_manager/package_manager_class.py rename to automation_file/utils/package_manager/package_manager_class.py index 859edf1..2e4eb0c 100644 --- a/file_automation/utils/package_manager/package_manager_class.py +++ b/automation_file/utils/package_manager/package_manager_class.py @@ -3,7 +3,7 @@ from inspect import getmembers, isfunction, isbuiltin, isclass from sys import stderr -from file_automation.utils.logging.loggin_instance import file_automation_logger +from automation_file.utils.logging.loggin_instance import file_automation_logger class PackageManager(object): diff --git a/file_automation/utils/project/__init__.py b/automation_file/utils/project/__init__.py similarity index 100% rename from file_automation/utils/project/__init__.py rename to automation_file/utils/project/__init__.py diff --git a/file_automation/utils/project/create_project_structure.py b/automation_file/utils/project/create_project_structure.py similarity index 91% rename from file_automation/utils/project/create_project_structure.py rename to automation_file/utils/project/create_project_structure.py index 0a7f8ac..c2287ac 100644 --- a/file_automation/utils/project/create_project_structure.py +++ b/automation_file/utils/project/create_project_structure.py @@ -2,11 +2,11 @@ from pathlib import Path from threading import Lock -from file_automation.utils.json.json_file import write_action_json -from file_automation.utils.logging.loggin_instance import file_automation_logger -from file_automation.utils.project.template.template_executor import executor_template_1, \ +from automation_file.utils.json.json_file import write_action_json +from automation_file.utils.logging.loggin_instance import file_automation_logger +from automation_file.utils.project.template.template_executor import executor_template_1, \ executor_template_2, bad_executor_template_1 -from file_automation.utils.project.template.template_keyword import template_keyword_1, \ +from automation_file.utils.project.template.template_keyword import template_keyword_1, \ template_keyword_2, bad_template_1 diff --git a/file_automation/utils/project/template/__init__.py b/automation_file/utils/project/template/__init__.py similarity index 100% rename from file_automation/utils/project/template/__init__.py rename to automation_file/utils/project/template/__init__.py diff --git a/file_automation/utils/project/template/template_executor.py b/automation_file/utils/project/template/template_executor.py similarity index 100% rename from file_automation/utils/project/template/template_executor.py rename to automation_file/utils/project/template/template_executor.py diff --git a/file_automation/utils/project/template/template_keyword.py b/automation_file/utils/project/template/template_keyword.py similarity index 100% rename from file_automation/utils/project/template/template_keyword.py rename to automation_file/utils/project/template/template_keyword.py diff --git a/file_automation/utils/scheduler/__init__.py b/automation_file/utils/scheduler/__init__.py similarity index 100% rename from file_automation/utils/scheduler/__init__.py rename to automation_file/utils/scheduler/__init__.py diff --git a/file_automation/utils/scheduler/extend_apscheduler.py b/automation_file/utils/scheduler/extend_apscheduler.py similarity index 100% rename from file_automation/utils/scheduler/extend_apscheduler.py rename to automation_file/utils/scheduler/extend_apscheduler.py diff --git a/file_automation/utils/socket_server/__init__.py b/automation_file/utils/socket_server/__init__.py similarity index 100% rename from file_automation/utils/socket_server/__init__.py rename to automation_file/utils/socket_server/__init__.py diff --git a/file_automation/utils/socket_server/file_automation_socket_server.py b/automation_file/utils/socket_server/file_automation_socket_server.py similarity index 97% rename from file_automation/utils/socket_server/file_automation_socket_server.py rename to automation_file/utils/socket_server/file_automation_socket_server.py index 6af55ac..a9669ad 100644 --- a/file_automation/utils/socket_server/file_automation_socket_server.py +++ b/automation_file/utils/socket_server/file_automation_socket_server.py @@ -3,7 +3,7 @@ import sys import threading -from file_automation.utils.executor.action_executor import execute_action +from automation_file.utils.executor.action_executor import execute_action class TCPServerHandler(socketserver.BaseRequestHandler): diff --git a/dev.toml b/dev.toml index 68ea4ff..631b1a2 100644 --- a/dev.toml +++ b/dev.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "automation_file_dev" -version = "0.0.18" +version = "0.0.19" authors = [ { name = "JE-Chen", email = "zenmailman@gmail.com" }, ] diff --git a/pyproject.toml b/pyproject.toml index e0740d7..2159706 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "automation_file" -version = "0.0.16" +version = "0.0.17" authors = [ { name = "JE-Chen", email = "zenmailman@gmail.com" }, ] diff --git a/tests/unit_test/executor/executor_test.py b/tests/unit_test/executor/executor_test.py index 8b58463..d908f8b 100644 --- a/tests/unit_test/executor/executor_test.py +++ b/tests/unit_test/executor/executor_test.py @@ -1,4 +1,4 @@ -from file_automation import execute_action +from automation_file import execute_action test_list = [ ["FA_drive_later_init", {"token_path": "token.json", "credentials_path": "credentials.json"}], diff --git a/tests/unit_test/local/dir/dir_test.py b/tests/unit_test/local/dir/dir_test.py index 0c446e7..104195d 100644 --- a/tests/unit_test/local/dir/dir_test.py +++ b/tests/unit_test/local/dir/dir_test.py @@ -1,6 +1,6 @@ from pathlib import Path -from file_automation import copy_dir, remove_dir_tree, rename_dir, create_dir +from automation_file import copy_dir, remove_dir_tree, rename_dir, create_dir copy_dir_path = Path(str(Path.cwd()) + "/test_dir") rename_dir_path = Path(str(Path.cwd()) + "/rename_dir") diff --git a/tests/unit_test/local/file/test_file.py b/tests/unit_test/local/file/test_file.py index ab582af..73bf207 100644 --- a/tests/unit_test/local/file/test_file.py +++ b/tests/unit_test/local/file/test_file.py @@ -1,7 +1,7 @@ from pathlib import Path -from file_automation import copy_file, copy_specify_extension_file, copy_all_file_to_dir, rename_file, remove_file -from file_automation import create_dir +from automation_file import copy_file, copy_specify_extension_file, copy_all_file_to_dir, rename_file, remove_file +from automation_file import create_dir create_dir(str(Path.cwd()) + "/first_file_dir") create_dir(str(Path.cwd()) + "/second_file_dir") diff --git a/tests/unit_test/local/zip/zip_test.py b/tests/unit_test/local/zip/zip_test.py index e3c70d7..075b592 100644 --- a/tests/unit_test/local/zip/zip_test.py +++ b/tests/unit_test/local/zip/zip_test.py @@ -1,7 +1,7 @@ from pathlib import Path -from file_automation import create_dir -from file_automation import zip_dir, zip_file, read_zip_file, unzip_file, unzip_all, zip_info, zip_file_info, \ +from automation_file import create_dir +from automation_file import zip_dir, zip_file, read_zip_file, unzip_file, unzip_all, zip_info, zip_file_info, \ set_zip_password zip_file_path = Path(Path.cwd(), "test.zip") diff --git a/tests/unit_test/remote/google_drive/quick_test.py b/tests/unit_test/remote/google_drive/quick_test.py index e2aed78..aa2fb52 100644 --- a/tests/unit_test/remote/google_drive/quick_test.py +++ b/tests/unit_test/remote/google_drive/quick_test.py @@ -1,7 +1,7 @@ from pathlib import Path -from file_automation import driver_instance -from file_automation.remote.google_drive.search.search_drive import drive_search_all_file +from automation_file import driver_instance +from automation_file.remote.google_drive.search.search_drive import drive_search_all_file driver_instance.later_init(str(Path(Path.cwd(), "token.json")), str(Path(Path.cwd(), "credentials.json"))) print(drive_search_all_file())