Merge "Update sphinx extension logging"

This commit is contained in:
Zuul 2019-11-18 15:33:18 +00:00 committed by Gerrit Code Review
commit 3a27133f24
2 changed files with 12 additions and 8 deletions

View File

@ -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<name>.*)\s+\((?P<irc>.*)\)\s+\[(?P<date>.*)\](\s+\{(?P<role>.*)\})?')
@ -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)

View File

@ -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())