annotate pyikriam/buildings.py @ 180:c5e4ef45eaa7

merged
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Sun, 02 Nov 2008 21:16:10 +0800
parents bff16e6ee3ef
children bf4ddf5bffb9
rev   line source
168
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
1 from lazy.www import c
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
2 from lxml import etree
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
3 from StringIO import StringIO
177
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
4 from sync_utils import *
168
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
5
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
6 class position(object):
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
7 def __init__(self, build_type, city_id, idx, baseurl):
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
8 self._baseurl = baseurl + '/index.php'
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
9 self.build_type = build_type
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
10 self.city_id = city_id
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
11 self.idx = idx
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
12 self._params = {'view': 'buildingGround',
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
13 'id': city_id,
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
14 'position': idx}
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
15 pass
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
16
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
17 def get_page(self):
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
18 page = c(self._baseurl).get(self._params).get_content()
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
19 return page
177
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
20
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
21 def sync(self):
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
22 page = self.get_page()
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
23 parser = etree.HTMLParser(encoding='utf8')
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
24 page_dom = etree.parse(StringIO(page), parser)
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
25
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
26 self._sync(page_dom)
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
27 pass
168
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
28 pass
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
29
177
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
30 class building(position):
176
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
31 class_patterns = {
177
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
32 'level': 'buildingLevel'
176
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
33 }
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
34 appear_patterns = {
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
35 'is_upgrading': 'isUpgrading'
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
36 }
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
37
177
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
38 def _sync(self, page_dom):
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
39 sync_tagclass(self, building.class_patterns, page_dom)
176
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
40
177
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
41 sync_tagclass_start_appear(self, building.appear_patterns, page_dom)
176
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
42
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
43 xpath_upgrade = '/descendant::ul[@class=\'actions\']/li[@class=\'upgrade\']/a'
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
44 anodes = page_dom.xpath(xpath_upgrade)
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
45 if len(anodes) == 1:
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
46 anode = anodes[0]
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
47 self.upgrade_uri = anode.get('href')
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
48 else:
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
49 self.upgrade_uri = None
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
50 pass
168
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
51
177
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
52 if self.is_upgrading:
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
53 xpath_countdown = '/descendant::div[@id=\'upgradeCountDown\']/text()'
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
54 value = page_dom.xpath(xpath_countdown)[0]
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
55 self.upgrade_countdown = value
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
56 else:
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
57 self.upgrade_countdown = None
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
58 pass
168
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
59 pass
176
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
60
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
61 def upgrade(self):
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
62 url = self._baseurl + self.upgrade_uri
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
63 page = c(url).get().get_content()
3ba3edda6d1e Extract more information for building townhall.
Thinker K.F. Li <thinker@branda.to>
parents: 175
diff changeset
64 pass
168
8f699a9da6c0 Extract building level of townhalls.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
65 pass
177
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
66
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
67 class townhall(building):
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
68 class_patterns = {
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
69 'occupied': 'value occupied',
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
70 'rooms': 'value total',
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
71 }
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
72 value_patterns = {
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
73 'growth': 'growth',
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
74 'happiness': 'happiness',
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
75 'interest_base': 'base',
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
76 'interest_research': 'research1',
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
77 'interest_capital': 'capital',
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
78 'overpopulation': 'cat overpopulation'
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
79 }
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
80 count_patterns = {
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
81 'pop_citizens': 'citizens',
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
82 'pop_woodworkers': 'woodworkers',
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
83 'pop_specialworkers': 'specialworkers',
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
84 'pop_scientists': 'scientists'
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
85 }
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
86
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
87 def __init__(self, city_id, idx, baseurl):
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
88 super(townhall, self).__init__('townhall', city_id, idx, baseurl)
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
89 pass
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
90
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
91 def _sync(self, page_dom):
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
92 sync_tagclass(self, townhall.class_patterns, page_dom)
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
93
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
94 sync_tagvalue(self, townhall.value_patterns, page_dom)
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
95
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
96 sync_tagcount(self, townhall.count_patterns, page_dom)
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
97
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
98 super(townhall, self)._sync(page_dom)
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
99 pass
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
100 pass
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
101
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
102 class academy(building):
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
103 def __init__(self, city_id, idx, baseurl):
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
104 super(academy, self).__init__('academy', city_id, idx, baseurl)
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
105 pass
178
bff16e6ee3ef Extract status of reearching for Academy.
Thinker K.F. Li <thinker@branda.to>
parents: 177
diff changeset
106
bff16e6ee3ef Extract status of reearching for Academy.
Thinker K.F. Li <thinker@branda.to>
parents: 177
diff changeset
107 def _sync(self, page_dom):
bff16e6ee3ef Extract status of reearching for Academy.
Thinker K.F. Li <thinker@branda.to>
parents: 177
diff changeset
108 xpath_research_name = '/descendant::*[@class=\'researchName\']/a'
bff16e6ee3ef Extract status of reearching for Academy.
Thinker K.F. Li <thinker@branda.to>
parents: 177
diff changeset
109 anodes = page_dom.xpath(xpath_research_name)
bff16e6ee3ef Extract status of reearching for Academy.
Thinker K.F. Li <thinker@branda.to>
parents: 177
diff changeset
110 if len(anodes) == 1:
bff16e6ee3ef Extract status of reearching for Academy.
Thinker K.F. Li <thinker@branda.to>
parents: 177
diff changeset
111 anode = anodes[0]
bff16e6ee3ef Extract status of reearching for Academy.
Thinker K.F. Li <thinker@branda.to>
parents: 177
diff changeset
112 self.researching = anode.get('title')
bff16e6ee3ef Extract status of reearching for Academy.
Thinker K.F. Li <thinker@branda.to>
parents: 177
diff changeset
113 xpath_countdown = '/descendant::div[@id=\'researchCountDown\']/text()'
bff16e6ee3ef Extract status of reearching for Academy.
Thinker K.F. Li <thinker@branda.to>
parents: 177
diff changeset
114 txtnodes = page_dom.xpath(xpath_countdown)
bff16e6ee3ef Extract status of reearching for Academy.
Thinker K.F. Li <thinker@branda.to>
parents: 177
diff changeset
115 self.researching_countdown = txtnodes[0]
bff16e6ee3ef Extract status of reearching for Academy.
Thinker K.F. Li <thinker@branda.to>
parents: 177
diff changeset
116 else:
bff16e6ee3ef Extract status of reearching for Academy.
Thinker K.F. Li <thinker@branda.to>
parents: 177
diff changeset
117 self.researching = None
bff16e6ee3ef Extract status of reearching for Academy.
Thinker K.F. Li <thinker@branda.to>
parents: 177
diff changeset
118 self.researching_countdown = None
bff16e6ee3ef Extract status of reearching for Academy.
Thinker K.F. Li <thinker@branda.to>
parents: 177
diff changeset
119 pass
bff16e6ee3ef Extract status of reearching for Academy.
Thinker K.F. Li <thinker@branda.to>
parents: 177
diff changeset
120
bff16e6ee3ef Extract status of reearching for Academy.
Thinker K.F. Li <thinker@branda.to>
parents: 177
diff changeset
121 super(academy, self)._sync(page_dom)
bff16e6ee3ef Extract status of reearching for Academy.
Thinker K.F. Li <thinker@branda.to>
parents: 177
diff changeset
122 pass
177
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
123 pass
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
124
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
125 class warehouse(building):
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
126 def __init__(self, city_id, idx, baseurl):
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
127 super(warehouse, self).__init__('warehouse', city_id, idx, baseurl)
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
128 pass
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
129 pass
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
130
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
131 class barracks(building):
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
132 def __init__(self, city_id, idx, baseurl):
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
133 super(barracks, self).__init__('barracks', city_id, idx, baseurl)
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
134 pass
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
135 pass
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
136
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
137 class branchoffice(building):
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
138 def __init__(self, city_id, idx, baseurl):
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
139 super(branchoffice, self).__init__('branchoffice', city_id, idx, baseurl)
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
140 pass
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
141 pass
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
142
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
143 class port(building):
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
144 def __init__(self, city_id, idx, baseurl):
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
145 super(port, self).__init__('port', city_id, idx, baseurl)
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
146 pass
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
147 pass
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
148
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
149 class wall(building):
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
150 def __init__(self, city_id, idx, baseurl):
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
151 super(wall, self).__init__('wall', city_id, idx, baseurl)
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
152 pass
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
153 pass
6adad3bcca78 Refactory to functions for sychronizing object attributes with pages.
Thinker K.F. Li <thinker@branda.to>
parents: 176
diff changeset
154