diff --git a/doc/source/_exts/members.py b/doc/source/_exts/members.py index 053718b..2d8f8ca 100644 --- a/doc/source/_exts/members.py +++ b/doc/source/_exts/members.py @@ -18,6 +18,9 @@ import re from docutils import nodes from docutils.parsers.rst.directives.tables import Table from docutils.parsers.rst import directives +from sphinx.util import logging + +LOG = logging.getLogger(__name__) # Full name (IRC nickname) [expires in] {role} _PATTERN = re.compile('(?P.*)\s+\((?P.*)\)\s+\[(?P.*)\](\s+\{(?P.*)\})?') @@ -33,7 +36,7 @@ def _parse_members_file(app, filename): continue m = _PATTERN.match(line) if not m: - app.warning('Could not parse line %d of %s: %r' % + LOG.warning('Could not parse line %d of %s: %r' % (linum, filename, line)) continue yield m.groupdict() @@ -150,5 +153,5 @@ class MembersTable(Table): return table def setup(app): - app.info('loading members extension') + LOG.info('loading members extension') app.add_directive('memberstable', MembersTable) diff --git a/doc/source/_exts/teamtable.py b/doc/source/_exts/teamtable.py index 9d3615f..9572a89 100644 --- a/doc/source/_exts/teamtable.py +++ b/doc/source/_exts/teamtable.py @@ -12,14 +12,16 @@ # License for the specific language governing permissions and limitations # under the License. -"""Build a table of the current teams -""" +"""Build a table of the current teams""" + +import yaml from docutils import nodes from docutils.parsers.rst.directives.tables import Table from docutils.parsers.rst import directives +from sphinx.util import logging -import yaml +LOG = logging.getLogger(__name__) class TeamTable(Table): @@ -34,7 +36,6 @@ class TeamTable(Table): } def run(self): env = self.state.document.settings.env - app = env.app if self.options.get('headers') is not None: self.HEADERS = self.options.get('headers').split(",") @@ -68,8 +69,8 @@ class TeamTable(Table): # Now find the real path to the file, relative to where we are. rel_filename, filename = env.relfn2path(datafile) - app.info('loading teamtable') - app.info('reading %s' % filename) + LOG.info('loading teamtable') + LOG.info('reading %s' % filename) with open(filename, 'r') as f: _teams_yaml = yaml.load(f.read())