From 5d54a277f509951bc1762637e46eb572d6b83e83 Mon Sep 17 00:00:00 2001 From: ftyers Date: Mon, 17 Dec 2007 18:09:31 +0000 Subject: [PATCH] Merging git-svn-id: https://apertium.svn.sourceforge.net/svnroot/apertium@3061 72bbbca6-d526-0410-a7d9-f06f51895060 --- apertium-tools/apertium-py/apertium/__init__.py | 0 .../apertium-py/apertium/command_line.py | 30 ----------------- apertium-tools/apertium-py/apertium/service.py | 39 ---------------------- apertium-tools/apertium-py/setup.py | 23 ------------- 4 files changed, 92 deletions(-) delete mode 100644 apertium-tools/apertium-py/apertium/__init__.py delete mode 100644 apertium-tools/apertium-py/apertium/command_line.py delete mode 100644 apertium-tools/apertium-py/apertium/service.py delete mode 100755 apertium-tools/apertium-py/setup.py diff --git a/apertium-tools/apertium-py/apertium/__init__.py b/apertium-tools/apertium-py/apertium/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/apertium-tools/apertium-py/apertium/command_line.py b/apertium-tools/apertium-py/apertium/command_line.py deleted file mode 100644 index 38f92046..00000000 --- a/apertium-tools/apertium-py/apertium/command_line.py +++ /dev/null @@ -1,30 +0,0 @@ -def call(cmdline, _in): - import os - - """A convenience function to invoke a subprocess with the - parameter list name (where the first argument is the name - of an executable). The subprocess is fed the contents of - input via stdin. We collect the output of both stdout and - stderr from the subprocess. If stderr is not empty, we - raise an exception, otherwise we return the contents of - stdout.""" - child_in, child_out, child_err = os.popen3(" ".join(cmdline)) - - child_in.write(_in) - child_in.close() # You MUST close the child's stdin to get output from some programs - - out = child_out.read() - child_out.close() - err = child_err.read() - child_err.close() - - return out, err - -class OsCommand(object): - def __init__(self, cmd): - self.cmd = cmd - - def communicate(self, _input): - print "calling", self.cmd - return call(self.cmd, _input) - diff --git a/apertium-tools/apertium-py/apertium/service.py b/apertium-tools/apertium-py/apertium/service.py deleted file mode 100644 index 0960151d..00000000 --- a/apertium-tools/apertium-py/apertium/service.py +++ /dev/null @@ -1,39 +0,0 @@ -import gobject - -import dbus -import dbus.service -import dbus.mainloop.glib - -dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) -method = dbus.service.method - - -class Service(dbus.service.Object): - def __init__(self, name): - dbus.service.Object.__init__(self, dbus.SessionBus(), name) - - -def make_proxy(path, interface): - slash_index = path.index('/') - dbus_name = path[:slash_index] - obj_name = path[slash_index:] - - return dbus.Interface(dbus.SessionBus().get_object(dbus_name, obj_name), interface) - - -def add_signal_receiver(*args, **kwargs): - dbus.SessionBus().add_signal_receiver(*args, **kwargs) - - -mainloop = None - -def quit(): - mainloop.quit() - -def run_as(name): - global mainloop - - name = dbus.service.BusName(name, dbus.SessionBus()) - mainloop = gobject.MainLoop() - mainloop.run() - diff --git a/apertium-tools/apertium-py/setup.py b/apertium-tools/apertium-py/setup.py deleted file mode 100755 index 2dfd8152..00000000 --- a/apertium-tools/apertium-py/setup.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python - -from os import walk -try: - from setuptools import setup -except ImportError: - from distutils.core import setup - -setup(name='apertium-py', - version="0.1", - author='Wynand Winterbach', - author_email='wynand.winterbach@gmail.com', - packages=['apertium'], - description='A library with .', - classifiers=[ - 'Development Status :: 1 - Alpha', - 'Environment :: Console', - 'Intended Audience :: Developers', - 'Intended Audience :: Developers', - 'Programming Language :: Python', - 'License :: GNU General Public License', - ] - ) -- 2.11.4.GIT