示例#1
0
def doit(args):
    from tilings_interpreter import arguments
    Logo.import_module(arguments)

    options, args = parser.parse_args(args)

    if "-" in args:
        argposition = args.index("-")+1
        fileposition = argposition-1
    else:
        argposition = len(args)
        fileposition = len(args)

    filenames = [os.path.join(os.path.dirname(here),"tilings_library.logo")] + args[:fileposition]

    arguments.set_args(args[argposition:])

    if options.gui:
        idemain(filenames)
    else:
        from tilings_interpreter import quantum_turtle
        Logo.import_module(quantum_turtle)
        quantum_turtle.createturtle(Logo,False)

        for filename in filenames:
            Logo.import_logo(filename)
        sys.stdout = sys.__stdout__
        Logo.input_loop(sys.stdin, sys.stdout)
示例#2
0
def idemain(filenames):
    import sys
    from pylogo import ide, interpreter
    from tilings_interpreter import quantum_turtle
    ide.TheApp = ide.IDE(ide.root)
    ide.TheApp.input.component('entry').focus_force()
    comm = ide.LogoCommunicator(ide.TheApp, interpreter.Logo)
    sys.stdout = comm

    interpreter.Logo.import_module(quantum_turtle)
    quantum_turtle.createturtle(interpreter.Logo,True)

    for filename in filenames:
        interpreter.Logo.import_logo(filename)

    comm.start()

    ide.root.mainloop()