Exemplo n.º 1
0
 def get_bill(self, bill_id, **kwargs):
     url = kwargs.pop('url')
     agenda_item = kwargs.pop('agenda_item')
     _type = self.get_type(bill_id)
     bill = Bill(bill_id, self.session, type=_type, **kwargs)
     bill.add_source(url, note='detail')
     return bill
Exemplo n.º 2
0
    def get_bills(self):
        for i, page in enumerate(self.searchLegislation()):
            for legislation_summary in self.parseSearchResults(page):
                title = legislation_summary['Title'].strip()
                if title == "":
                    continue

                bill = Bill(name=legislation_summary['Record #'],
                            session=self.session,
                            title=title,
                            type=[legislation_summary['Type'].lower()],
                            organization=self.jurisdiction.name)

                bill.add_source(legislation_summary['URL'])

                legislation_details = self.expandLegislationSummary(
                    legislation_summary)

                for related_bill in legislation_details.get(
                        'Related files', []):
                    bill.add_related_bill(name=related_bill,
                                          session=self.session,
                                          relation='other-session',
                                          chamber=None)

                for i, sponsor in enumerate(
                        legislation_details.get('Sponsors', [])):
                    if i == 0:
                        primary = True
                        sponsorship_type = "Primary"
                    else:
                        primary = False
                        sponsorship_type = "Regular"

                    bill.add_sponsor(sponsor, sponsorship_type, 'person',
                                     primary)

                for subject in legislation_details.get(u'Topics', []):
                    bill.add_subject(subject)

                for attachment in legislation_details.get(u'Attachments', []):
                    bill.add_version_link('PDF',
                                          attachment['url'],
                                          mimetype="application/pdf")

                yield bill
Exemplo n.º 3
0
    def get_bill(self, bill_id, **kwargs):
        url = 'http://www.denvergov.org/sirepub/item.aspx?itemid=%s' % bill_id
        self.urls.add(detail=url)

        bill_id = kwargs.pop('number')
        bill = Bill(bill_id,
                    self.session,
                    kwargs['title'],
                    'butt',
                    type=['bills'])
        bill.add_source(url, note='detail')

        xpath = '//table[contains(@class, "history")]/tr'
        for tr in self.urls.detail.xpath(xpath):
            import pdb
            pdb.set_trace()

        return bill