~mrasmus/gtg/reset-tag-color

« back to all changes in this revision

Viewing changes to GTG/plugins/rtm_sync/pyrtm/rtm.py

  • Committer: Luca Invernizzi
  • Date: 2009-12-15 04:28:33 UTC
  • mto: This revision was merged to the branch mainline in revision 479.
  • Revision ID: invernizzi.l@gmail.com-20091215042833-yf21jzp8w4ilxau5
Update in pyrtm library

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
        )
9
9
 
10
10
 
11
 
#import new
12
11
import warnings
13
12
import urllib
14
13
import time
15
 
#import logging
16
14
from hashlib import md5
17
15
from GTG import _
18
16
 
103
101
        rsp = data.rsp
104
102
 
105
103
        if rsp.stat == 'fail':
106
 
            error_string = _("API call failed")+ " - %s (%s)"
107
 
            raise RTMAPIError, error_string % (
 
104
            raise RTMAPIError, 'API call failed - %s (%s)' % (
108
105
                rsp.err.msg, rsp.err.code)
109
106
        else:
110
107
            return rsp
199
196
                    value = [dottedDict('%s_%d' % (key, i), item)
200
197
                             for i, item in indexed(value)]
201
198
                setattr(self, key, value)
 
199
        else:
 
200
            raise ValueError, 'not a dict: %s' % dictionary
202
201
 
203
202
    def __repr__(self):
204
203
        children = [c for c in dir(self) if not c.startswith('_')]
225
224
API = {
226
225
   'auth': {
227
226
       'checkToken':
228
 
           [('auth_token'), ()],
 
227
           [('auth_token',), ()],
229
228
       'getFrob':
230
229
           [(), ()],
231
230
       'getToken':
232
 
           [('frob'), ()]
 
231
           [('frob',), ()]
233
232
       },
234
233
    'contacts': {
235
234
        'add':
253
252
        },
254
253
    'lists': {
255
254
        'add':
256
 
            [('timeline', 'name',), ('filter')],
 
255
            [('timeline', 'name',), ('filter',)],
257
256
        'archive':
258
 
            [('timeline', 'list_id'),()],
 
257
            [('timeline', 'list_id'), ()],
259
258
        'delete':
260
 
            [('timeline', 'list_id'),()],
 
259
            [('timeline', 'list_id'), ()],
261
260
        'getList':
262
 
            [(),()],
 
261
            [(), ()],
263
262
        'setDefaultList':
264
263
            [('timeline'), ('list_id')],
265
264
        'setName':
266
 
            [('timeline', 'list_id', 'name')],
 
265
            [('timeline', 'list_id', 'name'), ()],
267
266
        'unarchive':
268
 
            [('timeline'), ('list_id')]
 
267
            [('timeline',), ('list_id',)]
269
268
        },
270
269
    'locations': {
271
270
        'getList':