Esempio n. 1
0
 def __init__(self, *args, **kwargs):
     OrObject.__init__(self, "", OrException)
     
     self.args = args
     self.kwargs = kwargs
     self.traceback = []
     
     self.set("traceback", self.traceback)
     self.set("args", self.args)
     self.set("kwargs", self.kwargs)
Esempio n. 2
0
    def __init__(self, fin=sys.stdin, fout=sys.stdout, ferr=sys.stderr):
        OrObject.__init__(self, "cons", Console)
        self.set("$$input", self.input)
        self.set("$$output", self.output)
        self.set("read", Function(self.read))
        self.set("write", Function(self.write))
        self.set("error", Function(self.error))

        self.fin = fin
        self.fout = fout
        self.ferr = ferr
Esempio n. 3
0
    def __init__(self, **binds):
        OrObject.__init__(self, "io", IO)
        self.__bound = binds
        self.bind(binds.items()[0][0])

        self.set("$$input", self.input)
        self.set("$$output", self.output)
        self.set("read", Function(self.read))
        self.set("write", Function(self.write))
        self.set("error", Function(self.error))
        self.set("bind", Function(self.bind))
        self.set("register", Function(self.register))
        self.set("get", Function(self.get_reg))
Esempio n. 4
0
    def __init__(self, fname, mode="r"):
        OrObject.__init__(self, "", File)
        self.set("$$input", self.input)
        self.set("$$output", self.output)
        self.set("read", Function(self.read))
        self.set("write", Function(self.write))
        self.set("close", Function(self.close))

        if type(fname) == type(""):
            self.fname = fname
            self.file = open(fname, mode)
        elif type(fname) == types.FileType:
            self.fname = "???"
            self.file = fname

        self.buf = []
Esempio n. 5
0
    def __init__(self, intp, arglist=None, block=None, doc="", tags=[]):
        if arglist is None:
            self.fn = intp
            OrObject.__init__(self, self.fn.__name__, Function)
            self.set("$$doc", self.fn.__doc__)
            self.set("$$call", self.__call__)
        else:
            OrObject.__init__(self, "[anon]", Function)
            self.set("$$doc", doc)
            self.set("$$call", self.__call__)
            self.set("$$tags", OrObject.from_py(tags))

            self.arglist = arglist
            self.block = block
            self.intp = intp
            self.parcntx = self.intp.curr

            self.argtypes = [i[0] for i in arglist]
            self.argnames = [i[1] for i in arglist if not i[0].startswith("UNWRAPPABLE")]
            self.simpleargs = [i[1] for i in arglist if i[0] == "ARG"]
Esempio n. 6
0
 def __init__(self, *args, **kwargs):
     dict.__init__(self, *args, **kwargs)
     OrObject.__init__(self, "[anon]", OrDict)
Esempio n. 7
0
 def __init__(self, *args, **kwargs):
     str.__init__(self)
     OrObject.__init__(self, "[anon]", String)