Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
network-assets-reptile
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyang
network-assets-reptile
Commits
6fafbb9b
Commit
6fafbb9b
authored
Jul 10, 2023
by
liyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:解决不同操作系统路径分隔符不一致问题
parent
69b07be3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
pc_ptt.py
pc_ptt.py
+3
-3
Logger.py
utils/Logger.py
+3
-3
No files found.
pc_ptt.py
View file @
6fafbb9b
...
@@ -151,15 +151,15 @@ def reptile(browser=None, search_word=""):
...
@@ -151,15 +151,15 @@ def reptile(browser=None, search_word=""):
# upload_control()
# upload_control()
# 保存json文件到本地
# 保存json文件到本地
log
.
debug
(
os
.
path
.
abspath
(
"./"
))
log
.
debug
(
os
.
path
.
abspath
(
"./"
))
file_dir
=
f
'{os.path.
abspath("./")}/reptile_data/ptt/{int(time.time())}.json
'
file_dir
=
f
'{os.path.
join(os.path.abspath("./"),"reptile_data","ptt",str(int(time.time())),".json")}
'
# file_dir = f'./reptile_data/ptt/{int(time.time())}.json'
# file_dir = f'./reptile_data/ptt/{int(time.time())}.json'
state_save
=
save_json
(
file_dir
,
data
)
state_save
=
save_json
(
file_dir
,
data
)
log
.
debug
(
"-----------------------------"
)
log
.
debug
(
"-----------------------------"
)
# write_to_database(data)
# write_to_database(data)
if
state_save
:
if
state_save
:
log
.
debug
(
'文件保存成功'
)
log
.
debug
(
'文件保存成功'
)
path
=
os
.
path
.
abspath
(
file_dir
)
.
join
(
file_dir
)
.
join
(
".json"
)
#
path = os.path.abspath(file_dir).join(file_dir).join(".json")
log
.
debug
(
'文件绝对路径:'
+
path
)
log
.
debug
(
'文件绝对路径:'
+
file_dir
)
form_data
=
{
form_data
=
{
"path"
:
path
,
"path"
:
path
,
"tableName"
:
table_name
"tableName"
:
table_name
...
...
utils/Logger.py
View file @
6fafbb9b
...
@@ -10,9 +10,9 @@ class MyLogger(Logger):
...
@@ -10,9 +10,9 @@ class MyLogger(Logger):
# log_name = '{}.log'.format(time.strftime("%Y_%m_%d_%H_%M_%S", time.localtime()))
# log_name = '{}.log'.format(time.strftime("%Y_%m_%d_%H_%M_%S", time.localtime()))
# log_path_file = os.path.join(get_log_path(), log_name)
# log_path_file = os.path.join(get_log_path(), log_name)
# 获取日志文件路径
# 获取日志文件路径
all_log_path_file
=
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
.
abspath
(
get_log_path
()
+
"error.log"
)
error_log_path_file
=
os
.
path
.
join
(
os
.
path
.
abspath
(
get_log_path
()),
"error.log"
)
log
.
debug
(
all_log_path_file
)
# 设置日志的名字、日志的收集级别
# 设置日志的名字、日志的收集级别
super
()
.
__init__
(
"test_api"
,
logging
.
DEBUG
)
super
()
.
__init__
(
"test_api"
,
logging
.
DEBUG
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment