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
98db12f4
Commit
98db12f4
authored
Jul 10, 2023
by
liyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:解决不同操作系统路径分隔符不一致问题
parent
5e50e670
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
114 additions
and
6 deletions
+114
-6
app.log
app.log
+108
-0
pc_ptt.py
pc_ptt.py
+5
-5
Logger.py
utils/Logger.py
+1
-1
No files found.
app.log
View file @
98db12f4
This diff is collapsed.
Click to expand it.
pc_ptt.py
View file @
98db12f4
...
...
@@ -157,16 +157,16 @@ def reptile(browser=None, search_word=""):
log
.
debug
(
"-----------------------------"
)
# write_to_database(data)
if
state_save
:
log
.
debug
(
'
文件保存成功
'
)
log
.
debug
(
'
save file success
'
)
# path = os.path.abspath(file_dir).join(file_dir).join(".json")
log
.
debug
(
'
文件绝对路径
:'
+
file_dir
)
log
.
debug
(
'
file_path
:'
+
file_dir
)
form_data
=
{
"path"
:
file_dir
,
"tableName"
:
table_name
}
response
=
importJsonPath
(
form_data
)
else
:
log
.
debug
(
'
文件保存失败
'
)
log
.
debug
(
'
save file failed
'
)
# 关闭浏览器驱动
# time.sleep(3)
browser
.
quit
()
...
...
@@ -188,7 +188,7 @@ def main():
response
=
getReptileTask
()
if
response
[
'status_code'
]
==
200
and
response
[
'data'
][
'code'
]
==
200
:
log
.
debug
(
"
调用成功
"
)
log
.
debug
(
"
call success
"
)
search_word
=
""
for
item
in
response
[
'data'
][
'rows'
]:
if
item
[
'name'
]
==
'ptt'
:
...
...
@@ -197,7 +197,7 @@ def main():
# print(convert_to_traditional(search_word))
reptile
(
None
,
convert_to_traditional
(
search_word
))
else
:
log
.
debug
(
"
调用失败
"
)
log
.
debug
(
"
call failed
"
)
# upload_control()
...
...
utils/Logger.py
View file @
98db12f4
...
...
@@ -13,7 +13,7 @@ class MyLogger(Logger):
# 获取日志文件路径
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"
)
# print(all_log_path_file+'-----
')
print
(
f
'log file path:{all_log_path_file}
'
)
# 设置日志的名字、日志的收集级别
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