Browse Source

Merge remote-tracking branch 'origin/next' into next-template

Conflicts:
	songbook_core/build.py
pull/15/head
Luthaf 11 years ago
parent
commit
7928a904c5
  1. 2
      .gitignore
  2. 13
      readme.md
  3. 43
      setup.py
  4. 4
      songbook
  5. 11
      songbook_core/__init__.py
  6. 4
      songbook_core/build.py
  7. 0
      songbook_core/data/examples/README
  8. 0
      songbook_core/data/examples/example.sb
  9. 0
      songbook_core/data/examples/img/README
  10. 0
      songbook_core/data/examples/img/treble_a.png
  11. 0
      songbook_core/data/examples/latex/README
  12. 0
      songbook_core/data/examples/songs/README
  13. 0
      songbook_core/data/examples/songs/_lilypond/header
  14. 0
      songbook_core/data/examples/songs/chevaliers_de_la_table_ronde.sg
  15. 0
      songbook_core/data/examples/songs/example-en.sg
  16. 0
      songbook_core/data/examples/songs/example-fr.sg
  17. 0
      songbook_core/data/examples/songs/greensleeves.ly
  18. 0
      songbook_core/data/examples/songs/greensleeves.sg
  19. 0
      songbook_core/data/examples/songs/traditionnel.jpg
  20. 0
      songbook_core/data/examples/songs/vent_frais.sg
  21. 0
      songbook_core/data/examples/templates/README
  22. 0
      songbook_core/data/latex/chords.sty
  23. 2
      songbook_core/data/latex/crepbook.cls
  24. 0
      songbook_core/data/latex/songs.sty
  25. 0
      songbook_core/data/latex/venturisold.sty
  26. 0
      songbook_core/data/latex/xstring.sty
  27. 0
      songbook_core/data/templates/default.tmpl
  28. 19
      songbook_core/index.py

2
.gitignore

@ -1,3 +1,5 @@
deb_dist
build
.gitignore .gitignore
*~ *~
*.aux *.aux

13
readme.md

@ -1,6 +1,7 @@
Songbook Compilation Chain Songbook Compilation Chain
# Description # Description
This package provides a compilation toolchain that produce LaTeX This package provides a compilation toolchain that produce LaTeX
songbook using the LaTeX songs package. A new LaTeX document class is songbook using the LaTeX songs package. A new LaTeX document class is
provided to allow specific customisation and new command like embedded provided to allow specific customisation and new command like embedded
@ -13,7 +14,9 @@ to the CC-BY-SA licence.
Other document are subject to the GNU GPLv2 except if another licence Other document are subject to the GNU GPLv2 except if another licence
is precised in the header. is precised in the header.
# Clone Patacrep repos # Download
Clone Patacrep repos:
> git clone git://github.com/crep4ever/songbook-core.git > git clone git://github.com/crep4ever/songbook-core.git
> git clone git://github.com/crep4ever/songbook-data.git > git clone git://github.com/crep4ever/songbook-data.git
@ -28,10 +31,18 @@ Look for existing songbook files in <songbook-data>/books. For example:
> <songbook-core>/songbook <songbook-data>/books/songbook_en.sb > <songbook-core>/songbook <songbook-data>/books/songbook_en.sb
> <pdfreader> songbook_en.pdf > <pdfreader> songbook_en.pdf
# Quick and dirty deb packages
Install `python-stdeb`, then:
> python setup.py --command-packages=stdeb.command bdist_deb
> sudo dpkg -i deb_dist/python-songbook-core_<version>-1_all.deb
# Documentation # Documentation
http://www.patacrep.com/data/documents/doc_en.pdf http://www.patacrep.com/data/documents/doc_en.pdf
# Contact & Forums # Contact & Forums
* http://www.patacrep.com * http://www.patacrep.com
* crep@team-on-fire.com * crep@team-on-fire.com

43
setup.py

