Example #1
0
 def GetAllCalendarResources(self):
     if self.oauth2token is not None:
         client = CalendarResourceClient(domain='ums.ac.id')
         client.auth_token = self.oauth2token
         client.ssl = True
         return client.GetResourceFeed().entry
     else: return None
Example #2
0
 def GetCalendarResources(self, resource_id):
     if self.oauth2token is not None:
         client = CalendarResourceClient(domain='ums.ac.id')
         client.auth_token = self.oauth2token
         client.ssl = True
         return client.GetResource(resource_id=resource_id)
     else: return None
Example #3
0
 def DelCalendarResources(self, resource_id):
     if self.oauth2token is not None:
         client = CalendarResourceClient(domain='ums.ac.id')
         client.auth_token = self.oauth2token
         client.ssl = True
         client.DeleteResource(resource_id=resource_id)
         return True
     else: return False
Example #4
0
 def UpdateCalendarResources(self, resource_id, resource_common_name, resource_description, resource_email, resource_type):
     if self.oauth2token is not None:
         client = CalendarResourceClient(domain='ums.ac.id')
         client.auth_token = self.oauth2token
         client.ssl = True
         return client.UpdateResource(
             resource_id=resource_id,
             resource_common_name=resource_common_name,
             resource_description=resource_description,
             resource_email=resource_email,
             resource_type=resource_type)
     else: return False
Example #5
0
def GetClient():
    client = CalendarResourceClient(domain='ums.ac.id')
    client.ClientLogin(email=settings.GMAIL, password=settings.GPASS, source='apps')
    client.ssl = True
    return client