Example #1
0
    def __init__(self, account, **kwargs):
        super(Event, self).__init__()
        self.account = account
        self.title = nstrip(mpop(kwargs, 'title', 'sessionName', 'confName'))
        self._starts_at = mpop(kwargs, 'starts_at', '_starts_at')
        self._ends_at = mpop(kwargs, 'ends_at', '_ends_at')
        self._started_at = mpop(kwargs, 'started_at', '_started_at')
        self._ended_at = mpop(kwargs, 'ended_at', '_ended_at')

        if kwargs.get('timeZoneID'):  # this comes from normal listing
            tz = timezone.WEBEX_TIMEZONE_ID_TO_PYTZ_LABEL_MAP[int(
                kwargs['timeZoneID'])]
            if self._starts_at is None and kwargs.get('startDate'):
                self._starts_at = time(kwargs['startDate'], tz)
            if self._ends_at is None and kwargs.get('endDate'):
                self._ends_at = time(kwargs['endDate'], tz)

        if kwargs.get('timezone'):  # this comes form historical listing
            tz = timezone.WEBEX_TIMEZONE_ID_TO_PYTZ_LABEL_MAP[int(
                kwargs['timezone'])]
            if self._started_at is None and kwargs.get('sessionStartTime'):
                self._started_at = time(kwargs['sessionStartTime']).set_tz(tz)
            if self._ended_at is None and kwargs.get('sessionEndTime'):
                self._ended_at = time(kwargs['sessionEndTime']).set_tz(tz)

        self.description = mpop(kwargs, 'description') or None
        self.session_key = mpop(kwargs, 'session_key', 'sessionKey')
        self.visibility = mpop(
            kwargs,
            'listing',
            'listStatus',
            fallback=account.meetings_must_be_unlisted and 'UNLISTED'
            or 'PUBLIC').strip().lower()
Example #2
0
 def __init__(self, **kwargs):
     super(Registrant, self).__init__()
     self.webinar = kwargs.get('webinar')
     self.session = kwargs.get('session')
     self.key = mget(kwargs, 'key', 'registrant_key', 'registrantKey')
     self.email = nlower(mget(kwargs, 'email', 'attendeeEmail'))
     self.first_name = mget(kwargs, 'first_name', 'firstName', 'first')
     self.last_name = mget(kwargs, 'last_name', 'lastName', 'last')
     if kwargs.get('name'): self.name = nstrip(kwargs.get('name'))
     self.registered_at = ntime(
         mget(kwargs, 'registered_at', 'registrationDate'))
     self.join_url = mget(kwargs, 'join_url', 'joinUrl')
     self.status = kwargs.get('status')
     self.viewings = kwargs.get('viewings', [])
     if not self.viewings and kwargs.get('attendance'):
         self.viewings = sort([(time(d['joinTime']), time(d['leaveTime']))
                               for d in kwargs['attendance']])
     if not self.viewings and (
             kwargs.get('duration') or kwargs.get('attendanceTimeInSeconds')
     ) and self.session and self.session.key and self.session.started_at:
         duration = kwargs.get(
             'duration') or kwargs.get('attendanceTimeInSeconds') and delta(
                 s=kwargs['attendanceTimeInSeconds'])
         self.viewings = [(self.session.started_at,
                           self.session.started_at + duration)]
Example #3
0
 def __init__(self, **kwargs):
     super(Registrant, self).__init__()
     self.webinar = kwargs.get('webinar')
     self.session = kwargs.get('session')
     self.key = mget(kwargs, 'key', 'registrant_key', 'registrantKey')
     self.email = nlower(mget(kwargs, 'email', 'attendeeEmail'))
     self.first_name = mget(kwargs, 'first_name', 'firstName', 'first')
     self.last_name = mget(kwargs, 'last_name', 'lastName', 'last')
     if kwargs.get('name'): self.name = nstrip(kwargs.get('name'))
     self.registered_at = ntime(mget(kwargs, 'registered_at', 'registrationDate'))
     self.join_url = mget(kwargs, 'join_url', 'joinUrl')
     self.status = kwargs.get('status')
     self.viewings = kwargs.get('viewings',[])
     if not self.viewings and kwargs.get('attendance'):
         self.viewings = sort([(time(d['joinTime']),time(d['leaveTime'])) for d in kwargs['attendance']])
     if not self.viewings and (kwargs.get('duration') or kwargs.get('attendanceTimeInSeconds')) and self.session and self.session.key and self.session.started_at:
         duration = kwargs.get('duration') or kwargs.get('attendanceTimeInSeconds') and delta(s=kwargs['attendanceTimeInSeconds'])
         self.viewings = [(self.session.started_at, self.session.started_at+duration)]
Example #4
0
    def __init__(self, account, **kwargs):
        super(Event,self).__init__()
        self.account = account
        self.title = nstrip(mpop(kwargs, 'title', 'sessionName','confName'))
        self._starts_at = mpop(kwargs,'starts_at','_starts_at')
        self._ends_at = mpop(kwargs,'ends_at','_ends_at')
        self._started_at = mpop(kwargs,'started_at','_started_at')
        self._ended_at = mpop(kwargs,'ended_at','_ended_at')

        if kwargs.get('timeZoneID'): # this comes from normal listing
            tz = timezone.WEBEX_TIMEZONE_ID_TO_PYTZ_LABEL_MAP[int(kwargs['timeZoneID'])]
            if self._starts_at is None and kwargs.get('startDate'): self._starts_at = time(kwargs['startDate'], tz)
            if self._ends_at is None and kwargs.get('endDate'): self._ends_at = time(kwargs['endDate'], tz)

        if kwargs.get('timezone'): # this comes form historical listing
            tz = timezone.WEBEX_TIMEZONE_ID_TO_PYTZ_LABEL_MAP[int(kwargs['timezone'])]
            if self._started_at is None and kwargs.get('sessionStartTime'): self._started_at = time(kwargs['sessionStartTime']).set_tz(tz)
            if self._ended_at is None and kwargs.get('sessionEndTime'): self._ended_at = time(kwargs['sessionEndTime']).set_tz(tz)

        self.description = mpop(kwargs, 'description') or None
        self.session_key = mpop(kwargs, 'session_key', 'sessionKey')
        self.visibility = mpop(kwargs, 'listing', 'listStatus', fallback=account.meetings_must_be_unlisted and 'UNLISTED' or 'PUBLIC').strip().lower()