Source

milky / milky / request.py

Full commit
#!/usr/bin/env python2.6
# -*- coding: utf-8 -*-

from milky import models

"""Method properties.

{'prefix': {'method': (auth_required, 
    (required_args, ), (optional_args, ), 
    response_model), }, }
"""
METHODS = {
    'auth': {
        'checkToken': (False, 
            ('auth_token', ), (), 
            models.Auth, ),
        'getFrob': (False, 
            (), (), 
            models.Frob, ),
        'getToken': (False, 
            ('frob', ), (), 
            models.Auth, ), },
    'contacts': {
        'add': (True, 
            ('timeline', 'contact', ), (), 
            models.Contact, ),
        'delete': (True, 
            ('timeline', 'contact_id', ), (), 
            models.Stat, ),
        'getList': (True, 
            (), (), 
            models.Contacts, ), },
    'groups': {
        'add': (True, 
            ('timeline', 'group', ), (), 
            models.Group, ),
        'addContact': (True, 
            ('timeline', 'group_id', 'contact_id', ), (), 
            models.Stat, ),
        'delete': (True, 
            ('timeline', 'group_id', ), (), 
            models.Stat, ),
        'getList': (True, 
            (), (), 
            models.Groups, ),
        'removeContact': (True, 
            ('timeline', 'group_id', 'contact_id', ), (), 
            models.Stat, ), },
    'lists': {
        'add': (True, 
            ('timeline', 'name', ), ('filter', ), 
            models.List, ),
        'archive': (True, 
            ('timeline', 'list_id', ), (), 
            models.List, ),
        'delete': (True, 
            ('timeline', 'list_id', ), (), 
            models.List, ),
        'getList': (True, 
            (), (), 
            models.Lists, ),
        'setDefaultList': (True, 
            ('timeline', ), ('list_id', ), 
            models.Stat, ),
        'setName': (True, 
            ('timeline', 'list_id', 'name', ), (), 
            models.List, ),
        'unarchive': (True, 
            ('timeline', ), ('list_id', ), 
            models.List, ), },
    'locations': {
        'getList': (True, 
            (), (), 
            models.Locations, ), },
    'reflection': {
        'getMethodInfo': (False, 
            ('method_name', ), (), 
            models.Method, ),
        'getMethods': (False, 
            (), (), 
            models.Methods, ), },
    'settings': {
        'getList': (True, 
            (), (), 
            models.Settings, ), },
    'tasks': {
        'add': (True, 
            ('timeline', 'name', ), ('list_id', 'parse', ), 
            models.TaskList, ),
        'addTags': (True, 
            ('timeline', 'list_id', 'taskseries_id', 'task_id', 'tags', ), (), 
            models.TaskList, ),
        'complete': (True, 
            ('timeline', 'list_id', 'taskseries_id', 'task_id', ), (), 
            models.TaskList, ),
        'delete': (True, 
            ('timeline', 'list_id', 'taskseries_id', 'task_id', ), (), 
            models.TaskList, ),
        'getList': (True, 
            (), ('list_id', 'filter', 'last_sync', ), 
            models.Tasks, ),
        'movePriority': (True, 
            ('timeline', 'list_id', 'taskseries_id', 'task_id', 'direction', ), (), 
            models.TaskList, ),
        'moveTo': (True, 
            ('timeline', 'from_list_id', 'to_list_id', 'taskseries_id', 'task_id', ), (), 
            models.TaskList, ),
        'postpone': (True, 
            ('timeline', 'list_id', 'taskseries_id', 'task_id', ), (), 
            models.TaskList, ),
        'removeTags': (True, 
            ('timeline', 'list_id', 'taskseries_id', 'task_id', 'tags', ), (), 
            models.TaskList, ),
        'setDueDate': (True, 
            ('timeline', 'list_id', 'taskseries_id', 'task_id', ), ('due', 'has_due_time', 'parse', ), 
            models.TaskList, ),
        'setEstimate': (True, 
            ('timeline', 'list_id', 'taskseries_id', 'task_id', ), ('estimate', ), 
            models.TaskList, ),
        'setLocation': (True, 
            ('timeline', 'list_id', 'taskseries_id', 'task_id', ), ('location_id', ), 
            models.TaskList, ),
        'setName': (True, 
            ('timeline', 'list_id', 'taskseries_id', 'task_id', 'name', ), (), 
            models.TaskList, ),
        'setPriority': (True, 
            ('timeline', 'list_id', 'taskseries_id', 'task_id', ), ('priority', ), 
            models.TaskList, ),
        'setRecurrence': (True, 
            ('timeline', 'list_id', 'taskseries_id', 'task_id', ), ('repeat', ), 
            models.TaskList, ),
        'setTags': (True, 
            ('timeline', 'list_id', 'taskseries_id', 'task_id', ), ('tags', ), 
            models.TaskList, ),
        'setURL': (True, 
            ('timeline', 'list_id', 'taskseries_id', 'task_id', ), ('url', ), 
            models.TaskList, ),
        'uncomplete': (True, 
            ('timeline', 'list_id', 'taskseries_id', 'task_id', ), (), 
            models.TaskList, ), },
    'tasksnotes': {
        'add': (True, 
            ('timeline', 'list_id', 'taskseries_id', 'task_id', 'note_title', 'note_text', ), (), 
            models.Note, ),
        'delete': (True, 
            ('timeline', 'note_id', ), (), 
            models.Stat, ),
        'edit': (True, 
            ('timeline', 'note_id', 'note_title', 'note_text', ), (), 
            models.Note, ), },
    'test': {
        'echo': (False, 
            (), (), 
            models.Stat, ),
        'login': (True, 
            (), (), 
            models.User, ), },
    'time': {
        'convert': (True, 
            ('to_timezone', ), ('from_timezone', 'to_timezone', 'time', ), 
            models.Time, ),
        'parse': (True, 
            ('text', ), ('timezone', 'dateformat', ), 
            models.Time, ), },
    'timelines': {
        'create': (True, 
            (), (), 
            models.Timeline, ), },
    'timezones': {
        'getList': (True, 
            (), (), 
            models.Timezones, ), },
    'transactions': {
        'undo': (True, 
            ('timeline', 'transaction_id', ), (), 
            models.Stat, ), }, }