summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2006-08-06 21:19:01 +0000
committerJohan Dahlin <johan@src.gnome.org>2006-08-06 21:19:01 +0000
commit748ffd872a8b504ff2c0d1f633b5a8d53b465a0e (patch)
treed68f3d0117d056d66e0462735f5006817a2d0f4d
parent3cac3b8c1dc55319132e2e64f84254869fa7a6c0 (diff)
downloadpygtk-748ffd872a8b504ff2c0d1f633b5a8d53b465a0e.tar.gz
Remove, it moved to PyGObject.
* docs/fixxref.py: Remove, it moved to PyGObject.
-rw-r--r--ChangeLog4
-rw-r--r--configure.in3
-rw-r--r--docs/Makefile.am4
-rw-r--r--docs/fixxref.py64
4 files changed, 8 insertions, 67 deletions
diff --git a/ChangeLog b/ChangeLog
index 264bc222..428db71a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-08-06 Johan Dahlin <johan@gnome.org>
+
+ * docs/fixxref.py: Remove, it moved to PyGObject.
+
2006-08-06 John Finlay <finlay@moeraki.com>
* docs/fixxref.py (link_pat): Allow patterns that cross multiple lines.
diff --git a/configure.in b/configure.in
index ffd1447b..b3e386b7 100644
--- a/configure.in
+++ b/configure.in
@@ -131,6 +131,9 @@ AC_SUBST(PYGOBJECT_INCLUDEDIR)
PYGOBJECT_DATADIR=`$PKG_CONFIG --variable=datadir pygobject-2.0`
AC_SUBST(PYGOBJECT_DATADIR)
+PYGOBJECT_FIXXREF="$PYTHON `$PKG_CONFIG --variable=fixxref pygobject-2.0`"
+AC_SUBST(PYGOBJECT_FIXXREF)
+
dnl atk
PKG_CHECK_MODULES(ATK, atk >= atk_required_version,
have_atk=true, have_atk=false)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index e390f243..23d6089e 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -3,8 +3,6 @@ BUILDDIR = $(top_builddir)/docs
REF_VERSION = $(PYGTK_MAJOR_VERSION).$(PYGTK_MINOR_VERSION)
FULL_VERSION = $(REF_VERSION).$(PYGTK_MICRO_VERSION)
-FIX_XREF = $(srcdir)/fixxref.py
-FIX_REF_INDEX_DIRS = -i $(datadir)/gtk-doc/html/pygobject
HTML_STYLE = $(PYGOBJECT_DATADIR)/pygobject/xsl/ref-html-style.xsl
PDF_STYLE = $(PYGOBJECT_DATADIR)/pygobject/xsl/pdf-style.xsl
@@ -600,7 +598,7 @@ build_stamp: $(REFERENCE_DEPS)
--stringparam gtkdoc.bookname "pygtk" \
--stringparam gtkdoc.version ${REF_VERSION} \
$(HTML_STYLE) $(srcdir)/reference/pygtk2-ref.xml
- python ${FIX_XREF} ${FIX_REF_INDEX_DIRS} $(BUILDDIR)/html
+ $(PYGOBJECT_FIXXREF) $(BUILDDIR)/html
touch $@
pdf: $(REFERENCE_DEPS) reference/builddate.xml
diff --git a/docs/fixxref.py b/docs/fixxref.py
deleted file mode 100644
index e0a74d27..00000000
--- a/docs/fixxref.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env python
-# -*- Mode: Python; py-indent-offset: 4 -*-
-
-import sys, re, os, getopt
-
-anchors = {}
-anchor_pat = re.compile(r'''^\s*<ANCHOR\s+id\s*=\s*"([^"]*)"\s+
- href\s*=\s*"([^"]*)"\s*>''',
- re.MULTILINE | re.VERBOSE)
-link_pat = re.compile(r'''<PYGTKDOCLINK\s+HREF="([^"]*)"\s*>(.*?)
- </PYGTKDOCLINK\s*>''', re.DOTALL|re.VERBOSE)
-def scan_index_dir(idir):
- #print 'scanning dir', idir
- for root, dirs, files in os.walk(idir):
- if 'index.sgml' in files:
- scan_index_file(os.path.join(root, 'index.sgml'))
- return
-
-def scan_index_file(ifile):
- #print 'scanning file', ifile
- buf = open(ifile).read()
- for id, href in anchor_pat.findall(buf):
- anchors[id] = href
- return
-
-def fix_xrefs(hdir):
- for f in os.listdir(hdir):
- if os.path.splitext(f)[1] == '.html':
- fix_html_file(os.path.join(hdir, f))
- return
-
-def link_subst(m):
- id, text = m.groups()
- if anchors.has_key(id):
- return '<a\nhref="../' + anchors[id] + '"\n>' + text + '</a>'
- return text
-
-def fix_html_file(hfile):
- #print 'fixing file', hfile
- buf = open(hfile).read()
- buf = link_pat.sub(link_subst, buf)
- open(hfile, 'w').write(buf)
- return
-
-if __name__ == '__main__':
- try:
- opts, args = getopt.getopt(sys.argv[1:], "i:h:",
- ["index-dir=", "html-dir="])
- except getopt.error, e:
- sys.stderr.write('fixxref.py: %s\n' % e)
- sys.stderr.write('usage: fixxref.py -i idex-dir html-dir\n')
- sys.exit(1)
- index_dirs = []
- for opt, arg in opts:
- if opt in ('-i', '--index-dir'):
- index_dirs.append(arg)
- if len(args) != 1 or not index_dirs:
- sys.stderr.write('usage: fixxref.py -i index-dir html-dir\n')
- sys.exit(1)
-
- html_dir = args[0]
- for idir in index_dirs:
- scan_index_dir(idir)
- fix_xrefs(html_dir)