Skip to content

Commit

Permalink
Remove debug warnings. Fix config handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
realtimeprojects committed Jun 19, 2024
1 parent f01d02e commit 85d4efd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
branches: ["main", "branches/*"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
10 changes: 5 additions & 5 deletions src/mkdocs_ezglossary_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,26 +216,26 @@ def _get_defs(self, section, term):
defs = self._glossary.get(section, term, 'defs')
if len(defs) > 0:
return defs
log.warning(f'plurals: {self.config.plurals}')
log.debug(f'plurals: {self.config.plurals}')
if 'plurals' not in self.config:
return
return defs
if self.config.plurals == 'inflect':
singular = engine.singular_noun(term)
if not singular:
log.debug(f'no singular for: `{term}`')
return defs
log.warning(f'singular is: `{singular}`')
log.debug(f'singular is: `{singular}`')
return self._glossary.get(section, singular, 'defs')
if self.config.plurals not in plurals:
log.error('no plurals definition for `{self.config.plurals`')
return defs
_plurals = plurals[self.config.plurals]

for ending, replacements in _plurals.items():
log.warning(f'ending: {ending}, replacements: {replacements}')
log.debug(f'ending: {ending}, replacements: {replacements}')
for replacement in replacements:
singular = re.sub(ending, replacement, term)
log.warning(f"looking up `{singular}`")
log.debug(f"looking up `{singular}`")
defs = self._glossary.get(section, singular, 'defs')
if len(defs) > 0:
return defs
Expand Down

0 comments on commit 85d4efd

Please sign in to comment.