Here's the actual code.  It pauses immediately after reaching the main
loop--but after any input is recieved it enters an infinite loop.
class mineServer(object):
    def __init__(self):

        #Start the server process
        self.SP = subprocess.Popen(["java","-Xmx1024M", "-Xms1024M", "-jar",
"minecraft_server.jar", "nogui"], stdout=subprocess.PIPE,
stdin=subprocess.PIPE, stderr=subprocess.PIPE)

        self.bufferedLine = ''
        self.consoleLock = threading.Lock()

        if self.hasStarted():
            self.main()


    def main(self):
        signal.signal(signal.SIGINT, self.Handler)
        while True:
            inputReady, outputready, exceptReady =
select([sys.stdin,self.SP.stderr],[],[], 1)
            for IO in inputReady:
                line = IO.read()
                print line
                if IO == sys.stdin:
                    self.SP.stdin.write(line)
                    self.SP.stdin.flush()
                if (line.find("<") <> -1):
                    self.runParser(line)

-- 
Todd Millecam
--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list

Reply via email to