wenxianping 2018-01-24 22:35:24 +08:00
parent 632a971606
commit 01d54be85a
5 changed files with 16 additions and 5 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
*.pyc
*.yaml
*.log
idea/

View File

@ -43,10 +43,19 @@ set:
station_dates:
# - "2018-01-27"
# - "2018-01-28"
- "2018-02-10"
- "2018-02-09"
- "2018-02-10"
# - "2018-02-09"
station_trains:
- "G4741"
- "G2365"
- "G1371"
- "G1337"
- "G1377"
- "G1329"
# - "G1302"
# - "G1372"
# - "G1326"
# - "K4300"
# - "K5226"
# - "K7772"

View File

@ -186,7 +186,7 @@ class select:
def submitOrderRequestFunc(self, from_station, to_station, station_date=None):
select_url = self.confUrl["select_url"]["req_url"].format(
station_date, from_station, to_station)
station_ticket = self.httpClint.send(select_url)
station_ticket = self.httpClint.send(select_url, is_logger=False)
return json.loads(station_ticket)
def submitOrderRequestImplement(self, from_station, to_station,):
@ -538,7 +538,7 @@ class select:
elif "messages" in queryOrderWaitTimeResult and queryOrderWaitTimeResult["messages"]:
print("排队等待失败: " + queryOrderWaitTimeResult["messages"])
else:
print("{}次排队中,请耐心等待".format(num))
print("{}次排队中,请耐心等待".format(num+1))
else:
print("排队中")
time.sleep(2)

View File

@ -88,8 +88,9 @@ class HTTPClient(object):
else:
method = "get"
self.resetHeaders()
logger.log(
u"url: {0}\n入参: {1}\n请求方式: {2}\n".format(url,data,method,))
if is_logger:
logger.log(
u"url: {0}\n入参: {1}\n请求方式: {2}\n".format(url,data,method,))
for i in range(10):
try:
response = self._s.request(method=method,

BIN
tkcode

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB