[PyKDE] Qt2 & Qt3 both installed?

Ulrich Berning ulrich.berning at desys.de
Tue Feb 5 20:18:04 GMT 2002


Skipped content of type multipart/alternative-------------- next part --------------
"""Perform arbitrary additional site-specific customizations.

****************************************************************
* This module is automatically imported during initialization. *
****************************************************************

"""

import sys, os

#
# Append the path where PyQt is installed to sys.path
# depending on the last part of the directory defined
# in the QTDIR environment variable
#
# e.g. if QTDIR points to /opt/qt-3.0.1 you should
# install (or move) PyQt into
#    <prefix>/lib/python2.2/site-packages/qt-3.0.1
# or <prefix>\lib\site-packages\qt-3.0.1
# on windows
# and if QTDIR points to /opt/qt-2.3.1 you should
# install (or move) PyQt into
#    <prefix>/lib/python2.2/site-packages/qt-2.3.1
# or <prefix>\lib\site-packages\qt-2.3.1
# on windows
#
# If QTDIR is not set, or is empty, or the resulting
# directory does not exist, nothing happens.
#
if os.environ.has_key('QTDIR'):
    qtdir = os.path.basename(os.environ['QTDIR'])
    if qtdir:
        prefixes = [sys.prefix]
        if sys.exec_prefix != sys.prefix:
            prefixes.append(sys.exec_prefix)
        for prefix in prefixes:
            if prefix:
                if os.sep == '/':
                    sitedirs = [os.path.join(prefix,
                                             "lib",
                                             "python" + sys.version[:3],
                                             "site-packages",
                                             qtdir),
                                os.path.join(prefix, "lib", "site-python", qtdir)]
                else:
                    sitedirs = [os.path.join(prefix, qtdir),
                                os.path.join(prefix, "lib", "site-packages", qtdir)]
                for sitedir in sitedirs:
                    if os.path.isdir(sitedir):
                        sys.path.append(sitedir)



More information about the PyQt mailing list