Fixed console to exit properly, wasn't finished frankly.
Script now exits as expected.
This commit is contained in:
parent
4bb145e4ca
commit
b3b960e9ef
|
@ -93,11 +93,10 @@ class Console( threading.Thread ):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def __exit__( self, type, value, tb ):
|
def __exit__( self, type, value, tb ):
|
||||||
self.running = False
|
self.queue.put( ( Console.MSG.SHUTDOWN, ) )
|
||||||
|
self.queue.join( )
|
||||||
|
|
||||||
def run( self ):
|
def run( self ):
|
||||||
# TODO: switch to a queue so we're not spinning and wasting a thread
|
|
||||||
self.running = True
|
|
||||||
while True:
|
while True:
|
||||||
data = self.queue.get( )
|
data = self.queue.get( )
|
||||||
event = data[0]
|
event = data[0]
|
||||||
|
@ -107,6 +106,8 @@ class Console( threading.Thread ):
|
||||||
for ( pid, buffer ) in self.buffers.iteritems( ):
|
for ( pid, buffer ) in self.buffers.iteritems( ):
|
||||||
for line in buffer:
|
for line in buffer:
|
||||||
print( line )
|
print( line )
|
||||||
|
self.buffers.clear( )
|
||||||
|
self.queue.task_done( )
|
||||||
break
|
break
|
||||||
|
|
||||||
elif event == Console.MSG.WRITE:
|
elif event == Console.MSG.WRITE:
|
||||||
|
@ -126,6 +127,8 @@ class Console( threading.Thread ):
|
||||||
if pid in self.buffers:
|
if pid in self.buffers:
|
||||||
self.buffers.pop( pid, None )
|
self.buffers.pop( pid, None )
|
||||||
|
|
||||||
|
self.queue.task_done( )
|
||||||
|
|
||||||
class Worker( threading.Thread ):
|
class Worker( threading.Thread ):
|
||||||
def __init__( self, console, queue, files_to_ignore ):
|
def __init__( self, console, queue, files_to_ignore ):
|
||||||
threading.Thread.__init__( self )
|
threading.Thread.__init__( self )
|
||||||
|
@ -247,7 +250,6 @@ def main( args ):
|
||||||
|
|
||||||
( options, args ) = parser.parse_args( )
|
( options, args ) = parser.parse_args( )
|
||||||
|
|
||||||
|
|
||||||
root_full_path = os.getcwd( )
|
root_full_path = os.getcwd( )
|
||||||
|
|
||||||
# Files are added from .p4ignore
|
# Files are added from .p4ignore
|
||||||
|
|
Loading…
Reference in New Issue