Beispiel #1
0
def getAllSenateCommitteeMeetingsAsEvents():
	meetings=[]
	coms=Committee.Query.all().eq(chamber='upper')
	if coms:
		for c in coms:
			url=c.com_url[0]['url']
			meet = getSenateCommitteeMeetingsByID(getCommitteeIDFromURL(url))
			links = meet.find_all('a')
			if links:
				for l in links:
					params = getSenateMeetingAsEvent(c.name,l,c.com_id)
					if params:
						key=c.name+l.text
						event = Event.get_by_key(key)
						if event.count()>0:
							for e in event:
								e.title=params['title']
								e.start=params['start']
								e.type=params['type']
								e.url=params['url']
								e.save()
						else:
							# params = getSenateMeetingAsEvent(c.name,l,c.com_id)
							params['key']=key
							event = Event(**params)
							event.save()
Beispiel #2
0
def getAllSenateCommitteeMeetingsAsEvents():
    meetings = []
    coms = Committee.Query.all().eq(chamber='upper')
    if coms:
        for c in coms:
            url = c.com_url[0]['url']
            meet = getSenateCommitteeMeetingsByID(getCommitteeIDFromURL(url))
            links = meet.find_all('a')
            if links:
                for l in links:
                    params = getSenateMeetingAsEvent(c.name, l, c.com_id)
                    if params:
                        key = c.name + l.text
                        event = Event.get_by_key(key)
                        if event.count() > 0:
                            for e in event:
                                e.title = params['title']
                                e.start = params['start']
                                e.type = params['type']
                                e.url = params['url']
                                e.save()
                        else:
                            # params = getSenateMeetingAsEvent(c.name,l,c.com_id)
                            params['key'] = key
                            event = Event(**params)
                            event.save()
Beispiel #3
0
def getAllHouseCommitteeMeetingsAsEvents():
    meetings = []
    count = 0
    title_count = -1
    room_count = -1
    chair_count = -1
    coms = Committee.Query.all().eq(chamber='lower')
    if coms:
        for c in coms:
            url = c.com_url[0]['url']
            meet = getHouseMeetingByID(c.com_id)
            if meet:
                for m in meet:
                    if m in day_of_week:
                        count = 0
                        date = ''
                        time = ''
                        # title_count=-1
                        # room_count=-1
                        # chair_count=-1
                        # room=''
                        # chair=''
                        event = {}
                    else:
                        count += 1

                    if count == 1:
                        date = m
                    elif count == 2:
                        time = m
                        params = getHouseMeetingAsEvent(
                            c.name, date + ' ' + time, c.com_id)
                        if params:
                            key = c.name + date + ' ' + time
                            event = Event.get_by_key(key)
                            if event.count() > 0:
                                for e in event:
                                    e.title = params['title']
                                    e.start = params['start']
                                    e.type = params['type']
                                    e.url = params['url']
                                    e.save()
                            else:
                                params['key'] = key
                                event = Event(**params)
                                # params = getHouseMeetingAsEvent(c.name,date+' '+time,c.com_id)
                                #params['key']=key
                                #event = Event(**params)
                                event.save()
Beispiel #4
0
def getAllHouseCommitteeMeetingsAsEvents():
	meetings=[]
	count=0
	title_count=-1
	room_count=-1
	chair_count=-1
	coms=Committee.Query.all().eq(chamber='lower')
	if coms:
		for c in coms:
			url=c.com_url[0]['url']
			meet = getHouseMeetingByID(c.com_id)
			if meet:
				for m in meet:
					if m in day_of_week:
						count=0
						date=''
			 			time=''
			 			# title_count=-1
			 			# room_count=-1
			 			# chair_count=-1
			 			# room=''
			 			# chair=''
			 			event={}
			 		else:
			 			count+=1

			 		if count==1:
			 			date=m
			 		elif count==2:
			 			time=m
			 			params = getHouseMeetingAsEvent(c.name,date+' '+time,c.com_id)
			 			if params:
				 			key=c.name+date+' '+time
							event = Event.get_by_key(key)
							if event.count()>0:
								for e in event:
									e.title=params['title']
									e.start=params['start']
									e.type=params['type']
									e.url=params['url']
									e.save()
							else:
								params['key']=key
								event = Event(**params)
							# params = getHouseMeetingAsEvent(c.name,date+' '+time,c.com_id)
							#params['key']=key
							#event = Event(**params)
								event.save()