diff options
author | Stuart Rackham <srackham@methods.co.nz> | 2011-03-22 11:46:56 +1300 |
---|---|---|
committer | Stuart Rackham <srackham@methods.co.nz> | 2011-03-22 11:46:56 +1300 |
commit | ee76b956e90a1a24bda09561d74fe20931089c57 (patch) | |
tree | b1b167e46678e2f6d28faade55a6b22309230b7e /a2x.py | |
parent | 1cc90931f32a4c8af26295c9670f73e122dc72f0 (diff) | |
download | asciidoc-ee76b956e90a1a24bda09561d74fe20931089c57.tar.gz |
- a2x: allow environment variables and tilda home directories in resouce
manifest files.
- a2x: don't process non-existent resource directories.
Diffstat (limited to 'a2x.py')
-rwxr-xr-x | a2x.py | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -420,6 +420,8 @@ class A2X(AttrDict): for r in open(self.resource_manifest): self.resources.append(r.strip()) for r in self.resources: + r = os.path.expanduser(r) + r = os.path.expandvars(r) if r.endswith(('/','\\')): if os.path.isdir(r): self.resource_dirs.append(r) @@ -432,7 +434,11 @@ class A2X(AttrDict): # Lastly search among images and stylesheets distributed with asciidoc. for p in (os.path.dirname(self.asciidoc), CONF_DIR): for d in ('images','stylesheets'): - self.resource_dirs.append(os.path.join(p,d)) + d = os.path.join(p,d) + if os.path.isdir(d): + self.resource_dirs.append(d) + verbose('resource files: %s' % self.resource_files) + verbose('resource directories: %s' % self.resource_dirs) if not self.doctype and self.format == 'manpage': self.doctype = 'manpage' if self.doctype: |