Skip to content

Commit

Permalink
all things in queue
Browse files Browse the repository at this point in the history
  • Loading branch information
alaingilbert committed Aug 18, 2016
1 parent df76139 commit 0a9faca
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions ogame/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,19 @@ def get_overview(self):
desc = ' '.join(desc.split())
tmp = {'name': short_name, 'code': code}
if idx == 2:
count = int(box.find('div', {'id': 'shipSumCount7'}).text.replace('.', '').strip())
tmp.update({'count': count})
quantity = int(box.find('div', {'id': 'shipSumCount7'}).text.replace('.', '').strip())
tmp.update({'quantity': quantity})
tmp = [tmp]
queue = box.find('table', {'class': 'queue'})
if queue:
tds = queue.findAll('td')
for td in tds:
link = td.find('a')
quantity = int(''.join(link.text.replace('.', '').strip().split()))
img = td.find('img')
alt = img['alt']
short_name = ''.join(alt.split())
code = self.get_code(short_name)
tmp.append({'name': short_name, 'code': code, 'quantity': quantity})
res[names[idx]] = tmp
return res

0 comments on commit 0a9faca

Please sign in to comment.