Mercurial > eagle-eye
changeset 178:bff16e6ee3ef
Extract status of reearching for Academy.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Sun, 02 Nov 2008 16:33:01 +0800 |
parents | 6adad3bcca78 |
children | c5e4ef45eaa7 857a67be1609 270e608bb0b6 bf4ddf5bffb9 |
files | pyikriam/buildings.py |
diffstat | 1 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/pyikriam/buildings.py Sun Nov 02 15:14:51 2008 +0800 +++ b/pyikriam/buildings.py Sun Nov 02 16:33:01 2008 +0800 @@ -103,6 +103,23 @@ def __init__(self, city_id, idx, baseurl): super(academy, self).__init__('academy', city_id, idx, baseurl) pass + + def _sync(self, page_dom): + xpath_research_name = '/descendant::*[@class=\'researchName\']/a' + anodes = page_dom.xpath(xpath_research_name) + if len(anodes) == 1: + anode = anodes[0] + self.researching = anode.get('title') + xpath_countdown = '/descendant::div[@id=\'researchCountDown\']/text()' + txtnodes = page_dom.xpath(xpath_countdown) + self.researching_countdown = txtnodes[0] + else: + self.researching = None + self.researching_countdown = None + pass + + super(academy, self)._sync(page_dom) + pass pass class warehouse(building):