Ejemplo n.º 1
0
    def load_meeting_requests(self,
                              rmbs: Rmbs,
                              area: int,
                              meeting_date: date,
                              ratio=1.0):
        df = rmbs.read_meetings(area, meeting_date)
        if ratio < 1.0:
            df = df.head(
                n=int(len(df) * ratio)
            )  # Use just a portion of the loaded meetings; mainly for test purpose

        print(f"Records read: {len(df)}")
        for request in df.itertuples():
            name = request.name
            start = datetime.fromtimestamp(request.start_time)
            end = datetime.fromtimestamp(request.end_time)

            fixed = True  # fixed == True means the meeting can't be moved anymore

            size = min_size = 0  # No size will be specified for this meeting, and it's a fixed booking

            # Note: for meeting which has already been assigned to a room, we don't care about its required facilities
            meeting = Meeting(name=name,
                              meetings=self,
                              size=size,
                              min_size=min_size,
                              fixed=fixed,
                              room_name=request.room_name,
                              room_id=request.room_id,
                              start_time=start,
                              end_time=end,
                              mrbs_entry_id=request.id)

            meeting.id = request.id  # ID is the meeting ID in DB
            self._meetings.append(meeting)
def attendance():
    print("meeting started ..")
    try:
        meet = Meeting()
        # login.do_login(meet.driver,headless=False)abdfghinop
        login.do_login(meet.driver)
        meet.enter(config.meeting_url)
        meet.open_sidebar()
        meet.close()
        eel.render(whconfig["meeting_data"])()
        print(whconfig["meeting_data"][0])
    except:
        meet.close()
    def get_plenary_meetings(self, refresh=False):
        """This API returns an overview of all Plenary meetings in the session.
        A list of Meeting objects is returned.

        Args:
            refresh (bool, optional): Should we fully reparse the scraped document? Defaults to False.

        Returns:
            list(Meeting): List of all known plenary meetings.
        """

        if refresh or not self.plenary_meetings:
            URL = 'https://www.dekamer.be/kvvcr/showpage.cfm?section=/cricra&language=nl&cfm=dcricra.cfm?type=plen&cricra=cri&count=all&legislat=%02d' % (
                self.session)
            page = self.requests_session.get(URL)
            soup = BeautifulSoup(page.content, 'lxml')
            meetings = soup.find_all('tr')

            self.plenary_meetings = []

            for meeting in meetings:
                self.plenary_meetings.append(Meeting.from_soup(meeting, self))

        #self.plenary_meetings = self.plenary_meetings[:10]
        return self.plenary_meetings
Ejemplo n.º 4
0
    def __init__(self, soup, count):
        self._activity = extract(soup, 'u245_line' + str(count))
        # soup.find('//*[@id="u245_line' + str(count) + '"]').text
        self._instructor = extract(soup, 'u263_line' + str(count))
        # soup.find('//*[@id="u263_line' + str(count) + '"]').text
        self._class_size = extract(soup, 'u281_line' + str(count))
        # soup.find('//*[@id="u281_line' + str(count) + '"]').text
        self._current_enrolment = extract(soup, 'u290_line' + str(count))
        # soup.find('//*[@id="u290_line' + str(count) + '"]').text
        self._option_to_waitlist = 'yes' if soup.find(id='u308_line' +
                                                      str(count)) else 'no'
        self._delivery_mode = extract(soup, 'u314_line' + str(count))
        # soup.find('//*[@id="u314_line' + str(count) + '"]').text

        times = extract(soup, 'u254_line' + str(count))
        # soup.find('//*[@id="u254_line' + str(count) + '"]').text
        locations = extract(soup, 'u272_line' + str(count))
        # soup.find('//*[@id="u272_line' + str(count) + '"]').text
        if times != '':
            times = times.split('\n')
            days = [time.split(' ')[0] for time in times]
            times = [time.split(' ')[1] for time in times]
        else:
            days = []
            times = []
        if locations != '':
            locations = locations.split('\n')
        else:
            locations = []
        self._meetings = [
            Meeting(day, time, location)
            for day, time, location in zip(days, times, locations)
        ]
Ejemplo n.º 5
0
	def analyzeMeetingXML(self, elem, pref = ''):
		total = None
		returned = None
		if len(pref) < 10:
			for i in elem.findall('*'):
				if i.tag == "{http://www.webex.com/schemas/2002/06/service/meeting}meeting":
					self.meetings.append(Meeting(i, self))
				else:
					self.analyzeMeetingXML(i, pref = pref + " ")
