Ejemplo n.º 1
0
 def get(self, query, url, **kwargs):
     if ':' in query:
         raise TypeError('Query must be single key only!')
     else:
         q = url + 'get/' + query
         try:
             return str(http(q).read()).strip('\n')
         except Exception as (e):
             raise IOError('Unable to reach SlateKV URL. Err:'  + str(e))
Ejemplo n.º 2
0
 def change(self, query, url, **kwargs):
     if len(query.split(':')) != 2:
         raise TypeError('Object must be key:value! Not enough or too many key:value pairs submitted')
     else:
         q = url + 'change/' + query
         try:
             return str(http(q).read()).strip('\n')
         except Exception as (e):
             raise IOError('Unable to reach SlateKV URL. Err:'  + str(e))