~kees/gtg/lp-562604

« back to all changes in this revision

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

  • Committer: Luca Invernizzi
  • Date: 2010-03-17 03:55:32 UTC
  • Revision ID: invernizzi.l@gmail.com-20100317035532-sarc1755vc3e3mat
rtm library updated

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
__all__ = (
5
5
    'API',
6
6
    'createRTM',
7
 
    'set_log_level'
 
7
    'set_log_level',
8
8
        )
9
9
 
10
10
 
21
21
    import simplejson
22
22
    _use_simplejson = True
23
23
except ImportError:
24
 
    pass
25
 
 
 
24
    try:
 
25
        from django.utils import simplejson
 
26
        _use_simplejson = True
 
27
    except ImportError:
 
28
        pass
 
29
    
26
30
if not _use_simplejson:
27
31
    warnings.warn("simplejson module is not available, "
28
32
             "falling back to the internal JSON parser. "
93
97
        json = openURL(SERVICE_URL, params).read()
94
98
 
95
99
        #LOG.debug("JSON response: \n%s" % json)
96
 
        time.sleep(1)
97
100
        if _use_simplejson:
98
101
            data = dottedDict('ROOT', simplejson.loads(json))
99
102
        else:
183
186
    return urllib.urlopen(url)
184
187
 
185
188
class dottedDict(object):
186
 
    "Make dictionary items accessible via the object-dot notation."
 
189
    """Make dictionary items accessible via the object-dot notation."""
187
190
 
188
191
    def __init__(self, name, dictionary):
189
192
        self._name = name