Fix history command
Site changed
This commit is contained in:
parent
950219435b
commit
16bab6f4cd
1 changed files with 2 additions and 3 deletions
|
|
@ -126,15 +126,14 @@ class HistoryPage(BasePage):
|
||||||
|
|
||||||
def on_loaded(self):
|
def on_loaded(self):
|
||||||
self.calls = []
|
self.calls = []
|
||||||
isdate = re.compile('[0-3][0-9]/[0-1][0-9]/2[0-9][0-9][0-9] [0-2][0-9]:[0-6][0-9]:[0-6][0-9]')
|
|
||||||
for tr in self.document.xpath('//tr'):
|
for tr in self.document.xpath('//tr'):
|
||||||
tds = tr.xpath('td')
|
tds = tr.xpath('td')
|
||||||
if tds[0].text == None or tds[0].text == "Date" or not isdate.match(tds[0].text):
|
if tds[0].text == None or tds[0].text == "Date":
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
detail = Detail()
|
detail = Detail()
|
||||||
mydate = date(*reversed([int(x) for x in tds[0].text.split(' ')[0].split("/")]))
|
mydate = date(*reversed([int(x) for x in tds[0].text.split(' ')[0].split("/")]))
|
||||||
mytime = time(*[int(x) for x in tds[0].text.split(' ')[1].split(":")])
|
mytime = time(*[int(x) for x in tds[0].text.split(' ')[2].split(":")])
|
||||||
detail.datetime = datetime.combine(mydate, mytime)
|
detail.datetime = datetime.combine(mydate, mytime)
|
||||||
detail.label = u' '.join([unicode(td.text.strip()) for td in tds[1:4] if td.text is not None])
|
detail.label = u' '.join([unicode(td.text.strip()) for td in tds[1:4] if td.text is not None])
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue