[wpdev-commits] xmlscripts/scripts webadmin.py,1.14,1.15
Brought to you by:
rip,
thiagocorrea
|
From: <dar...@us...> - 2004-01-21 21:38:20
|
Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv21370
Modified Files:
webadmin.py
Log Message:
Index: webadmin.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/webadmin.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** webadmin.py 6 Jan 2004 13:09:12 -0000 1.14
--- webadmin.py 21 Jan 2004 21:38:17 -0000 1.15
***************
*** 231,286 ****
class WebserverThread(Thread):
! def __init__( self, port=REMOTEADMIN_PORT ):
! Thread.__init__( self )
! self.port = port
! self.stopped = Event()
! self.httpd = None
!
! def cancel( self ):
! self.stopped.set()
! self.httpd.server_close()
!
! def run( self ):
! # Wait with binding the webserver for 5 Seconds
! server_address = ( '', self.port )
!
! # Starting up
! if not wolfpack.isreloading():
! wolfpack.console.send( "Remote Admin running on port %u\n" % self.port )
! try:
! filepath = os.path.normpath( os.path.abspath( 'web/' ) )
! self.httpd = Webserver( ( '', self.port ), filepath )
! except:
! traceback.print_exc()
! return
! while 1:
! self.httpd.handle_request()
! self.stopped.wait( 0.05 )
!
! if self.stopped.isSet():
! break
! wolfpack.console.send( "Shutting down the Remote Admin.\n" )
thread = None
def onServerStart():
! web.sessions.clear_sessions()
!
! global thread
! thread = WebserverThread( REMOTEADMIN_PORT )
! thread.start()
def onLoad():
! # Not on ServerStart
! if not wolfpack.isstarting():
! web.sessions.clear_sessions()
! # Start the Thread
! global thread
! thread = WebserverThread( REMOTEADMIN_PORT )
! thread.start()
def onUnload():
--- 231,282 ----
class WebserverThread(Thread):
! def __init__( self, port=REMOTEADMIN_PORT ):
! Thread.__init__( self )
! self.port = port
! self.stopped = Event()
! self.httpd = None
! def cancel( self ):
! self.stopped.set()
! def run( self ):
! # Wait with binding the webserver for 5 Seconds
! server_address = ('', self.port)
!
! # Starting up
! if not wolfpack.isreloading():
! wolfpack.console.send("Remote Admin running on port %u\n" % self.port)
!
! try:
! filepath = os.path.normpath(os.path.abspath('web/'))
! self.httpd = Webserver(('', self.port), filepath)
! except:
! traceback.print_exc()
! return
!
! while not self.stopped.isSet():
! self.httpd.handle_request()
! self.stopped.wait(0.05)
! wolfpack.console.send("Shutting down the Remote Admin.\n")
thread = None
def onServerStart():
! web.sessions.clear_sessions()
!
! global thread
! thread = WebserverThread(REMOTEADMIN_PORT)
! thread.start()
def onLoad():
! # Not on ServerStart
! if not wolfpack.isstarting():
! web.sessions.clear_sessions()
! # Start the Thread
! global thread
! thread = WebserverThread( REMOTEADMIN_PORT )
! thread.start()
def onUnload():
***************
*** 289,293 ****
if thread:
thread.cancel()
! time.sleep( 1 ) # This is needed to allow the thread to sync (Remember => global interpreter lock)
thread.join() # Join with the thread
--- 285,289 ----
if thread:
thread.cancel()
! time.sleep(30) # This is needed to allow the thread to sync (Remember => global interpreter lock)
thread.join() # Join with the thread
|