diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2009-08-15 11:51:15 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2009-08-15 11:51:15 +0200 |
commit | 088452702812614cbbbaa64b116f29971920fac2 (patch) | |
tree | 6ebcac8a97e12720e09630e4f41c3cc7ecacd6bb /portato | |
parent | 44d410d007e88d794e35e322082bec3ec69d5fa7 (diff) | |
download | portato-088452702812614cbbbaa64b116f29971920fac2.tar.gz portato-088452702812614cbbbaa64b116f29971920fac2.tar.bz2 portato-088452702812614cbbbaa64b116f29971920fac2.zip |
Renamed 'mq' to 'ipc'
Diffstat (limited to '')
-rw-r--r-- | portato/__init__.py | 10 | ||||
-rw-r--r-- | portato/ipc.pxd (renamed from portato/mq.pxd) | 2 | ||||
-rw-r--r-- | portato/ipc.pyx (renamed from portato/mq.pyx) | 2 | ||||
-rw-r--r-- | portato/listener.py | 26 |
4 files changed, 20 insertions, 20 deletions
diff --git a/portato/__init__.py b/portato/__init__.py index bc1783b..433c89a 100644 --- a/portato/__init__.py +++ b/portato/__init__.py @@ -89,12 +89,12 @@ def start(): else: # start us again in root modus and launch listener - from . import mq + from . import ipc - _mq = mq.MessageQueue(None, mq.MessageQueue.CREAT | mq.MessageQueue.EXCL) + mq = ipc.MessageQueue(None, ipc.MessageQueue.CREAT | ipc.MessageQueue.EXCL) # start listener - lt = threading.Thread(target=get_listener().set_recv, args = (_mq,)) + lt = threading.Thread(target=get_listener().set_recv, args = (mq,)) lt.setDaemon(False) lt.start() @@ -106,7 +106,7 @@ def start(): su = detect_su_command() if su: debug("Using '%s' as su command.", su.bin) - cmd = su.cmd("%s --no-fork --mq %ld" % (sys.argv[0], _mq.key)) + cmd = su.cmd("%s --no-fork --mq %ld" % (sys.argv[0], mq.key)) sp = subprocess.Popen(cmd, env = env) @@ -126,4 +126,4 @@ def start(): get_listener().close() lt.join() - _mq.remove() + mq.remove() diff --git a/portato/mq.pxd b/portato/ipc.pxd index be7631b..64ca05d 100644 --- a/portato/mq.pxd +++ b/portato/ipc.pxd @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# File: portato/mq.pxd +# File: portato/ipc.pxd # This file is part of the Portato-Project, a graphical portage-frontend. # # Copyright (C) 2006-2009 René 'Necoro' Neumann diff --git a/portato/mq.pyx b/portato/ipc.pyx index e9ce464..4a06102 100644 --- a/portato/mq.pyx +++ b/portato/ipc.pyx @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# File: portato/mq.pyx +# File: portato/ipc.pyx # This file is part of the Portato-Project, a graphical portage-frontend. # # Copyright (C) 2006-2009 René 'Necoro' Neumann diff --git a/portato/listener.py b/portato/listener.py index 4666269..aa9e31d 100644 --- a/portato/listener.py +++ b/portato/listener.py @@ -32,13 +32,13 @@ class Listener (object): @ivar _send: sender socket @type _send: int""" - def set_recv (self, _mq): + def set_recv (self, mq): - self._mq = _mq + self.mq = mq while True: try: - msg, type = self._mq.receive() + msg, type = self.mq.receive() data = msg.split("\0") debug("Listener received: %s", data) @@ -53,7 +53,7 @@ class Listener (object): debug("Got KeyboardInterrupt. Aborting.") break - self._mq = None + self.mq = None def do_cmd (self, cmdlist): """Starts a command as the user. @@ -76,20 +76,20 @@ class Listener (object): n.set_urgency(int(urgency)) n.show() - def set_send (self, _mq = None): - if _mq is None: + def set_send (self, mq = None): + if mq is None: warning(_("Listener has not been started.")) - self._mq = None + self.mq = None else: - from . import mq + from . import ipc - self._mq = mq.MessageQueue(_mq) + self.mq = ipc.MessageQueue(mq) def __send (self, string): - self._mq.send(string) + self.mq.send(string) def send_notify (self, base = "", descr = "", icon = "", urgency = None): - if self._mq is None: + if self.mq is None: self.do_notify(base, descr, icon, urgency) else: string = "\0".join(["notify", base, descr, icon]) @@ -102,11 +102,11 @@ class Listener (object): self.__send(string) def send_cmd (self, cmdlist): - if self._mq is None: + if self.mq is None: self.do_cmd(cmdlist) else: self.__send("\0".join(["cmd"] +cmdlist)) def close (self): - if self._mq is not None: + if self.mq is not None: self.__send("close") |