summaryrefslogtreecommitdiff
path: root/host/mex
diff options
context:
space:
mode:
Diffstat (limited to 'host/mex')
-rw-r--r--host/mex/__init__.py (renamed from host/mex/mex/__init__.py)0
-rw-r--r--host/mex/hub.py (renamed from host/mex/mex/hub.py)1
-rw-r--r--host/mex/mex/forked.py48
-rw-r--r--host/mex/msg.py (renamed from host/mex/mex/msg.py)0
-rw-r--r--host/mex/node.py (renamed from host/mex/mex/node.py)1
-rw-r--r--host/mex/test/test.py4
6 files changed, 2 insertions, 52 deletions
diff --git a/host/mex/mex/__init__.py b/host/mex/__init__.py
index 17a462a3..17a462a3 100644
--- a/host/mex/mex/__init__.py
+++ b/host/mex/__init__.py
diff --git a/host/mex/mex/hub.py b/host/mex/hub.py
index a3dd785b..5ae88ba7 100644
--- a/host/mex/mex/hub.py
+++ b/host/mex/hub.py
@@ -24,7 +24,6 @@
"""mex Hub."""
import mex
from msg import Msg
-import msg
import socket, select
from struct import pack, unpack, calcsize
diff --git a/host/mex/mex/forked.py b/host/mex/mex/forked.py
deleted file mode 100644
index 9e72d7d3..00000000
--- a/host/mex/mex/forked.py
+++ /dev/null
@@ -1,48 +0,0 @@
-# mex - Messages exchange library. {{{
-#
-# Copyright (C) 2008 Nicolas Schodet
-#
-# APBTeam:
-# Web: http://apbteam.org/
-# Email: team AT apbteam DOT org
-#
-# 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
-# MERCHANTABILITY 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.
-#
-# }}}
-"""Run a function in a separate process."""
-import os, sys, signal
-
-class Forked:
- """
- Usage:
-
- >>> f = Forked (function)
- (function runs in background, in a separated process)
- >>> f.kill ()
- (send the SIGTERM signal to the process)
- """
-
- def __init__ (self, function):
- """Initialise, fork, and call the given function in the children
- process."""
- self.pid = os.fork ()
- if self.pid == 0:
- function ()
- sys.exit (0)
-
- def kill (self):
- """Kill the forked function."""
- os.kill (self.pid, signal.SIGTERM)
- os.waitpid (self.pid, 0)
diff --git a/host/mex/mex/msg.py b/host/mex/msg.py
index 5399a3c9..5399a3c9 100644
--- a/host/mex/mex/msg.py
+++ b/host/mex/msg.py
diff --git a/host/mex/mex/node.py b/host/mex/node.py
index e54d1ba6..3307a4d7 100644
--- a/host/mex/mex/node.py
+++ b/host/mex/node.py
@@ -24,7 +24,6 @@
"""mex Node."""
import mex
from msg import Msg
-import msg
import socket
from struct import pack, unpack, calcsize
diff --git a/host/mex/test/test.py b/host/mex/test/test.py
index bdb705a2..c4382c2c 100644
--- a/host/mex/test/test.py
+++ b/host/mex/test/test.py
@@ -1,10 +1,10 @@
import sys
-sys.path.append (sys.path[0] + '/..')
+sys.path.append (sys.path[0] + '/../..')
from mex.hub import Hub
from mex.node import Node
from mex.msg import Msg
-from mex.forked import Forked
+from utils.forked import Forked
import select
def log (x):