Esempio n. 1
0
k_SplFileInfo = def_class(
    'SplFileInfo',
    methods=[construct,
             spl_toString,
             get_basename,
             get_extension,
             get_filename,
             get_path,
             get_pathname,
             get_group,
             get_inode,
             get_owner,
             get_perms,
             get_size,
             get_type,
             is_dir,
             is_link,
             is_executable,
             is_file,
             is_readable,
             is_writable,
             getatime,
             getctime,
             getmtime,
             get_realpath,
             get_linktarget,
             openfile],
    properties=[GetterSetterWrapper(_get_pathname, _set_pathname,
                                    "pathName", consts.ACC_PRIVATE),
                GetterSetterWrapper(_get_filename, _set_filename,
                                    "fileName", consts.ACC_PRIVATE), ],
    instance_class=W_SplFileInfo)
Esempio n. 2
0
SplFileInfoClass = def_class(
        'SplFileInfo',
    methods=[construct,
             spl_toString,
             get_basename,
             get_extension,
             get_filename,
             get_path,
             get_pathname,
             get_group,
             get_inode,
             get_owner,
             get_perms,
             get_size,
             get_type,
             is_dir,
             is_link,
             is_executable,
             is_file,
             is_readable,
             is_writable,
             getatime,
             getctime,
             getmtime,
             get_realpath,
             get_linktarget,
             openfile],
    properties=[GetterSetterWrapper(_get_pathname, _set_pathname,
                                    "pathName", consts.ACC_PRIVATE),
                GetterSetterWrapper(_get_filename, _set_filename,
                                    "fileName", consts.ACC_PRIVATE), ],
        instance_class=W_SplFileInfo
        )
Esempio n. 3
0
    def __init__(self, closure_obj):
        self.closure_obj = closure_obj

    def call_args(self, space, args_w, w_this=None, thisclass=None,
                  closureargs=None):
        closureargs = self.closure_obj.closure_args
        return self.closure_obj._func.call_args(space, args_w,
                                                closureargs=closureargs)


class W_DateObject(W_InstanceObject):
    def __init__(self, func, klass, dct_w):
        assert isinstance(func, Function)
        self._func = func
        self.closure_args = [None] * (len(func.names) - len(func.types))
        W_InstanceObject.__init__(self, klass, dct_w)

    def get_callable(self):
        return W_CallDate(self)


@wrap_method(['space', 'args_w'])
def closure_invoke(space, args_w):
    self = args_w[0]
    assert isinstance(self, W_DateObject)
    return self._func.call_args(space, args_w[1:])

def_class('Date',
        __invoke=closure_invoke,
)
Esempio n. 4
0
                  thisclass=None,
                  closureargs=None):
        closureargs = self.closure_obj.closure_args
        return self.closure_obj._func.call_args(space,
                                                args_w,
                                                closureargs=closureargs)


class W_DateObject(W_InstanceObject):
    def __init__(self, func, klass, dct_w):
        assert isinstance(func, Function)
        self._func = func
        self.closure_args = [None] * (len(func.names) - len(func.types))
        W_InstanceObject.__init__(self, klass, dct_w)

    def get_callable(self):
        return W_CallDate(self)


@wrap_method(['space', 'args_w'])
def closure_invoke(space, args_w):
    self = args_w[0]
    assert isinstance(self, W_DateObject)
    return self._func.call_args(space, args_w[1:])


def_class(
    'Date',
    __invoke=closure_invoke,
)
Esempio n. 5
0
SplFileInfoClass = def_class(
        'SplFileInfo',
    methods=[construct,
             spl_toString,
             get_basename,
             get_extension,
             get_filename,
             get_path,
             get_pathname,
             get_group,
             get_inode,
             get_owner,
             get_perms,
             get_size,
             get_type,
             is_dir,
             is_link,
             is_executable,
             is_file,
             is_readable,
             is_writable,
             getatime,
             getctime,
             getmtime,
             get_realpath,
             get_linktarget,
             openfile],
    properties=[GetterSetterWrapper(_get_pathname, _set_pathname,
                                    "pathName", consts.ACC_PRIVATE),
                GetterSetterWrapper(_get_filename, _set_filename,
                                    "fileName", consts.ACC_PRIVATE), ],
        instance_class=W_SplFileInfo
        )