Update of /cvsroot/freevo/freevo/src/helpers
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29264/src/helpers
Modified Files:
main.py rssh.py shutdown.py
Log Message:
update to new kaa.notifier
Index: rssh.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/helpers/rssh.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** rssh.py 6 Jul 2005 17:20:11 -0000 1.6
--- rssh.py 13 Jul 2005 19:28:40 -0000 1.7
***************
*** 36,41 ****
! def user_input( socket ):
! input = socket.readline().strip()
if input == 'help':
print '\rpossible commands:'
--- 36,41 ----
! def user_input():
! input = sys.stdin.readline().strip()
if input == 'help':
print '\rpossible commands:'
***************
*** 114,118 ****
mcomm.register_entity_notification(notification)
! kaa.notifier.addSocket( sys.stdin, user_input )
print 'rssh - recordserver shell'
--- 114,118 ----
mcomm.register_entity_notification(notification)
! kaa.notifier.SocketDispatcher(user_input).register(sys.stdin)
print 'rssh - recordserver shell'
Index: main.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/helpers/main.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** main.py 8 Jul 2005 18:59:43 -0000 1.10
--- main.py 13 Jul 2005 19:28:40 -0000 1.11
***************
*** 283,287 ****
# kick off the main menu loop
! kaa.notifier.addDispatcher( eventhandler.get_singleton().handle )
# start main loop
--- 283,287 ----
# kick off the main menu loop
! kaa.notifier.signals['idle'].connect( eventhandler.get_singleton().handle
)
# start main loop
Index: shutdown.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/helpers/shutdown.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** shutdown.py 2 Jul 2005 09:55:31 -0000 1.11
--- shutdown.py 13 Jul 2005 19:28:40 -0000 1.12
***************
*** 119,125 ****
"""
def __init__(self):
! kaa.notifier.addTimer(FIRST_START, self.check_mbus)
! # notifier check timer, not set by first FIRST_START waiting
! self.timer = None
# counter how often the shutdown function warns before real
# shutdown (6 == 5 minutes)
--- 119,126 ----
"""
def __init__(self):
! # notifier check timer
! self.timer = kaa.notifier.OneShotTimer(self.check_mbus)
! self.timer.start(FIRST_START)
! self.timer.first_start = True
# counter how often the shutdown function warns before real
# shutdown (6 == 5 minutes)
***************
*** 135,145 ****
An entity was added/removed from the mbus.
"""
! if not self.timer:
# we are in the startup mode (30 minutes wait)
return
log.warning('entity change, set timer %s seconds' % \
(POLL_INTERVALL / 1000))
! kaa.notifier.removeTimer(self.timer)
! self.timer = kaa.notifier.addTimer(POLL_INTERVALL, self.check_mbus)
--- 136,146 ----
An entity was added/removed from the mbus.
"""
! if self.timer.first_start:
# we are in the startup mode (30 minutes wait)
return
log.warning('entity change, set timer %s seconds' % \
(POLL_INTERVALL / 1000))
! # reset timer to POLL_INTERVALL
! self.timer.start(POLL_INTERVALL)
***************
*** 219,229 ****
Send a status request to all mbus entities to get the status.
"""
! if not self.timer and not self.shutdown_counter:
# looks like we came out of hibernate
log.info('reset all shutdown timer')
self.shutdown_counter = 6
! kaa.notifier.addTimer(FIRST_START, self.check_mbus)
return False
log.info('checking for possible system shutdown')
# next wakeup
--- 220,233 ----
Send a status request to all mbus entities to get the status.
"""
! if not self.shutdown_counter:
# looks like we came out of hibernate
log.info('reset all shutdown timer')
self.shutdown_counter = 6
! self.timer.start(FIRST_START)
! self.timer.first_start = True
return False
+ # now the plugin is running
+ self.timer.first_start = False
log.info('checking for possible system shutdown')
# next wakeup
***************
*** 238,243 ****
log.info('send status rpc to %s' % entity)
entity.call('status', self.rpcreturn)
! # set timer for shutdown in 5 seconds
! self.timer = kaa.notifier.addTimer(5000, self.check_shutdown)
return False
--- 242,247 ----
log.info('send status rpc to %s' % entity)
entity.call('status', self.rpcreturn)
! # set a timer for check_shutdown in 5 seconds
! kaa.notifier.OneShotTimer(self.check_shutdown).start(5000)
return False
***************
*** 284,288 ****
log.info('Next check in %s minutes' % wait)
# set a new timer
! self.timer = kaa.notifier.addTimer(wait * 60000, self.check_mbus)
# reset counter
self.shutdown_counter = max(self.shutdown_counter, 6)
--- 288,292 ----
log.info('Next check in %s minutes' % wait)
# set a new timer
! self.timer.start(wait * 60000)
# reset counter
self.shutdown_counter = max(self.shutdown_counter, 6)
***************
*** 295,300 ****
log.info('Next check in 5 minutes')
# reschedule checking
! self.timer = kaa.notifier.addTimer(5 * POLL_INTERVALL,
! self.check_mbus)
# set counter to 31 ( == 30 minutes after important the program
# has quit)
--- 299,303 ----
log.info('Next check in 5 minutes')
# reschedule checking
! self.timer.start(5 * POLL_INTERVALL)
# set counter to 31 ( == 30 minutes after important the program
# has quit)
***************
*** 313,317 ****
log.info('Next check in %s minutes' % wait)
# set a new timer
! self.timer = kaa.notifier.addTimer(wait * 60000,
self.check_mbus)
# reset counter
self.shutdown_counter = max(self.shutdown_counter, 6)
--- 316,320 ----
log.info('Next check in %s minutes' % wait)
# set a new timer
! self.timer.start(wait * 60000)
# reset counter
self.shutdown_counter = max(self.shutdown_counter, 6)
***************
*** 331,335 ****
log.warning('system shutdown system in %s minutes' % \
self.shutdown_counter)
! self.timer = kaa.notifier.addTimer(POLL_INTERVALL,
self.check_mbus)
return False
--- 334,338 ----
log.warning('system shutdown system in %s minutes' % \
self.shutdown_counter)
! self.timer.start(POLL_INTERVALL)
return False
***************
*** 342,347 ****
# set new timer in case we hibernate, set self.timer so it looks like
# the normal startup timer
! self.timer = None
! kaa.notifier.addTimer(FIRST_START, self.check_mbus)
return False
--- 345,350 ----
# set new timer in case we hibernate, set self.timer so it looks like
# the normal startup timer
! self.timer.start(FIRST_START)
! self.timer.first_start = True
return False
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog