def __init__(self, canvas, namespace=None, vars=None):
        '''
        :param canvas: Canvas implementation for output.
        :param namespace: Optionally specify a dict to inject as namespace
        :param vars: Optional dict containing initial values for variables
        '''
        Grammar.__init__(self, canvas, namespace=namespace, vars=vars)
        canvas.set_bot(self)

        self._autoclosepath = True
        self._path = None

        if self._input_device:
            # Get constants like KEY_DOWN, KEY_LEFT
            for key_name, value in self._input_device.get_key_map().items():
                self._namespace[key_name] = value
                setattr(self, key_name, value)

        self._canvas.size = None
        self._frame = 1
        self._set_initial_defaults()
def __init__ ( self , canvas , namespace = None , vars = None ) : Grammar . __init__ ( self , canvas , namespace = namespace , vars = vars ) canvas . set_bot ( self ) self . _autoclosepath = True self . _path = None if self . _input_device : for key_name , value in self . _input_device . get_key_map ( ) . items ( ) : self . _namespace [ key_name ] = value setattr ( self , key_name , value ) self . _canvas . size = None self . _frame = 1 self . _set_initial_defaults ( )
:param canvas: Canvas implementation for output.
        :param namespace: Optionally specify a dict to inject as namespace
        :param vars: Optional dict containing initial values for variables