コード例 #1
0
ファイル: interpreter.py プロジェクト: crcollins/pyOS
def start_shells(parent, programs):
    path = parent.get_path()

    proper = []
    for (programname, args, cin, cout) in programs:
        #hack to convert cin into streams from cat.
        if cin:
            newcin = System.new_shell(parent=parent, path=path,
                         program="cat", args=[cin])
        else:
            newcin = cin

        newshell = System.new_shell(parent=parent, stdin=newcin, path=path,
                program=programname, args=args)

        #hack to convert cout into streams to write
        if cout:
            newcout = System.new_shell(parent=parent, stdin=newcin, path=path,
                         program="write", args=cout)
        else:
            newcout = cout
        proper.extend([x for x in [newcin, newshell, newcout] if x])
    #(Scin0, shell0, Scout0, Scin1 ...)
    connect_shells(proper)
    return proper
コード例 #2
0
ファイル: login.py プロジェクト: crcollins/pyOS
def run(shell, args):
    user = raw_input("user: "******"password: "******"/" # db(user).homedir
        newshell = System.new_shell(parent=shell, path=path)
        add_vars(newshell, stuff)
        newshell.run()
    else:
        shell.stderr.write("Invalid username or password.")
        shell.stderr.write("")
コード例 #3
0
ファイル: pyOS.py プロジェクト: crcollins/pyOS
from kernel.system import System

if __name__ == '__main__':
    System.run()