mirror of https://github.com/tLDP/python-tldp
adjust and reorganize imports
This commit is contained in:
parent
b092e09516
commit
7359af070d
|
@ -8,14 +8,13 @@ import sys
|
||||||
import logging
|
import logging
|
||||||
from argparse import Namespace
|
from argparse import Namespace
|
||||||
|
|
||||||
import tldp.typeguesser
|
from tldp.typeguesser import knowndoctypes
|
||||||
|
from tldp.sources import SourceDocument, arg_issourcedoc
|
||||||
from tldp.doctypes.common import preamble, postamble
|
|
||||||
from tldp.sources import SourceDocument
|
|
||||||
from tldp.outputs import OutputDirectory
|
from tldp.outputs import OutputDirectory
|
||||||
from tldp.inventory import Inventory, status_classes, status_types
|
from tldp.inventory import Inventory, status_classes, status_types
|
||||||
|
from tldp.config import collectconfiguration
|
||||||
from tldp.utils import arg_isloglevel
|
from tldp.utils import arg_isloglevel
|
||||||
from tldp.sources import arg_issourcedoc
|
from tldp.doctypes.common import preamble, postamble
|
||||||
|
|
||||||
logformat = '%(levelname)-9s %(name)s %(filename)s#%(lineno)s %(funcName)s %(message)s'
|
logformat = '%(levelname)-9s %(name)s %(filename)s#%(lineno)s %(funcName)s %(message)s'
|
||||||
logging.basicConfig(stream=sys.stderr, format=logformat, level=logging.ERROR)
|
logging.basicConfig(stream=sys.stderr, format=logformat, level=logging.ERROR)
|
||||||
|
@ -128,7 +127,7 @@ def getStatusNames(args):
|
||||||
def getDocumentClasses(args):
|
def getDocumentClasses(args):
|
||||||
largs = [x.lower() for x in args]
|
largs = [x.lower() for x in args]
|
||||||
sought = list()
|
sought = list()
|
||||||
for cls in tldp.typeguesser.knowndoctypes:
|
for cls in knowndoctypes:
|
||||||
if cls.__name__.lower() in largs:
|
if cls.__name__.lower() in largs:
|
||||||
sought.append(cls)
|
sought.append(cls)
|
||||||
else:
|
else:
|
||||||
|
@ -202,7 +201,7 @@ def run(argv):
|
||||||
# -- produce a configuration from CLI, ENV and CFG
|
# -- produce a configuration from CLI, ENV and CFG
|
||||||
#
|
#
|
||||||
tag = 'ldptool'
|
tag = 'ldptool'
|
||||||
config, args = tldp.config.collectconfiguration(tag, argv)
|
config, args = collectconfiguration(tag, argv)
|
||||||
|
|
||||||
logger.debug("Received the following configuration:")
|
logger.debug("Received the following configuration:")
|
||||||
for param, value in sorted(vars(config).items()):
|
for param, value in sorted(vars(config).items()):
|
||||||
|
|
Loading…
Reference in New Issue