Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
py12306
Project
Project
Details
Activity
Releases
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
python
py12306
Commits
25b6bd53
Commit
25b6bd53
authored
Jan 16, 2019
by
Jalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复 log 文件不会自动创建
parent
d4339e2e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
1 deletion
+6
-1
app.py
py12306/app.py
+1
-0
func.py
py12306/helpers/func.py
+4
-0
common_log.py
py12306/log/common_log.py
+1
-1
No files found.
py12306/app.py
View file @
25b6bd53
...
...
@@ -97,6 +97,7 @@ class App:
def
check_data_dir_exists
():
os
.
makedirs
(
Config
()
.
QUERY_DATA_DIR
,
exist_ok
=
True
)
os
.
makedirs
(
Config
()
.
USER_DATA_DIR
,
exist_ok
=
True
)
touch_file
(
Config
()
.
OUT_PUT_LOG_TO_FILE_PATH
)
@
classmethod
def
test_send_notifications
(
cls
):
...
...
py12306/helpers/func.py
View file @
25b6bd53
...
...
@@ -105,6 +105,10 @@ def get_file_total_line_num(file, encoding='utf-8'):
return
len
(
f
.
readlines
())
def
touch_file
(
path
):
with
open
(
path
,
'a'
):
pass
def
pick_file_lines
(
file
,
lines
):
return
[
x
for
i
,
x
in
enumerate
(
file
)
if
i
in
lines
]
...
...
py12306/log/common_log.py
View file @
25b6bd53
...
...
@@ -43,7 +43,7 @@ class CommonLog(BaseLog):
MESSAGE_SEND_PUSH_BEAR_SUCCESS
=
'发送成功,请检查微信'
MESSAGE_SEND_PUSH_BEAR_FAIL
=
'PushBear发送失败,请检查KEY'
MESSAGE_OUTPUT_TO_FILE_IS_UN_ENABLE
=
'请先打开配置
:输出到文件
'
MESSAGE_OUTPUT_TO_FILE_IS_UN_ENABLE
=
'请先打开配置
项中的:OUT_PUT_LOG_TO_FILE_ENABLED ( 输出到文件 )
'
MESSAGE_GET_RESPONSE_FROM_FREE_AUTO_CODE
=
'从免费打码获取结果失败'
...
...
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