Exemple #1
0
 def __call__(self, *args, **kwargs):
     call = self.call
     if call.nargs != '*' and len(args) != call.nargs:
         raise TypeError('%s() takes exactly %s (%s given)' %
                         (call.name, nice_number(call.nargs, 'argument'),
                          nice_number(len(args))))
     url = call.path
     params, http_extra = call.check_params(kwargs)
     if args:
         url = appendslash(url) + '/'.join(('%s' % a for a in args))
     if call.append:
         url = appendslash(url) + call.append
     if not call.scheme:
         url = self.api.BASE_URL + url
     response = self.api.request(call, url, params, **http_extra)
     return response.on_finished.add_callback(self.callback)
Exemple #2
0
 def __call__(self, *args, **kwargs):
     call = self.call
     if call.nargs != '*' and len(args) != call.nargs:
         raise TypeError('%s() takes exactly %s (%s given)' %
                         (call.name,
                          nice_number(call.nargs, 'argument'),
                          nice_number(len(args))))
     url = call.path
     params, http_extra = call.check_params(kwargs)
     if args:
         url = appendslash(url) + '/'.join(('%s' % a for a in args))
     if call.append:
         url = appendslash(url) + call.append
     if not call.scheme:
         url = self.api.BASE_URL + url
     response = self.api.request(call, url, params, **http_extra)
     return response.on_finished.add_callback(self.callback)
Exemple #3
0
 def test_appendslash(self):
     self.assertEqual(appendslash('bla'), 'bla/')
     self.assertEqual(appendslash('bla/'), 'bla/')
Exemple #4
0
 def test_appendslash(self):
     self.assertEqual(appendslash('bla'), 'bla/')
     self.assertEqual(appendslash('bla/'), 'bla/')
Exemple #5
0
 def test_appendslash(self):
     self.assertEqual(appendslash("bla"), "bla/")
     self.assertEqual(appendslash("bla/"), "bla/")