Browse Source

Change the package_data location

pull/149/head
Oliverpool 9 years ago
parent
commit
2dc3b67e2b
  1. 7
      patacrep/__init__.py
  2. 0
      patacrep/data/ast_templates/chordpro/chordpro/content_chord
  3. 0
      patacrep/data/ast_templates/chordpro/chordpro/content_chordlist
  4. 0
      patacrep/data/ast_templates/chordpro/chordpro/content_comment
  5. 0
      patacrep/data/ast_templates/chordpro/chordpro/content_define
  6. 0
      patacrep/data/ast_templates/chordpro/chordpro/content_endofline
  7. 0
      patacrep/data/ast_templates/chordpro/chordpro/content_error
  8. 0
      patacrep/data/ast_templates/chordpro/chordpro/content_guitar_comment
  9. 0
      patacrep/data/ast_templates/chordpro/chordpro/content_image
  10. 0
      patacrep/data/ast_templates/chordpro/chordpro/content_line
  11. 0
      patacrep/data/ast_templates/chordpro/chordpro/content_newline
  12. 0
      patacrep/data/ast_templates/chordpro/chordpro/content_partition
  13. 0
      patacrep/data/ast_templates/chordpro/chordpro/content_space
  14. 0
      patacrep/data/ast_templates/chordpro/chordpro/content_tablature
  15. 0
      patacrep/data/ast_templates/chordpro/chordpro/content_verse
  16. 0
      patacrep/data/ast_templates/chordpro/chordpro/content_word
  17. 0
      patacrep/data/ast_templates/chordpro/chordpro/song
  18. 0
      patacrep/data/ast_templates/chordpro/chordpro/song_body
  19. 0
      patacrep/data/ast_templates/chordpro/chordpro/song_header
  20. 0
      patacrep/data/ast_templates/chordpro/html/content_chord
  21. 0
      patacrep/data/ast_templates/chordpro/html/content_chordlist
  22. 0
      patacrep/data/ast_templates/chordpro/html/content_comment
  23. 0
      patacrep/data/ast_templates/chordpro/html/content_define
  24. 0
      patacrep/data/ast_templates/chordpro/html/content_define_list
  25. 0
      patacrep/data/ast_templates/chordpro/html/content_endofline
  26. 0
      patacrep/data/ast_templates/chordpro/html/content_error
  27. 0
      patacrep/data/ast_templates/chordpro/html/content_guitar_comment
  28. 0
      patacrep/data/ast_templates/chordpro/html/content_image
  29. 0
      patacrep/data/ast_templates/chordpro/html/content_line
  30. 0
      patacrep/data/ast_templates/chordpro/html/content_metadata_cover
  31. 0
      patacrep/data/ast_templates/chordpro/html/content_newline
  32. 0
      patacrep/data/ast_templates/chordpro/html/content_partition
  33. 0
      patacrep/data/ast_templates/chordpro/html/content_space
  34. 0
      patacrep/data/ast_templates/chordpro/html/content_tablature
  35. 0
      patacrep/data/ast_templates/chordpro/html/content_verse
  36. 0
      patacrep/data/ast_templates/chordpro/html/content_word
  37. 0
      patacrep/data/ast_templates/chordpro/html/song
  38. 0
      patacrep/data/ast_templates/chordpro/html/song_body
  39. 0
      patacrep/data/ast_templates/chordpro/html/song_header
  40. 0
      patacrep/data/ast_templates/chordpro/latex/content_chord
  41. 0
      patacrep/data/ast_templates/chordpro/latex/content_chordlist
  42. 0
      patacrep/data/ast_templates/chordpro/latex/content_comment
  43. 0
      patacrep/data/ast_templates/chordpro/latex/content_define
  44. 0
      patacrep/data/ast_templates/chordpro/latex/content_endofline
  45. 0
      patacrep/data/ast_templates/chordpro/latex/content_error
  46. 0
      patacrep/data/ast_templates/chordpro/latex/content_guitar_comment
  47. 0
      patacrep/data/ast_templates/chordpro/latex/content_image
  48. 0
      patacrep/data/ast_templates/chordpro/latex/content_line
  49. 0
      patacrep/data/ast_templates/chordpro/latex/content_newline
  50. 0
      patacrep/data/ast_templates/chordpro/latex/content_partition
  51. 0
      patacrep/data/ast_templates/chordpro/latex/content_space
  52. 0
      patacrep/data/ast_templates/chordpro/latex/content_tablature
  53. 0
      patacrep/data/ast_templates/chordpro/latex/content_verse
  54. 0
      patacrep/data/ast_templates/chordpro/latex/content_word
  55. 0
      patacrep/data/ast_templates/chordpro/latex/song
  56. 0
      patacrep/data/ast_templates/chordpro/latex/song_body
  57. 5
      patacrep/songs/chordpro/__init__.py
  58. 7
      setup.py

