From 696e598611decb1e63ac4e8762733c2b3255b565 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 17 2020 22:12:54 +0000 Subject: Changes after running %prep ignore: true --- diff --git a/a2x.py b/a2x.py index cf0af2e..6ecac17 100755 --- a/a2x.py +++ b/a2x.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/libexec/platform-python ''' a2x - A toolchain manager for AsciiDoc (converts Asciidoc text files to other file formats) diff --git a/asciidoc.py b/asciidoc.py index 2230193..ec38e73 100755 --- a/asciidoc.py +++ b/asciidoc.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/libexec/platform-python """ asciidoc - converts an AsciiDoc text file to HTML or DocBook diff --git a/asciidocapi.py b/asciidocapi.py index d831f95..aabee06 100644 --- a/asciidocapi.py +++ b/asciidocapi.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/libexec/platform-python """ asciidocapi - AsciiDoc API wrapper class. diff --git a/doc/asciidoc.dict b/doc/asciidoc.dict index 2abb0f5..78d7ba5 100644 --- a/doc/asciidoc.dict +++ b/doc/asciidoc.dict @@ -182,7 +182,7 @@ footnoteref joe velit truecolor -p�re +père pere purus iso @@ -355,7 +355,7 @@ pgwide RevisionDate crlf tex -B�lido +Bólido Bolido tabsize colpcwidth @@ -429,7 +429,7 @@ EPUBReader Xin params undefines -Andr�s +Andrés yellowback Quisque Fabrice @@ -440,7 +440,7 @@ Citeaux themedir srackham Lulea -Lule� +Luleå Ubuntu xml XSLTLib @@ -551,7 +551,7 @@ linuxdoc tt Hackett VM -Fr�d�rique +Frédérique SidebarBlock wj ut @@ -676,7 +676,7 @@ libxml tablepcwidth chunked filesystem -Mart�n +Martín popen iconsdir toolchains @@ -724,7 +724,7 @@ symlink ascii ListLabel Kleber -Kl�ber +Kléber popup Cerrito DocBook's @@ -920,7 +920,7 @@ sectnum BlockMacros cceeff unfloat -snabbk�p +snabbköp snabbkop NumberedList everti @@ -972,7 +972,7 @@ loweralpha subdirectory consectetuer bookmarked -G�mez +Gómez Kubuntu LaTeX litora @@ -999,7 +999,7 @@ undefining viewport leveloffset CustomBlock -Kr�mer +Krämer BufRead specialwords libexslt @@ -1028,7 +1028,7 @@ else's preparadas scriptsdir syntaxes -R�sten +Røsten rowspan headrows charset @@ -1042,7 +1042,7 @@ Freshmeat dbhtml manversion TableBody -Lo�c +Loïc abc aliquam llevar @@ -1059,7 +1059,7 @@ datadir Kumar IndentedParagraphs Berguvsvagen -Berguvsv�gen +Berguvsvägen executables tabledef ftdetect diff --git a/examples/website/asciidoc-website.dict b/examples/website/asciidoc-website.dict index 1ae7d51..f872548 100644 --- a/examples/website/asciidoc-website.dict +++ b/examples/website/asciidoc-website.dict @@ -63,7 +63,7 @@ Zuckschwerdt SGML raggedright uri -R�sten +Røsten upperroman Slackware CouchDB @@ -105,7 +105,7 @@ doctests backends Gingras sinx -Rom� +Romé multi autoconf Dmitry diff --git a/filters/code/code-filter.py b/filters/code/code-filter.py index 83693b7..92e4e9e 100755 --- a/filters/code/code-filter.py +++ b/filters/code/code-filter.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/libexec/platform-python ''' NAME code-filter - AsciiDoc filter to highlight language keywords diff --git a/filters/graphviz/graphviz2png.py b/filters/graphviz/graphviz2png.py index 07b25a8..d2e438f 100755 --- a/filters/graphviz/graphviz2png.py +++ b/filters/graphviz/graphviz2png.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/libexec/platform-python import os, sys, subprocess from optparse import * diff --git a/filters/latex/latex2img.py b/filters/latex/latex2img.py index 8e03614..033d720 100755 --- a/filters/latex/latex2img.py +++ b/filters/latex/latex2img.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/libexec/platform-python ''' NAME latex2img - Converts LaTeX source to PNG or SVG file diff --git a/filters/music/music-filter-test.txt b/filters/music/music-filter-test.txt deleted file mode 100644 index c1886bd..0000000 --- a/filters/music/music-filter-test.txt +++ /dev/null @@ -1,40 +0,0 @@ -Music Filter Test -================= - -Details of the filter can be found in `./doc/music-filter.txt`. - - -A tune generated from ABC notation ----------------------------------- - -[music,music1.png] ---------------------------------------------------------------------- -T:The Butterfly -R:slip jig -C:Tommy Potts -H:Fiddle player Tommy Potts made this tune from two older slip jigs, -H:one of which is called "Skin the Peelers" in Roche's collection. -D:Bothy Band: 1975. -M:9/8 -K:Em -vB2(E G2)(E F3)|B2(E G2)(E F)ED|vB2(E G2)(E F3)|(B2d) d2(uB A)FD:| -|:(vB2c) (e2f) g3|(uB2d) (g2e) (dBA)|(B2c) (e2f) g2(ua|b2a) (g2e) (dBA):| -|:~B3 (B2A) G2A|~B3 BA(uB d)BA|~B3 (B2A) G2(A|B2d) (g2e) (dBA):| ---------------------------------------------------------------------- - - -A fragment generated from LilyPond source ------------------------------------------- - -["music", "music2.png", "ly", link="music2.ly"] ---------------------------------------------------------------------- -\version "2.10.0" -\paper { - ragged-right = ##t -} -{ - \time 3/4 - \clef bass - c2 e4 g2. f4 e d c2 r4 -} ---------------------------------------------------------------------- diff --git a/filters/music/music-filter.conf b/filters/music/music-filter.conf deleted file mode 100644 index eaafe97..0000000 --- a/filters/music/music-filter.conf +++ /dev/null @@ -1,42 +0,0 @@ -# -# AsciiDoc music filter configuration file. -# -# Documented in music-filter.txt in AsciiDoc distribution -# ./examples/website/ directory. -# - -[music-filter-style] - -# When the filter output image is data-uri encoded write it to the indir -# (instead of the outdir) so that encoder can find it. -ifndef::data-uri[] -music-style=template="music-block",subs=(),posattrs=("style","target","format"),filter='music2png.py -m{verbose? -v}{format? -f {format}} -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -' -endif::data-uri[] -ifdef::data-uri[] -music-style=template="music-block",subs=(),posattrs=("style","target","format"),filter='music2png.py -m{verbose? -v}{format? -f {format}} -o "{indir={outdir}}/{imagesdir=}{imagesdir?/}{target}" -' -endif::data-uri[] - -[blockdef-open] -template::[music-filter-style] - -[blockdef-listing] -template::[music-filter-style] - -[paradef-default] -template::[music-filter-style] - -[music-block] -template::[filter-image-blockmacro] - -# -# DEPRECATED: Pre 8.2.7 filter definition. -# -[blockdef-music] -delimiter=^music~{4,}$ -template=music-block -presubs=none -filter=music2png.py{verbose? -v} -f {format=abc} -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" - -posattrs=target,format -# -# DEPRECATED: End -# diff --git a/filters/music/music2png.py b/filters/music/music2png.py deleted file mode 100755 index 185137c..0000000 --- a/filters/music/music2png.py +++ /dev/null @@ -1,208 +0,0 @@ -#!/usr/bin/env python3 -''' -NAME - music2png - Converts textual music notation to classically notated PNG file - -SYNOPSIS - music2png [options] INFILE - -DESCRIPTION - This filter reads LilyPond or ABC music notation text from the input file - INFILE (or stdin if INFILE is -), converts it to classical music notation - and writes it to a trimmed PNG image file. - - This script is a wrapper for LilyPond and ImageMagick commands. - -OPTIONS - -f FORMAT - The INFILE music format. 'abc' for ABC notation, 'ly' for LilyPond - notation. Defaults to 'abc' unless source starts with backslash. - - -o OUTFILE - The file name of the output file. If not specified the output file is - named like INFILE but with a .png file name extension. - - -m - Skip if the PNG output file is newer that than the INFILE. - Compares timestamps on INFILE and OUTFILE. If - INFILE is - (stdin) then compares MD5 checksum stored in file - named like OUTFILE but with a .md5 file name extension. - The .md5 file is created if the -m option is used and the - INFILE is - (stdin). - - -v - Verbosely print processing information to stderr. - - --help, -h - Print this documentation. - - --version - Print program version number. - -SEE ALSO - lilypond(1), abc2ly(1), convert(1) - -AUTHOR - Written by Stuart Rackham, - -COPYING - Copyright (C) 2006 Stuart Rackham. Free use of this software is - granted under the terms of the GNU General Public License (GPL). -''' - -import os, sys, tempfile -from hashlib import md5 - -VERSION = '0.1.2' - -# Globals. -verbose = False - -class EApp(Exception): pass # Application specific exception. - -def print_stderr(line): - sys.stderr.write(line + os.linesep) - -def print_verbose(line): - if verbose: - print_stderr(line) - -def write_file(filename, data, mode='w', encoding='utf-8'): - if 'b' in mode: - encoding = None - with open(filename, mode, encoding=encoding) as f: - f.write(data) - -def read_file(filename, mode='r', encoding='utf-8'): - if 'b' in mode: - encoding = None - with open(filename, mode, encoding=encoding) as f: - return f.read() - -def run(cmd): - global verbose - if not verbose: - cmd += ' 2>%s' % os.devnull - print_verbose('executing: %s' % cmd) - if os.system(cmd): - raise EApp('failed command: %s' % cmd) - -def music2png(format, infile, outfile, modified): - '''Convert ABC notation in file infile to cropped PNG file named outfile.''' - outfile = os.path.abspath(outfile) - outdir = os.path.dirname(outfile) - if not os.path.isdir(outdir): - raise EApp('directory does not exist: %s' % outdir) - basefile = tempfile.mktemp(dir=os.path.dirname(outfile)) - temps = [basefile + ext for ext in ('.abc', '.ly', '.ps', '.midi')] - skip = False - if infile == '-': - source = sys.stdin.read() - checksum = md5(source.encode('utf-8')).digest() - filename = os.path.splitext(outfile)[0] + '.md5' - if modified: - if os.path.isfile(filename) and os.path.isfile(outfile) and \ - checksum == read_file(filename,'rb'): - skip = True - else: - write_file(filename, checksum, 'wb') - else: - if not os.path.isfile(infile): - raise EApp('input file does not exist: %s' % infile) - if modified and os.path.isfile(outfile) and \ - os.path.getmtime(infile) <= os.path.getmtime(outfile): - skip = True - source = read_file(infile) - if skip: - print_verbose('skipped: no change: %s' % outfile) - return - if format is None: - if source and source.startswith('\\'): # Guess input format. - format = 'ly' - else: - format = 'abc' - # Write temporary source file. - write_file('%s.%s' % (basefile,format), source) - abc = basefile + '.abc' - ly = basefile + '.ly' - png = basefile + '.png' - saved_pwd = os.getcwd() - os.chdir(outdir) - try: - if format == 'abc': - run('abc2ly -o "%s" "%s"' % (ly,abc)) - run('lilypond --png -o "%s" "%s"' % (basefile,ly)) - os.rename(png, outfile) - finally: - os.chdir(saved_pwd) - # Chop the bottom 75 pixels off to get rid of the page footer then crop the - # music image. The -strip option necessary because FOP does not like the - # custom PNG color profile used by Lilypond. - run('convert "%s" -strip -gravity South -chop 0x75 -trim "%s"' % (outfile, outfile)) - for f in temps: - if os.path.isfile(f): - print_verbose('deleting: %s' % f) - os.remove(f) - -def usage(msg=''): - if msg: - print_stderr(msg) - print_stderr('\n' - 'usage:\n' - ' music2png [options] INFILE\n' - '\n' - 'options:\n' - ' -f FORMAT\n' - ' -o OUTFILE\n' - ' -m\n' - ' -v\n' - ' --help\n' - ' --version') - -def main(): - # Process command line options. - global verbose - format = None - outfile = None - modified = False - import getopt - opts,args = getopt.getopt(sys.argv[1:], 'f:o:mhv', ['help','version']) - for o,v in opts: - if o in ('--help','-h'): - print(__doc__) - sys.exit(0) - if o =='--version': - print(('music2png version %s' % (VERSION,))) - sys.exit(0) - if o == '-f': format = v - if o == '-o': outfile = v - if o == '-m': modified = True - if o == '-v': verbose = True - if len(args) != 1: - usage() - sys.exit(1) - infile = args[0] - if format not in (None, 'abc', 'ly'): - usage('invalid FORMAT') - sys.exit(1) - if outfile is None: - if infile == '-': - usage('OUTFILE must be specified') - sys.exit(1) - outfile = os.path.splitext(infile)[0] + '.png' - # Do the work. - music2png(format, infile, outfile, modified) - # Print something to suppress asciidoc 'no output from filter' warnings. - if infile == '-': - sys.stdout.write(' ') - -if __name__ == "__main__": - try: - main() - except SystemExit: - raise - except KeyboardInterrupt: - sys.exit(1) - except Exception as e: - print_stderr("%s: %s" % (os.path.basename(sys.argv[0]), str(e))) - sys.exit(1) diff --git a/filters/unwraplatex.py b/filters/unwraplatex.py index f832db8..4d4ff48 100755 --- a/filters/unwraplatex.py +++ b/filters/unwraplatex.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/libexec/platform-python ''' NAME unwraplatex - Removes delimiters from LaTeX source text diff --git a/tests/testasciidoc.py b/tests/testasciidoc.py index 86e544c..5db786d 100755 --- a/tests/testasciidoc.py +++ b/tests/testasciidoc.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/libexec/platform-python USAGE = '''Usage: testasciidoc.py [OPTIONS] COMMAND