Exemplo n.º 1
0
def load_pxic_file(filename):
    f = open(filename)
    from pixie.vm.libs.pxic.reader import Reader, read_obj
    from pixie.vm.reader import eof
    import pixie.vm.compiler as compiler

    if not we_are_translated():
        print "Loading precompiled file while interpreted, this may take time"
    with compiler.with_ns(u"user"):
        compiler.NS_VAR.deref().include_stdlib()
        rdr = Reader(f)
        while True:
            if not we_are_translated():
                sys.stdout.write(".")
                sys.stdout.flush()
            o = read_obj(rdr)
            if o is eof:
                break
            o.invoke([])

    if not we_are_translated():
        print "done"
Exemplo n.º 2
0
def load_pxic_file(filename):
    f = open(filename)
    from pixie.vm.libs.pxic.reader import Reader, read_obj
    from pixie.vm.reader import eof
    import pixie.vm.compiler as compiler

    if not we_are_translated():
        print "Loading precompiled file while interpreted, this may take time"
    with compiler.with_ns(u"user"):
        compiler.NS_VAR.deref().include_stdlib()
        rdr = Reader(f)
        while True:
            if not we_are_translated():
                sys.stdout.write(".")
                sys.stdout.flush()
            o = read_obj(rdr)
            if o is eof:
                break
            o.invoke([])

    if not we_are_translated():
        print "done"