Browse Source

Mise en place d'un installateur, et déplacement des données dans un endroit portable

Closes #8
pull/20/head
Louis 11 years ago
parent
commit
5d3bbd92f3
  1. 2
      .gitignore
  2. 13
      readme.md
  3. 36
      setup.py
  4. 4
      songbook
  5. 11
      songbook_core/__init__.py
  6. 6
      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. 0
      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

2
.gitignore

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

13
readme.md

@ -1,6 +1,7 @@
Songbook Compilation Chain
# Description
This package provides a compilation toolchain that produce LaTeX
songbook using the LaTeX songs package. A new LaTeX document class is
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
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-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
> <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
http://www.patacrep.com/data/documents/doc_en.pdf
# Contact & Forums
* http://www.patacrep.com
* crep@team-on-fire.com

36
setup.py

@ -0,0 +1,36 @@
#!/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': ['*', '*/*', '*/*/*']},
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
from songbook_core.build import buildsongbook
from songbook_core import __VERSION__
from songbook_core import __STR_VERSION__
from songbook_core import errors
@ -22,7 +22,7 @@ def argument_parser(args):
parser = argparse.ArgumentParser(description="A song book compiler")
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("""\
Book to compile.

11
songbook_core/__init__.py

@ -1,11 +1,14 @@
"""Global variables."""
from pkg_resources import resource_filename
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,
# etc.)
__SHAREDIR__ = os.path.abspath(
os.path.join(os.path.dirname(__file__), "..", "share")
)
__DATADIR__ = os.path.abspath(resource_filename(__name__, 'data'))

6
songbook_core/build.py

@ -11,7 +11,7 @@ import os.path
import re
import subprocess
from songbook_core import __SHAREDIR__
from songbook_core import __DATADIR__
from songbook_core import errors
from songbook_core.files import recursive_find
from songbook_core.index import process_sxd
@ -127,7 +127,7 @@ def make_tex_file(songbook, output):
template = songbook["template"]
del songbook["template"]
else:
template = os.path.join(__SHAREDIR__, "templates", "default.tmpl")
template = os.path.join(__DATADIR__, "templates", "default.tmpl")
if "songs" in songbook:
songs = songbook["songs"]
del songbook["songs"]
@ -256,7 +256,7 @@ def buildsongbook(
if not 'TEXINPUTS' in os.environ.keys():
os.environ['TEXINPUTS'] = ''
os.environ['TEXINPUTS'] += os.pathsep + os.path.join(
__SHAREDIR__,
__DATADIR__,
'latex',
)
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

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

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

Loading…
Cancel
Save