All pastes #26832 Raw Edit

Anonymous

public text v1 · immutable
#26832 ·published 2005-10-27 16:46 UTC
rendered paste body
#!/usr/bin/python
from distutils.core import setup, Extension
import string, commands, os, sys

inc_path = [string.split (commands.getoutput ('pwd'), '/build')[0]]
lib_path = []
lib_name = []
lib_other = ''
inc_other = ''

status, data = commands.getstatusoutput ('pkg-config --libs-only-L cspi-1.0')

if status == 0:
    tmp = string.split (data, '-L')
    for i in tmp:
        if i == '':
            continue
        else:
            lib_path.insert (0, string.strip (i))
else:
    sys.exit ('Unable to get: pkg-config --libs-only-L cspi-1.0')

status, data = commands.getstatusoutput ('pkg-config --libs-only-l cspi-1.0')
if status == 0:
    tmp = string.split (data, '-l')
    for i in tmp:
        if i == '':
            continue
        else:
            lib_name.insert (0, string.strip (i))
    lib_name.insert (0, 'gettextpo')
else:
    sys.exit ('Unable to get: pkg-config --libs-only-l cspi-1.0')

status, data = commands.getstatusoutput ('pkg-config --cflags-only-I cspi-1.0')
if status == 0:
    tmp = string.split (data, '-I')
    for i in tmp:
        if i == '':
            continue
        else:
            inc_path.insert (0, string.strip (i))
else:
    sys.exit ('Unable to get: pkg-config --cflags-only-I cspi-1.0')

status, lib_other = commands.getstatusoutput ('pkg-config --libs-only-other cspi-1.0')
if status != 0:
    sys.exit ('Unable to get: pkg-config --libs-only-other cspi-1.0')

status, inc_other = commands.getstatusoutput ('pkg-config --cflags-only-other cspi-1.0')
if status != 0:
    sys.exit ('Unable to get: pkg-config --cflags-only-other cspi-1.0')

source_files = ['ldtp.c']

ldtp_module = Extension ('ldtp',
                         library_dirs=lib_path,
                         libraries=lib_name,
                         include_dirs=inc_path,
                         extra_compile_args=['-g'],
                         sources = source_files)

ldtp_classify = [
          'Development Status :: 2 - Pre-Alpha',
          'Environment :: X11 Applications',
          'Environment :: X11 Applications :: GNOME',
          'Environment :: X11 Applications :: KDE',
          'Intended Audience :: Developers',
          'Intended Audience :: Quality Engineers',
          'License :: OSI Approved :: GNU General Public License (GPL)',
          'License :: OSI Approved :: GNU Lesser General Public License (LGPL)',
          'Operating System :: Linux',
          'Operating System :: POSIX',
          'Programming Language :: Python',
          'Programming Language :: C',
          'Topic :: Desktop Environment',
          'Topic :: Software Development :: Quality Assurance',
          'Topic :: Software Development :: Testing',
          ]

setup (name="ldtp",
       version="0.2.1",
       description="GNU/Linux Desktop Testing Project",
       author="Nagappan A",
       classifiers=ldtp_classify,
       author_email="nagappan@gmail.com",
       url="http://gnomebangalore.org/ldtp",
       ext_modules=[ldtp_module]
       )


./setup.py build
sudo ./setup.py install

You need to have accessibility enabled. Open one evolution instance. In python 'import ldtp'. Try do alt tab 2 times to go from your terminal to evolution and return back. Second time, when you go to evolution, evolution will hang. When you quit from python interpreter, you will notice the callbacks are getting called.