Skip to content

Commit ecbbdeb

Browse files
authored
Merge pull request #37 from Integration-Automation/dev
Update dev and stable version
2 parents 2e83540 + 4ffa8ee commit ecbbdeb

File tree

7 files changed

+14
-18
lines changed

7 files changed

+14
-18
lines changed

.idea/misc.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

automation_file/remote/google_drive/download/download_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from automation_file.utils.logging.loggin_instance import file_automation_logger
1010

1111

12-
def drive_download_file(file_id: str, file_name: str) -> BytesIO:
12+
def drive_download_file(file_id: str, file_name: str) -> Union[BytesIO, None]:
1313
"""
1414
:param file_id: file have this id will download
1515
:param file_name: file save on local name

automation_file/remote/google_drive/driver_instance.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ def later_init(self, token_path: str, credentials_path: str):
3030
# created automatically when the authorization flow completes for the first
3131
# time.
3232
if token_path.exists():
33-
file_automation_logger.info(
34-
f"Token exists try to load."
35-
)
33+
file_automation_logger.info("Token exists try to load.")
3634
creds = Credentials.from_authorized_user_file(str(token_path), self.scopes)
3735
# If there are no (valid) credentials available, let the user log in.
3836
if not creds or not creds.valid:
@@ -47,9 +45,7 @@ def later_init(self, token_path: str, credentials_path: str):
4745
token.write(creds.to_json())
4846
try:
4947
self.service = build('drive', 'v3', credentials=creds)
50-
file_automation_logger.info(
51-
f"Loading service successfully."
52-
)
48+
file_automation_logger.info("Loading service successfully.")
5349
except HttpError as error:
5450
file_automation_logger.error(
5551
f"Delete file failed,"
@@ -58,4 +54,3 @@ def later_init(self, token_path: str, credentials_path: str):
5854

5955

6056
driver_instance = GoogleDrive()
61-

automation_file/utils/executor/action_executor.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,12 @@ def execute_action(self, action_list: [list, dict]) -> dict:
105105
for loop the list and execute action
106106
"""
107107
if isinstance(action_list, dict):
108-
action_list: list = action_list.get("auto_control", None)
108+
action_list: list = action_list.get("auto_control")
109109
if action_list is None:
110110
raise ExecuteActionException(executor_list_error)
111111
execute_record_dict = dict()
112112
try:
113-
if len(action_list) > 0 or isinstance(action_list, list):
114-
pass
115-
else:
113+
if len(action_list) == 0 or isinstance(action_list, list) is False:
116114
raise ExecuteActionException(action_is_null_error)
117115
except Exception as error:
118116
file_automation_logger.error(

automation_file/utils/scheduler/extend_apscheduler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def add_blocking_job(
5858
"""
5959
params = locals()
6060
params.pop("self")
61-
trigger_args = params.pop("trigger_args")
61+
params.pop("trigger_args")
6262
return self._blocking_schedulers.add_job(**params, **trigger_args)
6363

6464
def add_nonblocking_job(
@@ -92,7 +92,7 @@ def add_nonblocking_job(
9292
"""
9393
params = locals()
9494
params.pop("self")
95-
trigger_args = params.pop("trigger_args")
95+
params.pop("trigger_args")
9696
return self._background_schedulers.add_job(**params, **trigger_args)
9797

9898
def get_blocking_scheduler(self) -> BlockingScheduler:

stable.toml renamed to dev.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.20"
8+
name = "automation_file_dev"
9+
version = "0.0.23"
1010
authors = [
1111
{ name = "JE-Chen", email = "[email protected]" },
1212
]

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_dev"
9-
version = "0.0.22"
8+
name = "automation_file"
9+
version = "0.0.21"
1010
authors = [
1111
{ name = "JE-Chen", email = "[email protected]" },
1212
]

0 commit comments

Comments
 (0)