@ -0,0 +1,43 @@
#!/usr/bin/env python
"""Installation script for songbook.
$ python setup.py install
"""
from distutils.core import setup
import songbook_core
setup(name='songbook-core',
version=songbook_core.__STR_VERSION__,
description='Songbook compilation chain',
author='The Songbook team',
author_email='crep@team-on-fire.com',
url='https://github.com/patacrep/songbook-core',
scripts=['songbook'],
license="GPLv2 or any later version",
requires=[
"argparse", "codecs", "distutils", "fnmatch", "glob", "json",
"locale", "logging", "os", "plasTeX", "re", "subprocess", "sys",
"textwrap", "unidecode"
],
packages=['songbook_core'],
package_data={'songbook_core': ['data/latex/*',
'data/templates/*',
'data/examples/*.sb',
'data/examples/*/*.sg',
'data/examples/*/*.ly',
'data/examples/*/*.jpg',
'data/examples/*/*.png',
'data/examples/*/*.png',
'data/examples/*/*/header']},
classifiers=[
"Environment :: Console",
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 2.7",
"Topic :: Utilities",
],
platforms=["GNU/Linux"],
)

4
songbook

@ -13,7 +13,7 @@ import textwrap
import sys import sys
from songbook_core.build import buildsongbook from songbook_core.build import buildsongbook
from songbook_core import __VERSION__ from songbook_core import __STR_VERSION__
from songbook_core import errors from songbook_core import errors
@ -22,7 +22,7 @@ def argument_parser(args):
parser = argparse.ArgumentParser(description="A song book compiler") parser = argparse.ArgumentParser(description="A song book compiler")
parser.add_argument('--version', help='Show version', action='version', parser.add_argument('--version', help='Show version', action='version',
version='%(prog)s ' + __VERSION__) version='%(prog)s ' + __STR_VERSION__)
parser.add_argument('book', nargs=1, help=textwrap.dedent("""\ parser.add_argument('book', nargs=1, help=textwrap.dedent("""\
Book to compile. Book to compile.

11
songbook_core/__init__.py

@ -1,11 +1,14 @@
"""Global variables.""" """Global variables."""
from pkg_resources import resource_filename
import os import os
__VERSION__ = "3.7.2" # Version
__VERSION__ = (3, 7, 2)
__STR_VERSION__ = '.'.join([str(number) for number in __VERSION__])
# Directory containing shared data (default templates, custom LaTeX packages, # Directory containing shared data (default templates, custom LaTeX packages,
# etc.) # etc.)
__SHAREDIR__ = os.path.abspath(
os.path.join(os.path.dirname(__file__), "..", "share") __DATADIR__ = os.path.abspath(resource_filename(__name__, 'data'))
)

4
songbook_core/build.py

@ -11,7 +11,7 @@ import os.path
import re import re
import subprocess import subprocess
from songbook_core import __SHAREDIR__ from songbook_core import __DATADIR__
from songbook_core import errors from songbook_core import errors
from songbook_core.files import recursive_find from songbook_core.files import recursive_find
from songbook_core.index import process_sxd from songbook_core.index import process_sxd
@ -306,7 +306,7 @@ def buildsongbook(
if not 'TEXINPUTS' in os.environ.keys(): if not 'TEXINPUTS' in os.environ.keys():
os.environ['TEXINPUTS'] = '' os.environ['TEXINPUTS'] = ''
os.environ['TEXINPUTS'] += os.pathsep + os.path.join( os.environ['TEXINPUTS'] += os.pathsep + os.path.join(
__SHAREDIR__, __DATADIR__,
'latex', 'latex',
) )
os.environ['TEXINPUTS'] += os.pathsep + os.path.join( os.environ['TEXINPUTS'] += os.pathsep + os.path.join(

0
share/examples/README → songbook_core/data/examples/README

0
share/examples/example.sb → songbook_core/data/examples/example.sb

0
share/examples/img/README → songbook_core/data/examples/img/README

0
share/examples/img/treble_a.png → songbook_core/data/examples/img/treble_a.png

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

0
share/examples/latex/README → songbook_core/data/examples/latex/README

0
share/examples/songs/README → songbook_core/data/examples/songs/README

0
share/examples/songs/_lilypond/header → songbook_core/data/examples/songs/_lilypond/header

0
share/examples/songs/chevaliers_de_la_table_ronde.sg → songbook_core/data/examples/songs/chevaliers_de_la_table_ronde.sg

0
share/examples/songs/example-en.sg → songbook_core/data/examples/songs/example-en.sg

0
share/examples/songs/example-fr.sg → songbook_core/data/examples/songs/example-fr.sg

0
share/examples/songs/greensleeves.ly → songbook_core/data/examples/songs/greensleeves.ly

0
share/examples/songs/greensleeves.sg → songbook_core/data/examples/songs/greensleeves.sg

0
share/examples/songs/traditionnel.jpg → songbook_core/data/examples/songs/traditionnel.jpg

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

0
share/examples/songs/vent_frais.sg → songbook_core/data/examples/songs/vent_frais.sg

0
share/examples/templates/README → songbook_core/data/examples/templates/README

0
share/latex/chords.sty → songbook_core/data/latex/chords.sty

2
share/latex/crepbook.cls → songbook_core/data/latex/crepbook.cls

@ -310,7 +310,7 @@
\fi% \fi%
% On-the-fly compilation of lilypond files % On-the-fly compilation of lilypond files
\epstopdfDeclareGraphicsRule{.ly}{pdf}{.pdf}{lilypond --format=pdf -e '(define-public songbookstaff "")' --output=\Gin@base\ETE@suffix\space #1} \epstopdfDeclareGraphicsRule{.ly}{pdf}{.pdf}{lilypond --format=pdf --output=\Gin@base\ETE@suffix\space #1}
\AppendGraphicsExtensions{.ly} \AppendGraphicsExtensions{.ly}
\newcommand{\lilypond}[1]{% \newcommand{\lilypond}[1]{%

0
share/latex/songs.sty → songbook_core/data/latex/songs.sty

0
share/latex/venturisold.sty → songbook_core/data/latex/venturisold.sty

0
share/latex/xstring.sty → songbook_core/data/latex/xstring.sty

0
share/templates/default.tmpl → songbook_core/data/templates/default.tmpl

19
songbook_core/index.py

@ -163,23 +163,14 @@ class Index(object):
@staticmethod @staticmethod
def ref_to_str(ref): def ref_to_str(ref):
"""Return the LaTeX code corresponding to the reference.""" """Return the LaTeX code corresponding to the reference."""
if sys.version_info >= (2, 6): return r'\hyperlink{{{0[link]}}}{{{0[num]}}}'.format(ref)
return r'\hyperlink{{{0[link]}}}{{{0[num]}}}'.format(ref)
else:
return r'\hyperlink{%(link)s}{%(num)s}' % ref
def entry_to_str(self, key, entry): def entry_to_str(self, key, entry):
"""Return the LaTeX code corresponding to the entry.""" """Return the LaTeX code corresponding to the entry."""
if sys.version_info >= (2, 6): return unicode(r'\idxentry{{{0}}}{{{1}}}' + EOL).format(
return unicode(r'\idxentry{{{0}}}{{{1}}}' + EOL).format( key,
key, r'\\'.join([self.ref_to_str(ref) for ref in entry]),
r'\\'.join([self.ref_to_str(ref) for ref in entry]), )
)
else:
return unicode(r'\idxentry{%s}{%s}' + EOL) % (
key,
r'\\'.join([self.ref_to_str(ref) for ref in entry]),
)
def idxblock_to_str(self, letter, entries): def idxblock_to_str(self, letter, entries):
"""Return the LaTeX code corresponding to an index block. """Return the LaTeX code corresponding to an index block.

Loading…
Cancel
Save