mirror of https://github.com/tLDP/python-tldp
pep8/pyflakes fixes
This commit is contained in:
parent
793a810b8f
commit
f7505627a5
|
@ -14,6 +14,7 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
DEFAULT_CONFIGFILE = '/etc/ldptool/ldptool.ini'
|
DEFAULT_CONFIGFILE = '/etc/ldptool/ldptool.ini'
|
||||||
|
|
||||||
|
|
||||||
def collectconfiguration(tag, argv):
|
def collectconfiguration(tag, argv):
|
||||||
ap = DefaultFreeArgumentParser()
|
ap = DefaultFreeArgumentParser()
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import logging
|
||||||
|
|
||||||
from tldp.utils import which
|
from tldp.utils import which
|
||||||
from tldp.utils import arg_isexecutable, isexecutable
|
from tldp.utils import arg_isexecutable, isexecutable
|
||||||
from tldp.doctypes.common import BaseDoctype, depends
|
from tldp.doctypes.common import depends
|
||||||
from tldp.doctypes.docbook4xml import Docbook4XML
|
from tldp.doctypes.docbook4xml import Docbook4XML
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
|
@ -181,7 +181,7 @@ class BaseDoctype(object):
|
||||||
raise Exception(etext % (self.source.stem,))
|
raise Exception(etext % (self.source.stem,))
|
||||||
|
|
||||||
@logtimings(logger.debug)
|
@logtimings(logger.debug)
|
||||||
def dump_shellscript(self, script, preamble=preamble,
|
def dump_shellscript(self, script, preamble=preamble,
|
||||||
postamble=postamble, **kwargs):
|
postamble=postamble, **kwargs):
|
||||||
source = self.source
|
source = self.source
|
||||||
output = self.output
|
output = self.output
|
||||||
|
@ -193,7 +193,7 @@ class BaseDoctype(object):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@logtimings(logger.debug)
|
@logtimings(logger.debug)
|
||||||
def execute_shellscript(self, script, preamble=preamble,
|
def execute_shellscript(self, script, preamble=preamble,
|
||||||
postamble=postamble, **kwargs):
|
postamble=postamble, **kwargs):
|
||||||
source = self.source
|
source = self.source
|
||||||
output = self.output
|
output = self.output
|
||||||
|
|
|
@ -119,9 +119,9 @@ class DocbookSGML(BaseDoctype, SignatureChecker):
|
||||||
if not self.config.script:
|
if not self.config.script:
|
||||||
cwd = os.getcwd()
|
cwd = os.getcwd()
|
||||||
if not os.path.samefile(cwd, self.output.dirname):
|
if not os.path.samefile(cwd, self.output.dirname):
|
||||||
logger.error("%s (cowardly) refusing to clean directory %s",
|
logger.error("%s (cowardly) refusing to clean directory %s",
|
||||||
self.source.stem, cwd)
|
self.source.stem, cwd)
|
||||||
logger.error("%s expected to find %s",
|
logger.error("%s expected to find %s",
|
||||||
self.source.stem, self.output.dirname)
|
self.source.stem, self.output.dirname)
|
||||||
return False
|
return False
|
||||||
s = '''find . -mindepth 1 -maxdepth 1 -not -type d -delete -print'''
|
s = '''find . -mindepth 1 -maxdepth 1 -not -type d -delete -print'''
|
||||||
|
|
|
@ -319,7 +319,7 @@ def publish(config, docs, **kwargs):
|
||||||
#
|
#
|
||||||
swapdirs(source.working.dirname, source.output.dirname)
|
swapdirs(source.working.dirname, source.output.dirname)
|
||||||
if os.path.isdir(source.working.dirname):
|
if os.path.isdir(source.working.dirname):
|
||||||
logger.debug("%s removing old directory %s",
|
logger.debug("%s removing old directory %s",
|
||||||
source.stem, source.working.dirname)
|
source.stem, source.working.dirname)
|
||||||
shutil.rmtree(source.working.dirname)
|
shutil.rmtree(source.working.dirname)
|
||||||
post_publish_cleanup(docs)
|
post_publish_cleanup(docs)
|
||||||
|
@ -528,6 +528,7 @@ def handleArgs(config, args):
|
||||||
|
|
||||||
return "Fell through handleArgs(); programming error."
|
return "Fell through handleArgs(); programming error."
|
||||||
|
|
||||||
|
|
||||||
def run(argv):
|
def run(argv):
|
||||||
# -- may want to see option parsing, so set --loglevel as
|
# -- may want to see option parsing, so set --loglevel as
|
||||||
# soon as possible
|
# soon as possible
|
||||||
|
|
|
@ -198,8 +198,8 @@ class SourceDocument(object):
|
||||||
def detail(self, widths, verbose, file=sys.stdout):
|
def detail(self, widths, verbose, file=sys.stdout):
|
||||||
'''produce a small tabular output about the document'''
|
'''produce a small tabular output about the document'''
|
||||||
template = ' '.join(('{s.status:{w.status}}',
|
template = ' '.join(('{s.status:{w.status}}',
|
||||||
'{s.doctype.formatname:{w.doctype}}',
|
'{s.doctype.formatname:{w.doctype}}',
|
||||||
'{s.stem:{w.stem}}'))
|
'{s.stem:{w.stem}}'))
|
||||||
outstr = template.format(s=self, w=widths)
|
outstr = template.format(s=self, w=widths)
|
||||||
print(outstr, file=file)
|
print(outstr, file=file)
|
||||||
if verbose:
|
if verbose:
|
||||||
|
|
Loading…
Reference in New Issue