Skip to content

Commit

Permalink
Fixed evaluation of paths specifed in CLI and processing attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmacmackin committed Jul 27, 2016
1 parent aa3a985 commit 22ec6d9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
15 changes: 6 additions & 9 deletions ford/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
__author__ = "Chris MacMackin, Jacob Williams, Marco Restelli, Iain Barrass, Jérémie Burgalat, Stephen J. Turnbull, Balint Aradi"
__credits__ = ["Stefano Zhagi", "Izaak Beekman", "Gavin Huttley"]
__license__ = "GPLv3"
__version__ = "5.0.2"
__version__ = "5.0.3"
__maintainer__ = "Chris MacMackin"
__status__ = "Production"

Expand Down Expand Up @@ -185,6 +185,11 @@ def initialize():
listopts = ['extensions','fpp_extensions','fixed_extensions','display',
'extra_vartypes','src_dir','exclude','exclude_dir',
'macro','include','extra_mods','extra_filetypes']
# Evaluate paths relative to project file location
base_dir = os.path.abspath(os.path.dirname(args.project_file.name))
for var in ['src_dir','page_dir','output_dir','exclude_dir','graph_dir','media_dir','include']:
if var in proj_data:
proj_data[var] = [os.path.normpath(os.path.join(base_dir,os.path.expanduser(os.path.expandvars(p)))) for p in proj_data[var]]
if args.warn:
args.warn = 'true'
else:
Expand Down Expand Up @@ -261,14 +266,6 @@ def initialize():
</script>
<script src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer></script>
'''.format(proj_data['gitter_sidecar'].strip())
# Evaluate paths relative to project file location
base_dir = os.path.abspath(os.path.dirname(args.project_file.name))
for var in ['src_dir','page_dir','output_dir','exclude_dir','graph_dir','media_dir','include']:
if var in proj_data:
if var in listopts:
proj_data[var] = [os.path.normpath(os.path.join(base_dir,os.path.expanduser(os.path.expandvars(p)))) for p in proj_data[var]]
else:
proj_data[var] = os.path.normpath(os.path.join(base_dir,os.path.expanduser(os.path.expandvars(proj_data[var]))))
# Handle preprocessor:
if proj_data['preprocess'].lower() == 'true':
if proj_data['preprocessor']:
Expand Down
1 change: 0 additions & 1 deletion ford/sourceform.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,6 @@ def process_attribs(self):
for attr in self.attr_dict.get(var.name.lower(),[]):
if attr == 'public' or attr == 'private' or attr == 'protected':
var.permission = attr
self.attr_dict.get[var.name.lower()]
elif attr[0:6] == 'intent':
var.intent = attr[7:-1]
elif DIM_RE.match(attr) and ('pointer' in attr or 'allocatable' in attr):
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
name = 'FORD',
packages = ['ford'],
include_package_data = True,
version = '5.0.2',
version = '5.0.3',
description = 'FORD, standing for FORtran Documenter, is an automatic documentation generator for modern Fortran programs.',
long_description = long_description,
author = 'Chris MacMackin',
author_email = '[email protected]',
url = 'https://github.com/cmacmackin/ford/',
download_url = 'https://github.com/cmacmackin/ford/tarball/5.0.2',
download_url = 'https://github.com/cmacmackin/ford/tarball/5.0.3',
keywords = ['Markdown', 'Fortran', 'documentation', 'comments'],
classifiers=[
# How mature is this project? Common values are
Expand Down

0 comments on commit 22ec6d9

Please sign in to comment.