Browse files

fix some junk from refactoring

  • Loading branch information...
1 parent 96240b1 commit 51933dfe38869abc76cdb0c6aab62741b8ba9c77 @JoeGermuska committed Nov 2, 2011
Showing with 8 additions and 4 deletions.
  1. +8 −4 openstates/il/bills.py
View
12 openstates/il/bills.py
@@ -62,13 +62,17 @@ def _categorize_action(action):
def build_url_for_legislation_list(metadata, chamber, session, doc_type):
base_params = metadata['session_details'][session].get('params',{})
- chamber_slug = 'H' if chamber == 'lower' else 'S'
base_params['num1'] = '1'
base_params['num2'] = '10000'
params = dict(base_params)
- params['DocTypeID'] = '%s%s' % (chamber_slug,doc_type)
+ params['DocTypeID'] = '%s%s' % (chamber_slug(chamber),doc_type)
return '?'.join([LEGISLATION_URL,urlencode(params)])
+def chamber_slug(chamber):
+ if chamber == 'lower':
+ return 'H'
+ return 'S'
+
class ILBillScraper(BillScraper):
state = 'il'
@@ -83,8 +87,8 @@ def get_bill_urls(self, chamber, session, doc_type):
def scrape(self, chamber, session):
for doc_type in DOC_TYPES:
- for bill_url in get_bill_urls(self.metadata, chamber, session, doc_type):
- self.scrape_bill(chamber, session, chamber_slug+doc_type, bill_url)
+ for bill_url in self.get_bill_urls(chamber, session, doc_type):
+ self.scrape_bill(chamber, session, chamber_slug(chamber)+doc_type, bill_url)
def scrape_bill(self, chamber, session, doc_type, url):
html = self.urlopen(url)

0 comments on commit 51933df

Please sign in to comment.