Commit ba9e6601 authored by Ole Streicher's avatar Ole Streicher

New upstream version 0.7

parent 43dca2bd
0.6.4
-----
* Bug fix for rhessi summary lightcurve values.
* Fix docstring for `pixel_to_data` and `data_to_pixel`.
* Fix the URL for the Helioviewer API. (This fixes Helioviewer.)
* Fix the way `reshape_image_to_4d_superpixel` checks the dimension of the new image.
* Fix Map to allow astropy.io.fits Header objects as valid input for meta arguments.
* Prevent helioviewer tests from checking access to API when running tests in offline mode.
0.6.3
Latest
------
* Change setup.py extras to install suds-jurko not suds.
0.6.2
-----
* Changed start of GOES 2 operational time range back to 1980-01-04 so data from 1980 can be read into GOESLightCurve object
* Fix bug with numpy 1.10
* update astropy_helpers
* Added new sample data
0.6.1
-----
* Fixed MapCube animations by working around a bug in Astropy's ImageNormalize
* Small fix to RTD builds for Affiliated packages
* SunPy can now be installed without having to install Astropy first.
* MapCubes processed with ``coalignment.apply_shifts`` now have correct
metadata.
* Multiple fixes for WCS transformations, especially with solar-x, solar-y
CTYPE headers.
* Added `timeout` parameter in `sunpy.data.download_sample_data()`
* Fixed `aiaprep` to return properly sized map.
* Deprecation warnings fixed when using image coalignment.
* Sunpy is now Python 3.x compatible (3.4 and 3.5).
* Added a unit check and warnings for map metadata.
* Added IRIS SJI color maps.
* Updated `show_colormaps()` with new string filter to show a subset of color maps.
* Fixed MapCube animations by working around a bug in Astropy's ImageNormalize
* Remove ``vso.QueryResponse.num_records()`` in favour of `len(qr)`
* Add a `draw_rectangle` helper to `GenericMap` which can plot rectangles in the
native coordinate system of the map.
* Added the ability to shift maps to correct for incorrect map location, for example.
* Bug fix for RHESSI summary light curve values.
* Mapcube solar derotation and coalignment now pass keywords to the routine used to
shift the images, scipy.ndimage.interpolation.shift.
* Add automatic registration of ``GenericMap`` subclasses with the factory as
long as they define an ``is_datasource_for`` method.
* Added functions ``flareclass_to_flux`` and ``flux_to_flareclass`` which convert
between GOES flux to GOES class numbers (e.g. X12, M3.4).
* Removed old ``sunpy.util.goes_flare_class()``
* Bug fix for RHESSI summary light curve values.
* The ``MapCube.as_array`` function now returns a masked numpy array if at least
one of the input maps in the MapCube has a mask.
* Map superpixel method now respects maps that have masks.
* Map superpixel method now accepts numpy functions as an argument, or any user-defined
function.
* Map superpixel method no longer has the restriction that the number of original pixels
in the x (or y) side of the superpixel exactly divides the number of original
pixels in the x (or y) side of the original map data.
* `sunpy.physics.transforms` has been deprecated and the code moved into `sunpy.physics`.
* Add the `sunpy.coordinates` module, this adds the core physical solar coordinates frame within the astropy coordinates framework.
* Added ability of maps to draw contours on top of themselves (`draw_contours`)
* Added concatenate functionality to lightcurve base class.
* Fix Map to allow astropy.io.fits Header objects as valid input for meta arguments.
* Added an examples gallery using `sphinx-gallery`.
* API clean up to constants. Removed constant() function which is now replaced by get().
* Prevent helioviewer tests from checking access to the API endpoint when running tests offline.
* `GenericMap.units` is renamed to `GenericMap.spatial_units` to avoid confusion with `NDData.unit`.
* `GenericMap` now has a `coordinate_frame` property which returns an `astropy.coordinates` frame with all the meta data from the map populated.
* `GenericMap` now has a `_mpl_axes` method which allows it to be specified as a projection to `matplotlib` methods and will return a `WCSAxes` object with `WCS` projection.
0.6.0
-----
......@@ -61,6 +73,7 @@
* Added a few tests for the sunpy.roi module.
* Refactored mapcube co-alignment functionality.
* Removed sample data from distribution and added ability to download sample files
* Changed start of GOES 2 operational time range back to 1980-01-04 so data from 1980 can be read into GOESLightCurve object
* Require JSOC request data calls have an email address attached.
* Calculation of the solar rotation of a point on the Sun as seen from Earth, and its application to the de-rotation of mapcubes.
* Downloaded files now keep file extensions rather than replacing all periods with underscores
......
Metadata-Version: 1.1
Name: sunpy
Version: 0.6.4
Version: 0.7
Summary: SunPy: Python for Solar Physics
Home-page: http://sunpy.org/
Author: The SunPy Community
......
# [SunPy](http://sunpy.org)
[![Downloads](https://pypip.in/d/sunpy/badge.png)](https://pypi.python.org/pypi/sunpy/) [![Latest Version](https://pypip.in/v/sunpy/badge.png)](https://pypi.python.org/pypi/sunpy/) [![Build Status](https://secure.travis-ci.org/sunpy/sunpy.png)] (http://travis-ci.org/sunpy/sunpy)[![Build status](https://ci.appveyor.com/api/projects/status/xow461iejsjvp9vl?svg=true)](https://ci.appveyor.com/project/sunpy/sunpy)[![Coverage Status](https://coveralls.io/repos/sunpy/sunpy/badge.png?branch=master)](https://coveralls.io/r/sunpy/sunpy?branch=master) [![Code Health](https://landscape.io/github/sunpy/sunpy/master/landscape.png)](https://landscape.io/github/sunpy/sunpy/master)
[![Downloads](https://img.shields.io/pypi/dm/sunpy.svg)](https://pypi.python.org/pypi/sunpy/) [![Latest Version](https://img.shields.io/pypi/v/sunpy.svg)](https://pypi.python.org/pypi/sunpy/) [![Build Status](https://secure.travis-ci.org/sunpy/sunpy.svg)] (http://travis-ci.org/sunpy/sunpy)[![Build status](https://ci.appveyor.com/api/projects/status/xow461iejsjvp9vl?svg=true)](https://ci.appveyor.com/project/sunpy/sunpy)[![Coverage Status](https://coveralls.io/repos/sunpy/sunpy/badge.svg?branch=master)](https://coveralls.io/r/sunpy/sunpy?branch=master) [![Code Health](https://landscape.io/github/sunpy/sunpy/master/landscape.svg)](https://landscape.io/github/sunpy/sunpy/master)
[![Code Issues](https://www.quantifiedcode.com/api/v1/project/9edd3e28230840038713e1c7dc3eb141/badge.svg)](https://www.quantifiedcode.com/app/project/9edd3e28230840038713e1c7dc3eb141)[![Research software impact](http://depsy.org/api/package/pypi/sunpy/badge.svg)](http://depsy.org/package/python/sunpy)
SunPy is an open-source Python library for solar physics data analysis.
[![Visit our IRC channel](https://kiwiirc.com/buttons/chat.freenode.com/sunpy.png)](https://kiwiirc.com/client/chat.freenode.com/#sunpy)
Installation
------------
To begin, install the following requirements:
* [Python](http://www.python.org) (2.7+)
* [Python](http://www.python.org) (2.7)
* [Astropy](http://astropy.org) (1.0.0)
* [NumPy](http://numpy.scipy.org/)
* [SciPy](http://www.scipy.org/)
* [Matplotlib](http://matplotlib.sourceforge.net/) (1.1+)
* [Suds](https://fedorahosted.org/suds)
* [suds-jurko](https://bitbucket.org/jurko/suds)
* [pandas](http://pandas.pydata.org/) (0.10.0+)
* [beautifulsoup4](http://www.crummy.com/software/BeautifulSoup/)
* [sqlalchemy](http://www.sqlalchemy.org/)
......@@ -26,7 +29,7 @@ Next, use git to grab the latest version of SunPy:
Done!
For detailed installation instructions, see the [installation guide](http://sunpy.readthedocs.org/en/latest/guide/installation/index.html)
For detailed installation instructions, see the [installation guide](http://docs.sunpy.org/en/latest/guide/installation/index.html)
in the SunPy docs.
Usage
......@@ -39,7 +42,7 @@ Here is a quick example of plotting an AIA image:
>>> import sunpy.data.sample
>>> import matplotlib.cm as cm
>>> aia = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE)
>>> aia.peek(cmap=cm.hot)
>>> aia.peek()
```
Getting Help
......@@ -47,7 +50,7 @@ Getting Help
For more information or to ask questions about SunPy, check out:
* [SunPy Documentation](http://sunpy.readthedocs.org/en/latest/)
* [SunPy Documentation](http://docs.sunpy.org/en/latest/)
* [SunPy Mailing List](https://groups.google.com/forum/#!forum/sunpy)
* IRC: #sunpy on [freenode.net](http://webchat.freenode.net/)
......@@ -56,7 +59,7 @@ Contributing
If you would like to get involved, start by joining the
[SunPy mailing list](https://groups.google.com/forum/#!forum/sunpy)
and check out the [Developer's Guide](http://sunpy.readthedocs.org/en/latest/dev.html) section
and check out the [Developer's Guide](http://docs.sunpy.org/en/latest/dev.html) section
of the SunPy docs. Stop by our IRC chat room named #sunpy on irc.freenode.net
if you have any questions. Help is always welcome so let us know what you like
to work on, or check out the [issues page](https://github.com/sunpy/sunpy/issues)
......
The SunPy project is happy to announce the release of SunPy 0.6.0.
This is a major SunPy release with lots of changes that will make SunPy even
better than it was before.
This release consists of 1,341 commits from 29 different people and
13 new contributors!
The SunPy project is happy to announce the release of SunPy 0.7.0.
The major changes in this release are:
SunPy 0.7 is the next major release of SunPy and contains 665 commits from 27
people, 11 of which have never contributed before. The major features of this
release are:
* Most functions throughout the SunPy code base expect Astropy
Quantity objects, and return Astropy Quantity objects.
* Python 2.6 support has ended, we do not expect this release to
work under Python 2.6.
* Sample data has been removed from SunPy but helpers for
downloading sample data have been added to sunpy.data.
* TimeRange has a new property based API, e.g. start and end are
now properties.
* Map.rotate() now pads arrays to prevent loss of data under
rotation.
* Map.rotate() now defaults to the slower but more accurate
bi-quartic interpolation method (order=4).
* SunPy colormaps are now registered with matplotlib, allowing
their use from imshow and similar functions after the import
of sunpy.cm.
* JSOC client export calls now checks for an email address.
* Solar rotation calculation functionality has been added, along
with functionality to de-rotate MapCubes.
* Files downloaded through the VSO now keep their file
extension.
* Python 3.4 and 3.5 support. This is the first version of SunPy to support
Python 3, we recommend that users start to consider moving to Python 3, please
report any issues you may have.
* New coordinate framework. The new `sunpy.coordinates` module provides a
high-level interface to converting between different physical coordinate
systems such as Helioprojective and Heliographic.
* New `draw_rectangle` and `draw_contours` helpers for `Map`.
* New functions `flareclass_to_flux` and `flux_to_flareclass` which convert
between GOES flux to GOES class numbers (e.g. X12, M3.4).
* Support for masks in SunPy `Map` and `MapCube`.
The people who have contributed to this release are:
Stuart Mumford
Daniel Ryan
Pritish Chakraborty
Steven Christe
Jack Ireland
Brigitta Sipocz *
Asish Panda
Andrew Inglis
Albert Y. Shih
Rishabh Sharma
Brigitta Sipocz
David Perez-Suarez
Rajul Srivastava
Punyaslok Pattnaik *
Michael S Kirk *
Andrew Leonard
Ruben De Visscher *
Dumindu Buddhika *
Goran Cetusic *
Jongyeob Park *
Chloé Guennou *
Ishtyaq Habib *
Alex Hamilton
Andrew Inglis
Daniel Ryan
Sally Dacie *
Sanskar Modi *
Albert Y. Shih
Erik M. Bray
Larry Manley
Priyank Lodha *
Nabil Freij
Ankit *
Igor Babuschkin *
Ole Streicher *
Simon Liedtke
Abigail Stevens *
Alex Hamilton *
Ambar Mehrotra *
Erik M. Bray *
Jaylen Wimbish *
Juan Camilo Buitrago-Casas *
Larry Manley
Norbert Gyenge
Rishabh Mishra *
Sudarshan Konge *
Tessa D. Wilkinson *
Thomas Robitaille
yasintoda *
Where an * indicates their first contribution.
......@@ -409,7 +409,7 @@ class _Bootstrapper(object):
def get_index_dist(self):
if not self.download:
log.warn('Downloading {0!r} disabled.'.format(DIST_NAME))
return False
return None
log.warn(
"Downloading {0!r}; run setup.py with the --offline option to "
......
astropy-helpers Changelog
=========================
1.2 (unreleased)
----------------
- Added sphinx configuration value ``automodsumm_inherited_members``.
If ``True`` this will include members that are inherited from a base
class in the generated API docs. Defaults to ``False`` which matches
the previous behavior. [#215]
1.1.3 (unreleased)
------------------
- Fixed ``build_sphinx`` to recognize builds that succeeded but have output
*after* the "build succeeded." statement. This only applies when
``--warnings-returncode`` is given (which is primarily relevant for Travis
documentation builds). [#223]
1.1.2 (2016-03-9)
-----------------
- The CSS for the sphinx documentation was altered to prevent some text overflow
problems. [#217]
1.1.1 (2015-12-23)
------------------
......
include README.rst
include CHANGES.rst
include LICENSE.rst
recursive-include licenses *
include ez_setup.py
include ah_bootstrap.py
......
......@@ -177,14 +177,13 @@ class AstropyBuildSphinx(SphinxBuildDoc):
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
retcode = 1
with proc.stdout:
for line in iter(proc.stdout.readline, b''):
line = line.strip(b'\n')
print(line.decode('utf-8'))
if 'build succeeded.' in str(line):
if 'build succeeded.' == line.decode('utf-8'):
retcode = 0
else:
retcode = 1
# Poll to set proc.retcode
proc.wait()
......
......@@ -14,6 +14,9 @@ import warnings
from os import path
import sphinx
from distutils.version import LooseVersion
# -- General configuration ----------------------------------------------------
......@@ -28,11 +31,8 @@ on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
def check_sphinx_version(expected_version):
import sphinx
from distutils import version
sphinx_version = version.LooseVersion(sphinx.__version__)
expected_version = version.LooseVersion(expected_version)
sphinx_version = LooseVersion(sphinx.__version__)
expected_version = LooseVersion(expected_version)
if sphinx_version < expected_version:
raise RuntimeError(
"At least Sphinx version {0} is required to build this "
......@@ -134,8 +134,10 @@ extensions = [
if on_rtd:
extensions.append('sphinx.ext.mathjax')
else:
elif LooseVersion(sphinx.__version__) < LooseVersion('1.4'):
extensions.append('sphinx.ext.pngmath')
else:
extensions.append('sphinx.ext.imgmath')
# Above, we use a patched version of viewcode rather than 'sphinx.ext.viewcode'
......
......@@ -52,6 +52,14 @@ It accepts the following options:
given, only objects that are actually in a subpackage of the package
currently being documented are included.
* ``:inherited-members:`` / ``:no-inherited-members:``
The global sphinx configuration option
``automodsumm_inherited_members`` decides if members that a class
inherits from a base class are included in the generated
documentation. The option ``:inherited-members:`` or ``:no-inherited-members:``
allows the user to overrride the global setting.
This extension also adds two sphinx configuration options:
* ``automodapi_toctreedirnm``
......@@ -67,6 +75,10 @@ This extension also adds two sphinx configuration options:
actually used by sphinx, so this option is only for figuring out the
cause of sphinx warnings or other debugging. Defaults to `False`.
* ``automodsumm_inherited_members``
Should be a bool and if ``True`` members that a class inherits from a base
class are included in the generated documentation. Defaults to ``False``.
.. _automodule: http://sphinx-doc.org/latest/ext/autodoc.html?highlight=automodule#directive-automodule
"""
......@@ -204,6 +216,7 @@ def automodapi_replace(sourcestr, app, dotoctree=True, docname=None,
# look for actual options
unknownops = []
inherited_members = None
for opname, args in _automodapiargsrex.findall(spl[grp * 3 + 2]):
if opname == 'skip':
toskip.append(args.strip())
......@@ -217,6 +230,10 @@ def automodapi_replace(sourcestr, app, dotoctree=True, docname=None,
top_head = False
elif opname == 'allowed-package-names':
allowedpkgnms.append(args.strip())
elif opname == 'inherited-members':
inherited_members = True
elif opname == 'no-inherited-members':
inherited_members = False
else:
unknownops.append(opname)
......@@ -273,6 +290,11 @@ def automodapi_replace(sourcestr, app, dotoctree=True, docname=None,
clsfuncoptions.append(':skip: ' + ','.join(toskip))
if allowedpkgnms:
clsfuncoptions.append(allowedpkgnms)
if hascls: # This makes no sense unless there are classes.
if inherited_members is True:
clsfuncoptions.append(':inherited-members:')
if inherited_members is False:
clsfuncoptions.append(':no-inherited-members:')
clsfuncoptionstr = '\n '.join(clsfuncoptions)
if hasfuncs:
......
......@@ -22,7 +22,7 @@ This directive requires a single argument that must be a module or
package.
It also accepts any options supported by the `autosummary`_ directive-
see `sphinx.ext.autosummary`_ for details. It also accepts two additional
see `sphinx.ext.autosummary`_ for details. It also accepts some additional
options:
* ``:classes-only:``
......@@ -46,14 +46,27 @@ options:
given, only objects that are actually in a subpackage of the package
currently being documented are included.
This extension also adds one sphinx configuration option:
* ``:inherited-members:`` or ``:no-inherited-members:``
The global sphinx configuration option ``automodsumm_inherited_members``
decides if members that a class inherits from a base class are included
in the generated documentation. The flags ``:inherited-members:`` or
``:no-inherited-members:`` allows overrriding this global setting.
This extension also adds two sphinx configuration options:
* ``automodsumm_writereprocessed``
Should be a bool, and if True, will cause `automodsumm`_ to write files
Should be a bool, and if ``True``, will cause `automodsumm`_ to write files
with any ``automodsumm`` sections replaced with the content Sphinx
processes after ``automodsumm`` has run. The output files are not
actually used by sphinx, so this option is only for figuring out the
cause of sphinx warnings or other debugging. Defaults to `False`.
cause of sphinx warnings or other debugging. Defaults to ``False``.
* ``automodsumm_inherited_members``
Should be a bool and if ``True``, will cause `automodsumm`_ to document
class members that are inherited from a base class. This value can be
overriden for any particular automodsumm directive by including the
``:inherited-members:`` or ``:no-inherited-members:`` options. Defaults to
``False``.
.. _sphinx.ext.autosummary: http://sphinx-doc.org/latest/ext/autosummary.html
.. _autosummary: http://sphinx-doc.org/latest/ext/autosummary.html#directive-autosummary
......@@ -121,6 +134,8 @@ class Automodsumm(BaseAutosummary):
option_spec['classes-only'] = flag
option_spec['skip'] = _str_list_converter
option_spec['allowed-package-names'] = _str_list_converter
option_spec['inherited-members'] = flag
option_spec['no-inherited-members'] = flag
def run(self):
env = self.state.document.settings.env
......@@ -250,7 +265,8 @@ def process_automodsumm_generation(app):
generate_automodsumm_docs(lines, sfn, builder=app.builder,
warn=app.warn, info=app.info,
suffix=suffix,
base_path=app.srcdir)
base_path=app.srcdir,
inherited_members=app.config.automodsumm_inherited_members)
#_automodsummrex = re.compile(r'^(\s*)\.\. automodsumm::\s*([A-Za-z0-9_.]+)\s*'
# r'\n\1(\s*)(\S|$)', re.MULTILINE)
......@@ -371,7 +387,8 @@ def automodsumm_to_autosummary_lines(fn, app):
def generate_automodsumm_docs(lines, srcfn, suffix='.rst', warn=None,
info=None, base_path=None, builder=None,
template_dir=None):
template_dir=None,
inherited_members=False):
"""
This function is adapted from
`sphinx.ext.autosummary.generate.generate_autosummmary_docs` to
......@@ -382,13 +399,15 @@ def generate_automodsumm_docs(lines, srcfn, suffix='.rst', warn=None,
from sphinx.jinja2glue import BuiltinTemplateLoader
from sphinx.ext.autosummary import import_by_name, get_documenter
from sphinx.ext.autosummary.generate import (find_autosummary_in_lines,
_simple_info, _simple_warn)
from sphinx.ext.autosummary.generate import (_simple_info, _simple_warn)
from sphinx.util.osutil import ensuredir
from sphinx.util.inspect import safe_getattr
from jinja2 import FileSystemLoader, TemplateNotFound
from jinja2.sandbox import SandboxedEnvironment
from .utils import find_autosummary_in_lines_for_automodsumm as find_autosummary_in_lines
if info is None:
info = _simple_info
if warn is None:
......@@ -430,7 +449,7 @@ def generate_automodsumm_docs(lines, srcfn, suffix='.rst', warn=None,
new_files = []
# write
for name, path, template_name in sorted(items):
for name, path, template_name, inherited_mem in sorted(items):
if path is None:
# The corresponding autosummary:: directive did not have
# a :toctree: option
......@@ -531,12 +550,23 @@ def generate_automodsumm_docs(lines, srcfn, suffix='.rst', warn=None,
ns['exceptions'], ns['all_exceptions'] = \
get_members_mod(obj, 'exception')
elif doc.objtype == 'class':
if inherited_mem is not None:
# option set in this specifc directive
include_base = inherited_mem
else:
# use default value
include_base = inherited_members
api_class_methods = ['__init__', '__call__']
ns['members'] = get_members_class(obj, None)
ns['members'] = get_members_class(obj, None,
include_base=include_base)
ns['methods'], ns['all_methods'] = \
get_members_class(obj, 'method', api_class_methods)
get_members_class(obj, 'method',
api_class_methods,
include_base=include_base)
ns['attributes'], ns['all_attributes'] = \
get_members_class(obj, 'attribute')
get_members_class(obj, 'attribute',
include_base=include_base)
ns['methods'].sort()
ns['attributes'].sort()
......@@ -604,3 +634,4 @@ def setup(app):
app.connect('builder-inited', process_automodsumm_generation)
app.add_config_value('automodsumm_writereprocessed', False, True)
app.add_config_value('automodsumm_inherited_members', False, 'env')
import inspect
import sys
import re
import os
from warnings import warn
from sphinx.ext.autosummary.generate import find_autosummary_in_docstring
def find_mod_objs(modname, onlylocals=False):
""" Returns all the public attributes of a module referenced by name.
......@@ -63,3 +67,111 @@ def find_mod_objs(modname, onlylocals=False):
objs = [e for i, e in enumerate(objs) if valids[i]]
return localnames, fqnames, objs
def find_autosummary_in_lines_for_automodsumm(lines, module=None, filename=None):
"""Find out what items appear in autosummary:: directives in the
given lines.
Returns a list of (name, toctree, template, inherited_members)
where *name* is a name
of an object and *toctree* the :toctree: path of the corresponding
autosummary directive (relative to the root of the file name),
*template* the value of the :template: option, and *inherited_members*
is the value of the :inherited-members: option.
*toctree*, *template*, and *inherited_members* are ``None`` if the
directive does not have the corresponding options set.
.. note::
This is a slightly modified version of
``sphinx.ext.autosummary.generate.find_autosummary_in_lines``
which recognizes the ``inherited-members`` option.
"""
autosummary_re = re.compile(r'^(\s*)\.\.\s+autosummary::\s*')
automodule_re = re.compile(
r'^\s*\.\.\s+automodule::\s*([A-Za-z0-9_.]+)\s*$')
module_re = re.compile(
r'^\s*\.\.\s+(current)?module::\s*([a-zA-Z0-9_.]+)\s*$')
autosummary_item_re = re.compile(r'^\s+(~?[_a-zA-Z][a-zA-Z0-9_.]*)\s*.*?')
toctree_arg_re = re.compile(r'^\s+:toctree:\s*(.*?)\s*$')
template_arg_re = re.compile(r'^\s+:template:\s*(.*?)\s*$')
inherited_members_arg_re = re.compile(r'^\s+:inherited-members:\s*$')
no_inherited_members_arg_re = re.compile(r'^\s+:no-inherited-members:\s*$')
documented = []
toctree = None
template = None
inherited_members = None
current_module = module
in_autosummary = False
base_indent = ""
for line in lines:
if in_autosummary:
m = toctree_arg_re.match(line)
if m:
toctree = m.group(1)
if filename:
toctree = os.path.join(os.path.dirname(filename),
toctree)
continue
m = template_arg_re.match(line)