Ejemplo n.º 1
0
 def i_will():
     iwill = will()
     func = lambda: 0
     func.will = iwill
     # return the function itself
     # so that we can retrieve it after the attribute call
     func.abc = func
     return func
Ejemplo n.º 2
0
    def wrapper(self, *args, **kwargs):
        # Update actions
        self.did, self.curr = self.curr, self.will
        self.will = will(2, raise_exc=False)

        if self.curr in finals and self.will in proxy.holding_left:
            raise CmdyActionError("Action taken after a final action.")
        # Initialize data
        # Make it True to tell future actions that I have been called
        # Just in case some plugins forget to do this
        self.data.setdefault(_cmdy_plugin_funcname(func), {})
        return func(self, *args, **kwargs)
Ejemplo n.º 3
0
 def func(raise_exc):
     wil = will(raise_exc=raise_exc)
     ret = lambda: None
     ret.a = 1
     ret.will = wil
     return ret
Ejemplo n.º 4
0
 def get_will():
     return {'a': will(raise_exc=True)}
Ejemplo n.º 5
0
 def iwill(self):
     self.will = will()
     return self
Ejemplo n.º 6
0
 def get_will():
     return will(2)
Ejemplo n.º 7
0
 def permit(self):
     self.will = will(raise_exc=False)
     if self.will == 'do':
         # let self handle do
         return self
     raise AttributeError('Should do something with AwesomeClass object')