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
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
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