Пример #1
0
 def __init__(self,**kwargs):
     if kwargs.get('name',False):
         self.name = kwargs['name']
     if kwargs.get('id',False):
         self.id = kwargs['id']
     if kwargs.get('email_address',False):
         self.email_address = kwargs['email_address']
     if kwargs.get('admin',False):
         self.admin = kwargs['admin']
     if kwargs.get('created_at',False):
         self.created_at = kwargs['created_at']
     if kwargs.get('updated_at',False):
         self.updated_at = kwargs['updated_at']
     if kwargs.get('starred_projects',False):
         self._starred_projects = kwargs['starred_projects']
     if kwargs.get('active_projects',False):
         self._active_projects = kwargs['active_projects']
     if kwargs.get('events',False):
         self._events = kwargs['events']
     if kwargs.get('assigned_todos',False):
         self._assigned_todos = kwargs['assigned_todos']
     if kwargs.get('avatar_url',False):
         self.avatar_url = kwargs['avatar_url']
     if kwargs.get('fullsize_avatar_url',False):
         self.fullsize_avatar_url = kwargs['fullsize_avatar_url']
     self.todos = send_request(url=self._assigned_todos['url'])
     self.assigned_todos = []
     for bucket in self.todos:
         self.assigned_todos.append(bucket['assigned_todos'])
     self.all_todolists = get_todo_lists_for_person(BC,self.id)
     self.starred_projects = get_starred_projects(BC)
     self.events = send_request(url=self._events['url'])
Пример #2
0
 def _get_todos(self):
     self._todo_buckets = []
     for bucket in self.assigned_todos:
         tmp = []
         for todo in bucket:
             res = send_request(url=todo['url'])
             tmp.append(res)
             self._todos.append(res)
         self._todo_buckets.append(tmp)
Пример #3
0
def get_me(account_num):
    return send_request(make_api_url(account_num,'people','me'),get_auth())
Пример #4
0
def get_all_active_projects(account_num):
    return send_request(make_api_url(account_num,'projects'),AUTH)
Пример #5
0
 def get_project_todolists(self,pid):
     for proj in self.projects:
         if proj['id'] == pid:
             return send_request(url=proj['todolists']['url'].auth=get_auth())
     return None
Пример #6
0
 def get_avatar(self,filename):
     fp = open(filename,'wb')
     data = send_request(url=self.avatar_url,json=False)
     fp.write(data.content)
     fp.close()
Пример #7
0
def update_todo(account_number,project_id,todo_id,todo_data):
    url = make_api_url(account_number,'projects',project_id,'todo',todo_id)
    return send_request(url,post_data=todo_data,post=True)
Пример #8
0
def get_todo(account_num,project_id,todo_id):
    return send_request(make_api_url(account_num,'projects',project_id,'todos',todo_id),get_auth())
Пример #9
0
def get_all_people(account_num=BC):
    return send_request(make_api_url(account_num,'people'))
Пример #10
0
def get_me(account_num=None):
    if account_num is None:
        account_num = BC
    return send_request(make_api_url(account_num,'people','me'))
Пример #11
0
def get_person(account_num=BC,person_id=None):
    if person_id is None:
        raise IOError('need a person to get')
    return send_request(make_api_url(account_num,'people',person_id))
Пример #12
0
def add_comment_to_todo(account_num,project_id,todo_id,content,*subs):
    url = make_api_url(account_num,'projects',project_id,'todos',todo_id,'comments')
    res = send_request(url,json=False,post=True,session=get_session(),data=make_comment_content(content,*subs))
    return res
Пример #13
0
def get_project_subscribers(account_num,project_id,name_list):
    return send_request(make_api_url(account_num,'projects',project_id,'accesses'),session=get_session())
Пример #14
0
def get_starred_projects(account_num):
    return send_request(make_api_url(account_num,'stars'),get_auth())
Пример #15
0
def get_all_complete_todo_lists(account_num):
    return send_request(make_api_url(account_num,'todolists','completed'),get_auth())
Пример #16
0
def get_todo_lists_for_person(account_num,person_id):
    return send_request(make_api_url(account_num,'people',person_id,'assigned_todos'),get_auth())
Пример #17
0
def get_all_topics(account_num):
    return send_request(make_api_url(account_num,'topics'),get_auth())
Пример #18
0
def get_complete_project_todo_lists(account_num,project_id):
    return send_request(make_api_url(account_num,'projects',project_id,'todolists','completed'),get_auth())
Пример #19
0
def get_project_topics(account_num,project_id):
    return send_request(make_api_url(account_num,'projects',project_id,'topics'),get_auth())
Пример #20
0
def get_starred_projects(account_num=BC):
    return send_request(make_api_url(account_num,'stars'))
Пример #21
0
def get_complete_project_todo_lists(account_num, project_id):
    return send_request(
        make_api_url(account_num, 'projects', project_id, 'todolists',
                     'completed'), get_auth())
Пример #22
0
 def send_basecamp_request(url):
     return send_request(url=url)
Пример #23
0
def get_all_active_todo_lists(account_num):
    return send_request(make_api_url(account_num, 'todolists'), get_auth())
Пример #24
0
def get_all_complete_todo_lists(account_num):
    return send_request(make_api_url(account_num, 'todolists', 'completed'),
                        get_auth())
Пример #25
0
def get_active_project_todo_lists(account_num,project_id):
    return send_request(make_api_url(account_num,'projects',project_id,'todolists'))
Пример #26
0
def get_project(account_num,project_id):
    return send_request(make_api_url(account_num,'projects',project_id),AUTH)
Пример #27
0
def get_all_active_todo_lists(account_num):
    return send_request(make_api_url(account_num,'todolists'),get_auth())
Пример #28
0
def get_all_archived_projects(account_num):
    return send_request(make_api_url(account_num,'projects','archived'),AUTH)
Пример #29
0
def get_person(account_num,person_id):
    return send_request(make_api_url(account_num,'people',person_id),get_auth())