equal
deleted
inserted
replaced
18 sys.exit(1) |
18 sys.exit(1) |
19 |
19 |
20 from yml2 import ymlCStyle, comment, oldSyntax |
20 from yml2 import ymlCStyle, comment, oldSyntax |
21 from yml2.pyPEG import parse, u |
21 from yml2.pyPEG import parse, u |
22 import yml2.backend as backend |
22 import yml2.backend as backend |
|
23 |
|
24 YML_DEFAULT_PATH = [os.path.dirname(backend.__file__)] |
23 |
25 |
24 def printInfo(option, opt_str, value, parser): |
26 def printInfo(option, opt_str, value, parser): |
25 sys.stdout.write(__doc__) |
27 sys.stdout.write(__doc__) |
26 sys.exit(0) |
28 sys.exit(0) |
27 |
29 |
87 if options.includePathText: |
89 if options.includePathText: |
88 backend.includePath = options.includePathText.split(':') |
90 backend.includePath = options.includePathText.split(':') |
89 |
91 |
90 backend.encoding = options.encoding |
92 backend.encoding = options.encoding |
91 |
93 |
92 dirs = os.environ.get('YML_PATH', '.').split(':') |
94 dirs = os.environ.get('YML_PATH', '.').split(':') + YML_DEFAULT_PATH |
93 backend.includePath.extend(dirs) |
95 backend.includePath.extend(dirs) |
94 |
96 |
95 if options.xml2yml: |
97 if options.xml2yml: |
96 for directory in backend.includePath: |
98 for directory in backend.includePath: |
97 name = os.path.join(directory, "xml2yml.ysl2") |
99 name = os.path.join(directory, "xml2yml.ysl2") |