diff -Naur asciidoc-old/etc/asciidoc/filters/code/code-filter.py asciidoc-py2/etc/asciidoc/filters/code/code-filter.py --- asciidoc-old/etc/asciidoc/filters/code/code-filter.py 2012-12-18 01:23:17.049363909 -0500 +++ asciidoc-py2/etc/asciidoc/filters/code/code-filter.py 2012-12-18 01:31:13.756869649 -0500 @@ -24,7 +24,7 @@ Backend output file format: 'docbook', 'linuxdoc', 'html', 'css'. -l - The name of the source code language: 'python', 'ruby', 'c++', 'c'. + The name of the source code language: 'python2', 'ruby', 'c++', 'c'. -t tabsize Expand source tabs to tabsize spaces. @@ -79,7 +79,7 @@ ('','') } keywords = { - 'python': + 'python2': ('and', 'del', 'for', 'is', 'raise', 'assert', 'elif', 'from', 'lambda', 'return', 'break', 'else', 'global', 'not', 'try', 'class', 'except', 'if', 'or', 'while', 'continue', 'exec', 'import', 'pass', @@ -103,12 +103,12 @@ 'volatile', 'wchar_t', 'while') } block_comments = { - 'python': ("'''","'''"), + 'python2': ("'''","'''"), 'ruby': None, 'c++': ('/*','*/') } inline_comments = { - 'python': '#', + 'python2': '#', 'ruby': '#', 'c++': '//' } diff -Naur asciidoc-old/etc/asciidoc/filters/source/source-highlight-filter.conf asciidoc-py2/etc/asciidoc/filters/source/source-highlight-filter.conf --- asciidoc-old/etc/asciidoc/filters/source/source-highlight-filter.conf 2012-12-18 01:23:17.052697225 -0500 +++ asciidoc-py2/etc/asciidoc/filters/source/source-highlight-filter.conf 2012-12-18 01:31:13.886868985 -0500 @@ -61,7 +61,7 @@ source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="source-highlight -f xhtml -s {language} {src_numbered?--line-number=' '} {src_tab?--tab={src_tab}} {args=}" endif::[] ifeval::["{source-highlighter}"=="highlight"] -source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="highlight --no-doc --inline-css --out-format=xhtml --syntax={language@python:py:{language}} {src_numbered?--line-number} {src_tab?--tab={src_tab}} --encoding={encoding} {args=}" +source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="highlight --no-doc --inline-css --out-format=xhtml --syntax={language@python2:py:{language}} {src_numbered?--line-number} {src_tab?--tab={src_tab}} --encoding={encoding} {args=}" endif::[] ifeval::["{source-highlighter}"=="pygments"] source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered"),filter="pygmentize -f html -l {language} {src_numbered?-O linenos=table} {encoding?-O encoding={encoding}} {args=}" @@ -79,7 +79,7 @@ source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="source-highlight -f html -s {language} {src_numbered?--line-number=' '} {src_tab?--tab={src_tab}} {args=}" endif::[] ifeval::["{source-highlighter}"=="highlight"] -source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="highlight --no-doc --inline-css --out-format=html --syntax={language@python:py:{language}} {src_numbered?--line-number} {src_tab?--tab={src_tab}} {args=}" +source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="highlight --no-doc --inline-css --out-format=html --syntax={language@python2:py:{language}} {src_numbered?--line-number} {src_tab?--tab={src_tab}} {args=}" endif::[] endif::basebackend-html4[] diff -Naur asciidoc-old/etc/asciidoc/help.conf asciidoc-py2/etc/asciidoc/help.conf --- asciidoc-old/etc/asciidoc/help.conf 2012-12-18 01:23:17.052697225 -0500 +++ asciidoc-py2/etc/asciidoc/help.conf 2012-12-18 01:31:13.940202045 -0500 @@ -54,7 +54,7 @@ option may be specified more than once. --doctest - Run Python doctests in asciidoc module. + Run Python2 doctests in asciidoc module. -d, --doctype=DOCTYPE Document type: article, manpage or book. The book document type diff -Naur asciidoc-old/etc/asciidoc/html5.conf asciidoc-py2/etc/asciidoc/html5.conf --- asciidoc-old/etc/asciidoc/html5.conf 2012-12-18 01:23:17.056030541 -0500 +++ asciidoc-py2/etc/asciidoc/html5.conf 2012-12-18 01:31:14.080201329 -0500 @@ -81,7 +81,7 @@ {data-uri%}{alt={target}} {data-uri#}{alt={target}} +{data-uri#}{sys3:"{python2}" -u -c "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{imagesdir=}",r"{target}")}"}"> {link#} @@ -91,7 +91,7 @@ {data-uri%}{alt={target}} {data-uri#}{alt={target}} +{data-uri#}{sys:"{python2}" -u -c "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{imagesdir=}",r"{target}")}"}"> {link#}
{caption={figure-caption} {counter:figure-number}. }{title}
@@ -150,7 +150,7 @@ endif::data-uri[] ifdef::data-uri[] {index} +{sys:"{python2}" -u -c "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{icon={iconsdir}/callouts/{index}.png}")}"}"> endif::data-uri[] endif::icons[] @@ -213,7 +213,7 @@ item={listindex}| endif::data-uri[] ifdef::data-uri[] -item={listindex}| +item={listindex}| endif::data-uri[] text=| endif::icons[] @@ -378,7 +378,7 @@ {data-uri%}{icons#}{caption} {data-uri#}{icons#}{caption} +{data-uri#}{icons#}{sys:"{python2}" -u -c "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{icon={iconsdir}/{name}.png}")}"}"> {icons%}
{caption}
diff -Naur asciidoc-old/etc/asciidoc/xhtml11-quirks.conf asciidoc-py2/etc/asciidoc/xhtml11-quirks.conf --- asciidoc-old/etc/asciidoc/xhtml11-quirks.conf 2012-12-18 01:23:17.056030541 -0500 +++ asciidoc-py2/etc/asciidoc/xhtml11-quirks.conf 2012-12-18 01:31:14.040201533 -0500 @@ -10,7 +10,7 @@ {data-uri%}{alt={target}} {data-uri#}{alt={target}} +{data-uri#}{sys:"{python2}" -u -c "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{imagesdir=}",r"{target}")}"}" /> {link#}
{caption={figure-caption} {counter:figure-number}: }{title}
diff -Naur asciidoc-old/etc/asciidoc/xhtml11.conf asciidoc-py2/etc/asciidoc/xhtml11.conf --- asciidoc-old/etc/asciidoc/xhtml11.conf 2012-12-18 01:23:17.059363857 -0500 +++ asciidoc-py2/etc/asciidoc/xhtml11.conf 2012-12-18 01:31:14.223533929 -0500 @@ -80,7 +80,7 @@ {data-uri%}{alt={target}} {data-uri#}{alt={target}} +{data-uri#}{sys3:"{python2}" -u -c "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{imagesdir=}",r"{target}")}"}" /> {link#} @@ -90,7 +90,7 @@ {data-uri%}{alt={target}} {data-uri#}{alt={target}} +{data-uri#}{sys:"{python2}" -u -c "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{imagesdir=}",r"{target}")}"}" /> {link#}
{caption={figure-caption} {counter:figure-number}. }{title}
@@ -131,7 +131,7 @@ endif::data-uri[] ifdef::data-uri[] {index} +{sys:"{python2}" -u -c "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{icon={iconsdir}/callouts/{index}.png}")}"}" /> endif::data-uri[] endif::icons[] @@ -194,7 +194,7 @@ item={listindex}| endif::data-uri[] ifdef::data-uri[] -item={listindex}| +item={listindex}| endif::data-uri[] text=| endif::icons[] @@ -359,7 +359,7 @@ {data-uri%}{icons#}{caption} {data-uri#}{icons#}{caption} +{data-uri#}{icons#}{sys:"{python2}" -u -c "import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "{eval:os.path.join(r"{indir={outdir}}",r"{icon={iconsdir}/{name}.png}")}"}" /> {icons%}
{caption}
diff -Naur asciidoc-old/usr/bin/a2x.py asciidoc-py2/usr/bin/a2x.py --- asciidoc-old/usr/bin/a2x.py 2012-12-18 01:23:17.072697123 -0500 +++ asciidoc-py2/usr/bin/a2x.py 2012-12-18 01:31:15.293528453 -0500 @@ -199,13 +199,13 @@ # TODO: this is probably unnecessary, see: # http://groups.google.com/group/asciidoc/browse_frm/thread/9442ee0c419f1242 # Windows doesn't like running scripts directly so explicitly - # specify python interpreter. + # specify python2 interpreter. # Extract first (quoted or unquoted) argument. mo = re.match(r'^\s*"\s*(?P[^"]+)\s*"', cmd) if not mo: mo = re.match(r'^\s*(?P[^ ]+)', cmd) if mo.group('arg0').endswith('.py'): - cmd = 'python ' + cmd + cmd = 'python2 ' + cmd # Remove redundant quoting -- this is not just cosmetic, # quoting seems to dramatically decrease the allowed command # length in Windows XP. diff -Naur asciidoc-old/usr/bin/asciidoc.py asciidoc-py2/usr/bin/asciidoc.py --- asciidoc-old/usr/bin/asciidoc.py 2012-12-18 01:23:17.072697123 -0500 +++ asciidoc-py2/usr/bin/asciidoc.py 2012-12-18 01:31:15.256861973 -0500 @@ -11,7 +11,7 @@ ### Used by asciidocapi.py ### VERSION = '8.6.8' # See CHANGLOG file for version history. -MIN_PYTHON_VERSION = '2.4' # Require this version of Python or better. +MIN_PYTHON2_VERSION = '2.4' # Require this version of Python2 or better. #--------------------------------------------------------------------------- # Program constants. @@ -380,7 +380,7 @@ # The following functions are so we don't have to use the dangerous # built-in eval() function. if float(sys.version[:3]) >= 2.6 or sys.platform[:4] == 'java': - # Use AST module if CPython >= 2.6 or Jython. + # Use AST module if CPython2 >= 2.6 or Jython2. import ast from ast import literal_eval @@ -407,18 +407,18 @@ values = ast.parse("[" + val + "]", mode='eval').body.elts return [literal_eval(v) for v in values] -else: # Use deprecated CPython compiler module. +else: # Use deprecated CPython2 compiler module. import compiler from compiler.ast import Const, Dict, Expression, Name, Tuple, UnarySub, Keyword # Code from: # http://mail.python.org/pipermail/python-list/2009-September/1219992.html # Modified to use compiler.ast.List as this module has a List def literal_eval(node_or_string): """ - Safely evaluate an expression node or a string containing a Python + Safely evaluate an expression node or a string containing a Python2 expression. The string or node provided may only consist of the - following Python literal structures: strings, numbers, tuples, + following Python2 literal structures: strings, numbers, tuples, lists, dicts, booleans, and None. """ _safe_names = {'None': None, 'True': True, 'False': False} @@ -542,7 +542,7 @@ return False def parse_list(s): - """Parse comma separated string of Python literals. Return a tuple of of + """Parse comma separated string of Python2 literals. Return a tuple of of parsed values.""" try: result = tuple(parse_to_list(s)) @@ -805,7 +805,7 @@ filter_cmd = '"' + found + '"' + mo.group('tail') if found: if cmd.endswith('.py'): - filter_cmd = '"%s" %s' % (document.attributes['python'], + filter_cmd = '"%s" %s' % (document.attributes['python2'], filter_cmd) elif cmd.endswith('.rb'): filter_cmd = 'ruby ' + filter_cmd @@ -4544,13 +4544,13 @@ def init(self, cmd): """ - Check Python version and locate the executable and configuration files + Check Python2 version and locate the executable and configuration files directory. cmd is the asciidoc command or asciidoc.py path. """ - if float(sys.version[:3]) < float(MIN_PYTHON_VERSION): - message.stderr('FAILED: Python %s or better required' % - MIN_PYTHON_VERSION) + if float(sys.version[:3]) < float(MIN_PYTHON2_VERSION): + message.stderr('FAILED: Python2 %s or better required' % + MIN_PYTHON2_VERSION) sys.exit(1) if not os.path.exists(cmd): message.stderr('FAILED: Missing asciidoc command: %s' % cmd) @@ -5904,7 +5904,7 @@ else: raise EAsciiDoc,'missing configuration file: %s' % f try: - document.attributes['python'] = sys.executable + document.attributes['python2'] = sys.executable for f in config.filters: if not config.find_config_dir('filters', f): raise EAsciiDoc,'missing filter: %s' % f