7
patacrep/__init__.py

@ -16,4 +16,9 @@ __version__ = '.'.join([str(number) for number in __TUPLE_VERSION__])
# Directory containing shared data (default templates, custom LaTeX packages, # Directory containing shared data (default templates, custom LaTeX packages,
# etc.) # etc.)
__DATADIR__ = os.path.abspath(resource_filename(__name__, 'data')) _ROOT = os.path.abspath(resource_filename(__name__, 'data'))
def pkg_datapath(path=''):
"""Return the package data path"""
return os.path.join(_ROOT, path)
__DATADIR__ = os.path.abspath(pkg_datapath())

0
patacrep/songs/chordpro/data/chordpro/content_chord → patacrep/data/ast_templates/chordpro/chordpro/content_chord

0
patacrep/songs/chordpro/data/chordpro/content_chordlist → patacrep/data/ast_templates/chordpro/chordpro/content_chordlist

0
patacrep/songs/chordpro/data/chordpro/content_comment → patacrep/data/ast_templates/chordpro/chordpro/content_comment

0
patacrep/songs/chordpro/data/chordpro/content_define → patacrep/data/ast_templates/chordpro/chordpro/content_define

0
patacrep/songs/chordpro/data/chordpro/content_endofline → patacrep/data/ast_templates/chordpro/chordpro/content_endofline

0
patacrep/songs/chordpro/data/chordpro/content_error → patacrep/data/ast_templates/chordpro/chordpro/content_error

0
patacrep/songs/chordpro/data/chordpro/content_guitar_comment → patacrep/data/ast_templates/chordpro/chordpro/content_guitar_comment

0
patacrep/songs/chordpro/data/chordpro/content_image → patacrep/data/ast_templates/chordpro/chordpro/content_image

0
patacrep/songs/chordpro/data/chordpro/content_line → patacrep/data/ast_templates/chordpro/chordpro/content_line

0
patacrep/songs/chordpro/data/chordpro/content_newline → patacrep/data/ast_templates/chordpro/chordpro/content_newline

0
patacrep/songs/chordpro/data/chordpro/content_partition → patacrep/data/ast_templates/chordpro/chordpro/content_partition

0
patacrep/songs/chordpro/data/chordpro/content_space → patacrep/data/ast_templates/chordpro/chordpro/content_space

0
patacrep/songs/chordpro/data/chordpro/content_tablature → patacrep/data/ast_templates/chordpro/chordpro/content_tablature

0
patacrep/songs/chordpro/data/chordpro/content_verse → patacrep/data/ast_templates/chordpro/chordpro/content_verse

0
patacrep/songs/chordpro/data/chordpro/content_word → patacrep/data/ast_templates/chordpro/chordpro/content_word

0
patacrep/songs/chordpro/data/chordpro/song → patacrep/data/ast_templates/chordpro/chordpro/song

0
patacrep/songs/chordpro/data/chordpro/song_body → patacrep/data/ast_templates/chordpro/chordpro/song_body

0
patacrep/songs/chordpro/data/chordpro/song_header → patacrep/data/ast_templates/chordpro/chordpro/song_header

0
patacrep/songs/chordpro/data/html/content_chord → patacrep/data/ast_templates/chordpro/html/content_chord

0
patacrep/songs/chordpro/data/html/content_chordlist → patacrep/data/ast_templates/chordpro/html/content_chordlist

0
patacrep/songs/chordpro/data/html/content_comment → patacrep/data/ast_templates/chordpro/html/content_comment

0
patacrep/songs/chordpro/data/html/content_define → patacrep/data/ast_templates/chordpro/html/content_define

0
patacrep/songs/chordpro/data/html/content_define_list → patacrep/data/ast_templates/chordpro/html/content_define_list

0
patacrep/songs/chordpro/data/html/content_endofline → patacrep/data/ast_templates/chordpro/html/content_endofline

0
patacrep/songs/chordpro/data/html/content_error → patacrep/data/ast_templates/chordpro/html/content_error

0
patacrep/songs/chordpro/data/html/content_guitar_comment → patacrep/data/ast_templates/chordpro/html/content_guitar_comment

0
patacrep/songs/chordpro/data/html/content_image → patacrep/data/ast_templates/chordpro/html/content_image

0
patacrep/songs/chordpro/data/html/content_line → patacrep/data/ast_templates/chordpro/html/content_line

0
patacrep/songs/chordpro/data/html/content_metadata_cover → patacrep/data/ast_templates/chordpro/html/content_metadata_cover

0
patacrep/songs/chordpro/data/html/content_newline → patacrep/data/ast_templates/chordpro/html/content_newline

