示例#1
0
    def fetch_data(self, key=None, parameters=None):
        """Proxy function for fetching data."""
        params = parameters if parameters is not None else {}
        params['rtapi_key'] = key.key_name
        params['via'] = 'pyrt'
        params['format'] = 'json'
        response = urllib2.urlopen(self.to_path(self._data), urllib.urlencode(params))

        return JSONInterface.for_response(response.read(), True).object
示例#2
0
    def fetch_data(self, key=None, parameters=None):
        """Proxy function for fetching data."""
        params = parameters if parameters is not None else {}
        params['rtapi_key'] = key.key_name
        params['via'] = 'pyrt'
        params['format'] = 'json'
        response = urllib2.urlopen(self.to_path(self._data),
                                   urllib.urlencode(params))

        return JSONInterface.for_response(response.read(), True).object
示例#3
0
 def fetch_key(self, key=None):
     """Tests if key is valid."""
     response = urllib2.urlopen(self.to_path(self._has_key), urllib.urlencode({'rtapi_key': key.key_name}))
     return JSONInterface.for_response(response.read()).object
示例#4
0
 def fetch_key(self, key=None):
     """Tests if key is valid."""
     response = urllib2.urlopen(
         self.to_path(self._has_key),
         urllib.urlencode({'rtapi_key': key.key_name}))
     return JSONInterface.for_response(response.read()).object