Update of /cvsroot/freevo/kaa/base/src/notifier
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13535
Modified Files:
__init__.py
Added Files:
signals.py
Removed Files:
posixsignals.py
Log Message:
rename posixsignals.py to signals.py again
--- NEW FILE: signals.py ---
# -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------------
# signals.py - Signal handling for the notifier
# -----------------------------------------------------------------------------
# $Id: signals.py,v 1.6 2005/07/13 20:21:02 dischi Exp $
#
# -----------------------------------------------------------------------------
# kaa-notifier - Notifier Wrapper
# Copyright (C) 2005 Dirk Meyer, et al.
#
# First Version: Dirk Meyer <[EMAIL PROTECTED]>
# Maintainer: Dirk Meyer <[EMAIL PROTECTED]>
#
# Please see the file doc/AUTHORS for a complete list of authors.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MER-
# CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# -----------------------------------------------------------------------------
from signal import *
try:
# try to import pyNotifier
import notifier
except ImportError:
# use a copy of nf_generic
import nf_generic as notifier
_signal_dict = {}
_signal_list = []
def register(sig, function):
"""
Register a signal handler.
"""
_signal_dict[sig] = function
signal(sig, _signal_catch)
def has_signal():
"""
Return True if there are signals in the queue.
"""
return _signal_list
def _signal_handler():
"""
Call all registered signal handler.
"""
while _signal_list:
sig = _signal_list.pop(0)
_signal_dict[sig](sig)
return False
def _signal_catch(sig, frame):
"""
Catch signals to be called from the main loop.
"""
if not sig in _signal_list:
# add catched signal to the list
_signal_list.append(sig)
# FIXME: let's hope this works because the handler
# is called asynchron
notifier.addTimer(0, _signal_handler)
return True
--- posixsignals.py DELETED ---
Index: __init__.py
===================================================================
RCS file: /cvsroot/freevo/kaa/base/src/notifier/__init__.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** __init__.py 13 Jul 2005 20:19:15 -0000 1.10
--- __init__.py 13 Jul 2005 20:21:02 -0000 1.11
***************
*** 35,40 ****
# kaa.notifier imports
! from posixsignals import *
! from posixsignals import register as signal
from popen import Process
from popen import killall as kill_processes
--- 35,40 ----
# kaa.notifier imports
! from signals import *
! from signals import register as signal
from popen import Process
from popen import killall as kill_processes
-------------------------------------------------------
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