Ejemplo n.º 6
0
 def add_meeting(self):
     dialog = MeetingEditDialog()
     if dialog.exec_():
         try:
             self.model.add_meeting(Meeting(*dialog.get_fields()))
             self.model.save()
             self.update_meeting_list()
         except ValueError as e:
             pass
Ejemplo n.º 7
0
 def part1():
     meeting = Meeting(host=host_id,
                       subject=subject_id,
                       datetime=datetime,
                       creation_date=creation_date,
                       link=link,
                       description=description)
     db.session.add(meeting)
     return meeting
Ejemplo n.º 8
0
def parse_data_into_meetings(data, year):
    soup = BeautifulSoup(data)
    meetings = soup.find_all(class_="listing-item")

    meetings_array = []
    for meeting in meetings:
        #if the month is two, just take the first
        month = meeting.find(class_='month').get_text()
        spans_multiple_months = False
        if len(month) > 3:
            month = month.split()[0]
            spans_multiple_months = True

        #if day is a range we have to split it, get the first date, and then set length
        day = 0
        #default length
        length = 1
        day_text = meeting.find(class_='day').get_text().encode('utf-8')
        if len(day_text) > 2:
            day_text_parts = day_text.split("-")
            day = int(day_text_parts[0])

            if (spans_multiple_months == False):
                length = int(day_text_parts[1]) - int(day_text_parts[0])
            else:
                month_number = Meeting.number_for_month_name(month)
                number_of_days_in_month = calendar.monthrange(
                    year, month_number)
                length = int(day_text_parts[1]) + (number_of_days_in_month[1] -
                                                   int(day_text_parts[0]))
        else:
            day = int(day_text)

        text = meeting.find(
            class_='views-field-field-activity-link').get_text()
        name = meeting.find("span", class_='field-content').get_text()
        meeting_object = Meeting(name, text, year, month, day, length)

        meetings_array.append(meeting_object)

    for meeting in meetings_array:
        print meeting.name + " : " + meeting.date_as_string(
        ) + " : " + meeting.text
    return meetings_array
Ejemplo n.º 9
0
    def accept(
        self
    ):  # needs return value QDialogCode == int, also doesn't seem to work
        try:
            Meeting(*self.get_fields())
        except ValueError as e:
            return 0

        self.done(1)  # close would return 0
        return 1
Ejemplo n.º 10
0
    def genRandomInput(self, num_meetings):
        self.num_meetings = num_meetings
        self._meetings = []

        for i in range(num_meetings):
            meeting = Meeting(name=i, meetings=self)

            meeting.size = random.randint(2, self.max_room_size)
            start_time = random.randint(0, self.max_timeslot)

            rn = random.randint(1, 100)
            if rn <= 50:
                duration = 1
            elif rn <= 90:
                duration = 2
            else:
                duration = 3

            meeting.set_time(start_time, duration, truncate=True)
            self._meetings.append(meeting)
Ejemplo n.º 11
0
 def meeting(self, name):
     "Get a mmeting"
     status, resp = self.ucengine.request('GET',
         '/meeting/all/%s?%s' % (name, urllib.urlencode({
             'uid': self.uid,
             'sid': self.sid
     })))
     if status == 404:
         return None
     assert status == 200
     m = resp['result']
     return Meeting(name,
         start = m['start_date'],
         end = m['end_date'],
         metadata = m['metadata'])
Ejemplo n.º 12
0
    def select_meeting_item(self):
        index = self.meeting_list.currentRow()
        if index < 0:
            return

        meeting = self.model.get_index(index)

        dialog = MeetingEditDialog(meeting)
        if dialog.exec_():
            try:
                new_meeting = Meeting(*dialog.get_fields())
                self.model.replace_index(index, new_meeting)
                self.model.save()
                self.update_meeting_list()
            except ValueError:
                pass
Ejemplo n.º 13
0
    def process_booking_requests(self, booking_requests):
        booking_requests.sort(key=lambda x: x.booking_request_date_time)
        meetings_list = []
        for request in booking_requests:
            meeting = Meeting(request)
            #checking if meeting within office hours
            if not (self.office_hours.is_within_office_hours(
                    meeting.meeting_start_time)
                    and self.office_hours.is_within_office_hours(
                        meeting.meeting_end_time)):
                continue
            key = request.meeting_start_date_time

            # checking if meeting time is free
            if key in self._meetings_map:
                continue
            self._meetings_map[key] = meeting
            meetings_list.append(meeting)
        return meetings_list
Ejemplo n.º 14
0
def main(argv):
    # Authenticate and construct service.
    service, flags = sample_tools.init(
        argv,
        'calendar',
        'v3',
        __doc__,
        __file__,
        scope='https://www.googleapis.com/auth/calendar.readonly')
    window = tkinter.Tk()
    window.wm_withdraw()
    try:
        utc = datetime.datetime.utcnow()
        calendar_id = '*****@*****.**'
        time_min = utc.strftime("%Y-%m-%dT%H:%M") + ':00Z'
        time_max = utc.strftime("%Y-%m-%dT%H") + ':59:59Z'
        meeting_list = list()
        while True:
            calendar_list = service.events().list(calendarId=calendar_id,
                                                  timeMin=time_min,
                                                  timeMax=time_max).execute()
            for calendar_list_entry in calendar_list['items']:
                if 'summary' in calendar_list_entry:
                    summary = clean_string(calendar_list_entry['summary'])
                else:
                    summary = ''
                if 'location' in calendar_list_entry:
                    location = clean_string(calendar_list_entry['location'])
                else:
                    location = ''
                meeting_list.append(
                    Meeting(calendar_list_entry['start'],
                            calendar_list_entry['end'], summary, location))
            page_token = calendar_list.get('nextPageToken')
            if not page_token:
                break
        mbox.showinfo('Próxima reunión:', print_Meetinges(meeting_list))
    except client.AccessTokenRefreshError:
        print('The credentials have been revoked or expired, please re-run'
              'the application to re-authorize.')
Ejemplo n.º 15
0
def parse_data_into_meetings(data, year):
  soup = BeautifulSoup(data)
  meetings = soup.find_all(class_="listing-item")

  meetings_array = []
  for meeting in meetings:
    #if the month is two, just take the first
    month = meeting.find(class_='month').get_text()
    spans_multiple_months = False
    if len(month) > 3:
      month = month.split()[0]
      spans_multiple_months = True

    #if day is a range we have to split it, get the first date, and then set length
    day = 0
    #default length
    length = 1
    day_text = meeting.find(class_='day').get_text().encode('utf-8')
    if len(day_text) > 2:
      day_text_parts = day_text.split("-")
      day = int(day_text_parts[0])

      if(spans_multiple_months == False):
        length = int(day_text_parts[1]) - int(day_text_parts[0])
      else:
        month_number = Meeting.number_for_month_name(month)
        number_of_days_in_month = calendar.monthrange(year, month_number)
        length = int(day_text_parts[1]) + (number_of_days_in_month[1] - int(day_text_parts[0]))
    else: 
      day = int(day_text)
            
    text = meeting.find(class_='views-field-field-activity-link').get_text()
    name = meeting.find("span", class_='field-content').get_text()
    meeting_object = Meeting(name, text, year, month, day, length)

    meetings_array.append(meeting_object)

  for meeting in meetings_array:
    print meeting.name + " : " + meeting.date_as_string() + " : " + meeting.text
  return meetings_array
Ejemplo n.º 16
0
 def setup(self):
     type = Meeting(typename='Anniversary')
Ejemplo n.º 17
0
from typing import List, Set
from team import Team
from meeting import Meeting

# Dummy meetings
meeting1 = Meeting("1", ["B", "C"], 1, ["2"])
meeting2 = Meeting("2", ["A", "B", "C"], 3, ["4"])
meeting3 = Meeting("3", ["B", "C"], 2, ["2", "1"])
meeting4 = Meeting("4", ["A"], 2, [])
meetings = [meeting1, meeting2, meeting3, meeting4]

# Dummy teams
team1 = Team("A")
team2 = Team("B")
team3 = Team("C")
teams = [team1, team2, team3]

# Map names to meeting/team objects for convenience
team_map = dict([(t._name, t) for t in teams])
meeting_map = dict([(m._name, m) for m in meetings])


def prioritize_meetings_via_counts(meetings: Set[Meeting]) -> dict:
    """
    Creating an map of highest priorty meetings based on how 
    many times each meeting occurs in the dependencies of other meetings.

    Then, create meeting ranks based of the largest depth depedencies of 
    the highest dependency meetings.
    """
    counts = dict([(m._name, 0) for m in meetings])
Ejemplo n.º 18
0
 def __init__(self, attendees_selector, *args, **kwargs):
     Meeting.__init__(self, attendees_selector, *args, **kwargs)