summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorCedric Gustin <cedric.gustin@gmail.com>2006-09-21 07:13:40 +0000
committerCedric Gustin <gustin@src.gnome.org>2006-09-21 07:13:40 +0000
commit16d397d8f104b04c4de5f97957b5ae5cc6d27b74 (patch)
tree7c610c061e044ac80689d4d2bf3e4adad2640853 /setup.py
parent7e823bfb034b82377d092e954d9f73c48af5795f (diff)
downloadpygobject-16d397d8f104b04c4de5f97957b5ae5cc6d27b74.tar.gz
pygobject-16d397d8f104b04c4de5f97957b5ae5cc6d27b74.tar.xz
pygobject-16d397d8f104b04c4de5f97957b5ae5cc6d27b74.zip
Catch ImportError exception when codegen is not available: disable
2006-09-21 Cedric Gustin <cedric.gustin@gmail.com> * dsextras.py: Catch ImportError exception when codegen is not available: disable Template and TemplateExtension, redirect the user to the pygtk installer and raise a NameError exception. check_date has also been rewritten and now uses distutils.dep_util.newer_group(). defs files can also be built using createdefs by passing tuples as keyword argument to Template (see for example the gdk and gtk templates in setup.py). * setup.py: Changed the way the VERSION macro is defined on win32. Also install the html reference documentation, the xsl files and fixxref. * pygobject_postinstall.py: Set the value of DATADIR in fixxref.py. Add functions to install shortcuts in the Start menu to the reference manual (currently disabled: see bug #353849).
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index 3cced9f..31cad8e 100755
--- a/setup.py
+++ b/setup.py
@@ -6,6 +6,7 @@
from distutils.command.build import build
from distutils.core import setup
+import glob
import os
import sys
@@ -48,12 +49,14 @@ GLOBAL_MACROS += [('PYGOBJECT_MAJOR_VERSION', MAJOR_VERSION),
('PYGOBJECT_MINOR_VERSION', MINOR_VERSION),
('PYGOBJECT_MICRO_VERSION', MICRO_VERSION)]
-if sys.platform == 'win32':
- GLOBAL_MACROS.append(('VERSION', '\\\"%s\\\"' % VERSION))
+if sys.platform == 'win33':
+ GLOBAL_MACROS.append(('VERSION', '"""%s"""' % VERSION))
else:
GLOBAL_MACROS.append(('VERSION', '"%s"' % VERSION))
INCLUDE_DIR = os.path.join('include', 'pygtk-%s' % PYGOBJECT_SUFFIX)
+XSL_DIR = os.path.join('share', 'pygobject','xsl')
+HTML_DIR = os.path.join('share', 'gtk-doc', 'html', 'pygobject')
class PyGObjectInstallLib(InstallLib):
def run(self):
@@ -98,6 +101,8 @@ class PyGObjectInstallData(InstallData):
self.install_template('pygobject-2.0.pc.in',
os.path.join(self.install_dir,
'lib', 'pkgconfig'))
+ self.install_template('docs/xsl/fixxref.py.in',
+ os.path.join(self.install_dir, XSL_DIR))
class PyGObjectBuild(build):
enable_threading = 1
@@ -128,7 +133,6 @@ data_files = []
ext_modules = []
py_modules = []
py_modules.append('dsextras')
-py_modules.append('gobject.option')
if not have_pkgconfig():
print "Error, could not find pkg-config"
@@ -136,7 +140,11 @@ if not have_pkgconfig():
if gobject.can_build():
ext_modules.append(gobject)
+ py_modules.append('gobject.option')
data_files.append((INCLUDE_DIR, ('gobject/pygobject.h',)))
+ data_files.append((HTML_DIR, glob.glob('docs/html/*.html')))
+ data_files.append((HTML_DIR, ['docs/style.css']))
+ data_files.append((XSL_DIR, glob.glob('docs/xsl/*.xsl')))
else:
print
print 'ERROR: Nothing to do, gobject could not be found and is essential.'