Commit 98db12f4 authored by liyang's avatar liyang

fix:解决不同操作系统路径分隔符不一致问题

parent 5e50e670
This diff is collapsed.
...@@ -157,16 +157,16 @@ def reptile(browser=None, search_word=""): ...@@ -157,16 +157,16 @@ def reptile(browser=None, search_word=""):
log.debug("-----------------------------") log.debug("-----------------------------")
# write_to_database(data) # write_to_database(data)
if state_save: if state_save:
log.debug('文件保存成功') log.debug('save file success')
# path = os.path.abspath(file_dir).join(file_dir).join(".json") # path = os.path.abspath(file_dir).join(file_dir).join(".json")
log.debug('文件绝对路径:' + file_dir) log.debug('file_path:' + file_dir)
form_data = { form_data = {
"path": file_dir, "path": file_dir,
"tableName": table_name "tableName": table_name
} }
response = importJsonPath(form_data) response = importJsonPath(form_data)
else: else:
log.debug('文件保存失败') log.debug('save file failed')
# 关闭浏览器驱动 # 关闭浏览器驱动
# time.sleep(3) # time.sleep(3)
browser.quit() browser.quit()
...@@ -188,7 +188,7 @@ def main(): ...@@ -188,7 +188,7 @@ def main():
response = getReptileTask() response = getReptileTask()
if response['status_code'] == 200 and response['data']['code'] == 200: if response['status_code'] == 200 and response['data']['code'] == 200:
log.debug("调用成功") log.debug("call success")
search_word = "" search_word = ""
for item in response['data']['rows']: for item in response['data']['rows']:
if item['name'] == 'ptt': if item['name'] == 'ptt':
...@@ -197,7 +197,7 @@ def main(): ...@@ -197,7 +197,7 @@ def main():
# print(convert_to_traditional(search_word)) # print(convert_to_traditional(search_word))
reptile(None, convert_to_traditional(search_word)) reptile(None, convert_to_traditional(search_word))
else: else:
log.debug("调用失败") log.debug("call failed")
# upload_control() # upload_control()
......
...@@ -13,7 +13,7 @@ class MyLogger(Logger): ...@@ -13,7 +13,7 @@ class MyLogger(Logger):
# 获取日志文件路径 # 获取日志文件路径
all_log_path_file = os.path.join(os.path.abspath(get_log_path()), "app.log") all_log_path_file = os.path.join(os.path.abspath(get_log_path()), "app.log")
error_log_path_file = os.path.join(os.path.abspath(get_log_path()), "error.log") error_log_path_file = os.path.join(os.path.abspath(get_log_path()), "error.log")
# print(all_log_path_file+'-----') print(f'log file path:{all_log_path_file}')
# 设置日志的名字、日志的收集级别 # 设置日志的名字、日志的收集级别
super().__init__("test_api", logging.DEBUG) super().__init__("test_api", logging.DEBUG)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment