-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
120 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
temp/* | ||
dist | ||
build | ||
setup | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# gjjx-zhushou | ||
公交驾校预约助手 | ||
# 公交驾校预约助手 | ||
|
||
## 如何使用 | ||
1. 解压`公交驾校预约助手*.zip` | ||
2. 编辑`conf.ini` | ||
3. 双击`run.exe`运行程序 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[assistant] | ||
# 用户名 | ||
user_name = 用户名 | ||
# 密码 | ||
password = 密码 | ||
|
||
# 刷新间隔(秒) | ||
sleep = 2 | ||
|
||
# 预约时间 0:上午 1:下午 2:晚上 | ||
date_line = 2017-06-25,0|2017-06-25,1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env python | ||
# coding: utf-8 | ||
|
||
import ConfigParser | ||
import sys | ||
reload(sys) | ||
sys.setdefaultencoding('utf8') | ||
|
||
class ParseConf: | ||
def __init__(self): | ||
try: | ||
cf = ConfigParser.ConfigParser() | ||
cf.read('conf.ini') | ||
|
||
# 用户名 | ||
self.user_name = cf.get('assistant', 'user_name') | ||
# 密码 | ||
self.password = cf.get('assistant', 'password') | ||
|
||
# 刷新间隔(秒) | ||
self.sleep = int(cf.get('assistant', 'sleep')) | ||
|
||
# 预约时间 | ||
date_line = cf.get('assistant', 'date_line') | ||
self.date_line = map(lambda x: x.split(','), date_line.split('|')) | ||
|
||
except Exception, e: | ||
print '[ERROR] Parse conf.ini failed.' | ||
raise e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters