[pypy-commit] pypy default: Merged in techtonik/pypy (pull request #225)
arigo
noreply at buildbot.pypy.org
Fri Apr 11 11:15:24 CEST 2014
Author: Armin Rigo <armin.rigo at gmail.com>
Branch:
Changeset: r70548:e5faefcb6e67
Date: 2014-04-11 11:14 +0200
http://bitbucket.org/pypy/pypy/changeset/e5faefcb6e67/
Log: Merged in techtonik/pypy (pull request #225)
doc/tool/makeref.py: Windows compatibility and origin info in
_ref.txt
diff --git a/pypy/doc/_ref.txt b/pypy/doc/_ref.txt
--- a/pypy/doc/_ref.txt
+++ b/pypy/doc/_ref.txt
@@ -1,3 +1,6 @@
+.. This file is generated automatically by makeref.py script,
+ which in turn is run manually.
+
.. _`ctypes_configure/doc/sample.py`: https://bitbucket.org/pypy/pypy/src/default/ctypes_configure/doc/sample.py
.. _`dotviewer/`: https://bitbucket.org/pypy/pypy/src/default/dotviewer/
.. _`lib-python/`: https://bitbucket.org/pypy/pypy/src/default/lib-python/
diff --git a/pypy/doc/jit/_ref.txt b/pypy/doc/jit/_ref.txt
--- a/pypy/doc/jit/_ref.txt
+++ b/pypy/doc/jit/_ref.txt
@@ -0,0 +1,4 @@
+.. This file is generated automatically by makeref.py script,
+ which in turn is run manually.
+
+
diff --git a/pypy/doc/tool/makeref.py b/pypy/doc/tool/makeref.py
--- a/pypy/doc/tool/makeref.py
+++ b/pypy/doc/tool/makeref.py
@@ -1,3 +1,12 @@
+
+# patch sys.path so that this script can be executed standalone
+import sys
+from os.path import abspath, dirname
+# this script is assumed to be at pypy/doc/tool/makeref.py
+path = dirname(abspath(__file__))
+path = dirname(dirname(dirname(path)))
+sys.path.insert(0, path)
+
import py
import pypy
@@ -51,8 +60,11 @@
lines.append(".. _`%s`:" % linkname)
lines.append(".. _`%s`: %s" %(linknamelist[-1], linktarget))
- lines.append('')
- reffile.write("\n".join(lines))
+ content = ".. This file is generated automatically by makeref.py script,\n"
+ content += " which in turn is run manually.\n\n"
+ content += "\n".join(lines) + "\n"
+ reffile.write(content, mode="wb")
+
print "wrote %d references to %r" %(len(lines), reffile)
#print "last ten lines"
#for x in lines[-10:]: print x
More information about the pypy-commit
mailing list