Move data files into the Python package.

The packe directory is now always searched for include files, after
all other directoreis given in $YML_PATH.
Hartmut Goebel 3 years ago
parent c641c0500d
commit e9b4677d0e

@ -15,6 +15,8 @@ from yml2.pyPEG import parse, u
from yml2 import ymlCStyle, comment, oldSyntax
import yml2.backend as backend
YML_DEFAULT_PATH = [os.path.dirname(backend.__file__)]
def printInfo(option, opt_str, value, parser):
sys.stdout.write(__doc__)
sys.exit(0)
@ -58,7 +60,7 @@ try:
if options.includePathText:
backend.includePath = options.includePathText.split(':')
dirs = os.environ.get('YML_PATH', '.').split(':')
dirs = os.environ.get('YML_PATH', '.').split(':') + YML_DEFAULT_PATH
backend.includePath.extend(dirs)
files = fileinput.input(args, mode="rU", openhook=fileinput.hook_encoded(options.encoding))

@ -21,6 +21,8 @@ from yml2 import ymlCStyle, comment, oldSyntax
from yml2.pyPEG import parse, u
import yml2.backend as backend
YML_DEFAULT_PATH = [os.path.dirname(backend.__file__)]
def printInfo(option, opt_str, value, parser):
sys.stdout.write(__doc__)
sys.exit(0)
@ -89,7 +91,7 @@ if options.includePathText:
backend.encoding = options.encoding
dirs = os.environ.get('YML_PATH', '.').split(':')
dirs = os.environ.get('YML_PATH', '.').split(':') + YML_DEFAULT_PATH
backend.includePath.extend(dirs)
if options.xml2yml:

Loading…
Cancel
Save