コード例 #1
0
def direct(fn):
    """
    The *direct* decorator used to specify the *direct* model.
    :param fn: The function being decorated.
    :type fn: function
    :return: The decorated function.
    """
    opt = options(fn)
    opt.call.model = valid_model(DIRECT)
    return fn
コード例 #2
0
ファイル: decorators.py プロジェクト: darinlively/gofer
 def inner(fn):
     opt = options(fn)
     opt.call.model = valid_model(model)
     if secret:
         required = Options()
         required.secret = secret
         auth = ('secret', required)
         opt.security.append(auth)
     Remote.add(fn)
     return fn
コード例 #3
0
def fork(fn):
    """
    The *fork* decorator used to specify the *fork* model.
    :param fn: The function being decorated.
    :type fn: function
    :return: The decorated function.
    """
    opt = options(fn)
    opt.call.model = valid_model(FORK)
    return fn
コード例 #4
0
def fork(fn):
    """
    The *fork* decorator used to specify the *fork* model.
    :param fn: The function being decorated.
    :type fn: function
    :return: The decorated function.
    """
    opt = options(fn)
    opt.call.model = valid_model(FORK)
    return fn
コード例 #5
0
def direct(fn):
    """
    The *direct* decorator used to specify the *direct* model.
    :param fn: The function being decorated.
    :type fn: function
    :return: The decorated function.
    """
    opt = options(fn)
    opt.call.model = valid_model(DIRECT)
    return fn
コード例 #6
0
 def inner(fn):
     opt = options(fn)
     opt.call.model = valid_model(model)
     if secret:
         required = Options()
         required.secret = secret
         auth = ('secret', required)
         opt.security.append(auth)
     Remote.add(fn)
     return fn
コード例 #7
0
ファイル: test_model.py プロジェクト: jortel/gofer
 def test_valid_model(self):
     # valid
     for model in ALL:
         self.assertTrue(valid_model(model))
     # invalid
     self.assertRaises(ValueError, valid_model, 1234)
コード例 #8
0
 def test_valid_model(self):
     # valid
     for model in ALL:
         self.assertTrue(valid_model(model))
     # invalid
     self.assertRaises(ValueError, valid_model, 1234)
コード例 #9
0
ファイル: decorators.py プロジェクト: swipswaps/gofer
 def inner(fn):
     opt = options(fn)
     opt.call.model = valid_model(model)
     Remote.add(fn)
     return fn