1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00

doc update

This commit is contained in:
Kelly Brazil
2020-02-05 13:50:12 -08:00
parent ff1159b1de
commit 8b2e01d540

View File

@ -51,22 +51,22 @@ parsers = [
def parser_shortname(parser_argument): def parser_shortname(parser_argument):
# short name of the parser with dashes and no -- prefix """short name of the parser with dashes and no -- prefix"""
return parser_argument[2:] return parser_argument[2:]
def parser_argument(parser): def parser_argument(parser):
# short name of the parser with dashes and with -- prefix """short name of the parser with dashes and with -- prefix"""
return f'--{parser}' return f'--{parser}'
def parser_mod_shortname(parser): def parser_mod_shortname(parser):
# short name of the parser's module name (no -- prefix and dashes converted to underscores) """short name of the parser's module name (no -- prefix and dashes converted to underscores)"""
return parser.replace('--', '').replace('-', '_') return parser.replace('--', '').replace('-', '_')
def parser_module(parser): def parser_module(parser):
# import the module just in time and present the module object """import the module just in time and present the module object"""
importlib.import_module('jc.parsers.' + parser_mod_shortname(parser)) importlib.import_module('jc.parsers.' + parser_mod_shortname(parser))
return getattr(jc.parsers, parser_mod_shortname(parser)) return getattr(jc.parsers, parser_mod_shortname(parser))