本文整理汇总了Python中utils.CanadianLegislator.add_extra方法的典型用法代码示例。如果您正苦于以下问题:Python CanadianLegislator.add_extra方法的具体用法?Python CanadianLegislator.add_extra怎么用?Python CanadianLegislator.add_extra使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils.CanadianLegislator
的用法示例。
在下文中一共展示了CanadianLegislator.add_extra方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_people
# 需要导入模块: from utils import CanadianLegislator [as 别名]
# 或者: from utils.CanadianLegislator import add_extra [as 别名]
def get_people(self):
yield chair_info(CHAIR_URL)
for row in csv_reader(COUNCIL_PAGE, header=True, headers={'Cookie': 'incap_ses_168_68279=7jCHCh608QQSFVti3dtUAviu/1IAAAAAIRf6OsZL0NttnlzANkVb6w=='}):
p = Legislator(
name='%(FirstName0)s %(LastName0)s' % row,
post_id='%(MUNIC)s Ward %(WARDNUM)s' % row,
role='Councillor',
)
p.add_contact('email', row['email0'], None)
p.add_contact('voice', row['Phone0'], 'legislature')
p.add_extra('boundary_url', '/boundaries/%s-wards/ward-%s/' % (row['MUNIC'].lower(), row['WARDNUM']))
p.add_source(COUNCIL_PAGE)
yield p
if row['FirstName1'].strip():
p = Legislator(
name='%s %s' % (row['FirstName1'], row['LastName1']),
post_id='%(MUNIC)s Ward %(WARDNUM)s' % row,
role='Councillor',
)
p.add_contact('email', row['email1'], None)
p.add_contact('voice', row['Phone1'], 'legislature')
p.add_extra('boundary_url', '/boundaries/%s-wards/ward-%s/' % (row['MUNIC'].lower(), row['WARDNUM']))
p.add_source(COUNCIL_PAGE)
yield p