0
patacrep/songs/chordpro/data/html/content_partition → patacrep/data/ast_templates/chordpro/html/content_partition

0
patacrep/songs/chordpro/data/html/content_space → patacrep/data/ast_templates/chordpro/html/content_space

0
patacrep/songs/chordpro/data/html/content_tablature → patacrep/data/ast_templates/chordpro/html/content_tablature

0
patacrep/songs/chordpro/data/html/content_verse → patacrep/data/ast_templates/chordpro/html/content_verse

0
patacrep/songs/chordpro/data/html/content_word → patacrep/data/ast_templates/chordpro/html/content_word

0
patacrep/songs/chordpro/data/html/song → patacrep/data/ast_templates/chordpro/html/song

0
patacrep/songs/chordpro/data/html/song_body → patacrep/data/ast_templates/chordpro/html/song_body

0
patacrep/songs/chordpro/data/html/song_header → patacrep/data/ast_templates/chordpro/html/song_header

0
patacrep/songs/chordpro/data/latex/content_chord → patacrep/data/ast_templates/chordpro/latex/content_chord

0
patacrep/songs/chordpro/data/latex/content_chordlist → patacrep/data/ast_templates/chordpro/latex/content_chordlist

0
patacrep/songs/chordpro/data/latex/content_comment → patacrep/data/ast_templates/chordpro/latex/content_comment

0
patacrep/songs/chordpro/data/latex/content_define → patacrep/data/ast_templates/chordpro/latex/content_define

0
patacrep/songs/chordpro/data/latex/content_endofline → patacrep/data/ast_templates/chordpro/latex/content_endofline

0
patacrep/songs/chordpro/data/latex/content_error → patacrep/data/ast_templates/chordpro/latex/content_error

0
patacrep/songs/chordpro/data/latex/content_guitar_comment → patacrep/data/ast_templates/chordpro/latex/content_guitar_comment

0
patacrep/songs/chordpro/data/latex/content_image → patacrep/data/ast_templates/chordpro/latex/content_image

0
patacrep/songs/chordpro/data/latex/content_line → patacrep/data/ast_templates/chordpro/latex/content_line

0
patacrep/songs/chordpro/data/latex/content_newline → patacrep/data/ast_templates/chordpro/latex/content_newline

0
patacrep/songs/chordpro/data/latex/content_partition → patacrep/data/ast_templates/chordpro/latex/content_partition

0
patacrep/songs/chordpro/data/latex/content_space → patacrep/data/ast_templates/chordpro/latex/content_space

0
patacrep/songs/chordpro/data/latex/content_tablature → patacrep/data/ast_templates/chordpro/latex/content_tablature

0
patacrep/songs/chordpro/data/latex/content_verse → patacrep/data/ast_templates/chordpro/latex/content_verse

0
patacrep/songs/chordpro/data/latex/content_word → patacrep/data/ast_templates/chordpro/latex/content_word

0
patacrep/songs/chordpro/data/latex/song → patacrep/data/ast_templates/chordpro/latex/song

0
patacrep/songs/chordpro/data/latex/song_body → patacrep/data/ast_templates/chordpro/latex/song_body

5
patacrep/songs/chordpro/__init__.py

@ -5,9 +5,8 @@ import jinja2
import logging import logging
import operator import operator
import os import os
from pkg_resources import resource_filename
from patacrep import encoding, files from patacrep import encoding, files, pkg_datapath
from patacrep.songs import Song from patacrep.songs import Song
from patacrep.songs.chordpro.syntax import parse_song from patacrep.songs.chordpro.syntax import parse_song
from patacrep.templates import Renderer from patacrep.templates import Renderer
@ -53,7 +52,7 @@ class ChordproSong(Song):
self.get_datadirs(os.path.join("templates", self.output_language)) self.get_datadirs(os.path.join("templates", self.output_language))
), ),
FileSystemLoader( FileSystemLoader(
os.path.join(resource_filename(__name__, 'data'), self.output_language) os.path.join(pkg_datapath('ast_templates'), 'chordpro', self.output_language)
), ),
])) ]))
jinjaenv.filters['search_image'] = self.search_image jinjaenv.filters['search_image'] = self.search_image

7
setup.py

@ -21,7 +21,12 @@ setup(
"unidecode", "jinja2", "chardet", "ply", "unidecode", "jinja2", "chardet", "ply",
], ],
setup_requires=["hgtools"], setup_requires=["hgtools"],
include_package_data=True, package_data={'patacrep': [
'data/ast_templates/*/*/*',
'data/img/*',
'data/latex/*',
'data/templates/*',
]},
entry_points={ entry_points={
'console_scripts': [ 'console_scripts': [
"songbook = patacrep.songbook.__main__:main", "songbook = patacrep.songbook.__main__:main",

Loading…
Cancel
Save