Skip to content
This repository has been archived by the owner on Nov 28, 2020. It is now read-only.

Commit

Permalink
Suppressed pylint warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
odkr committed Apr 23, 2018
1 parent c551496 commit 2d9d57d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pandoc_quotes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def __new__(cls, ldquo, rdquo, lsquo, rsquo):
"""
quo_marks = (ldquo, rdquo, lsquo, rsquo)
for i in quo_marks:
if not isinstance(i, basestring):
if not isinstance(i, basestring): # pylint: disable = E0602
raise QuoMarkNotAStringError()
return tuple.__new__(cls, quo_marks)

Expand Down
20 changes: 10 additions & 10 deletions scripts/pandoc-quotes
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ from logging import basicConfig, warning
from argparse import ArgumentParser
from os.path import basename
from panflute import run_filter
from pandoc_quotes import QuoMarkReplacer, Error
from pandoc_quotes import QuoMarkReplacer, Error # pylint: disable = E0401

DESCRIPTION = ('Pandoc filter that replaces plain quotation marks with '
'typographic ones. Respects the language of the document, '
'as set by the "lang" attribute. Defaults to "en-US". '
'See pandoc-quotes(1) for details.')

DEBUG = True

def main(doc=None):
"""Replaces plain quotation marks with typgraphic ones.
Expand All @@ -43,20 +49,14 @@ def main(doc=None):
doc (``panflute.Doc``):
The document in which to replace quotes.
"""

basicConfig(format='{prog}: %(msg)s'.format(prog=basename(sys.argv[0])))

# pylint: disable=C0330
parser = ArgumentParser(description='Pandoc filter that replaces plain '
'quotation marks with typographic ones. Respects the language of the '
'document, as set by the "lang" attribute. Defaults to "en-US". '
'See pandoc-quotes(1) for details.')

parser = ArgumentParser(description=DESCRIPTION)
parser.parse_known_args()

try:
return run_filter(QuoMarkReplacer(), doc=doc)
except Error as err:
if DEBUG:
raise
warning(str(err))
sys.exit(1)

Expand Down

0 comments on commit 2d9d57d

Please sign in to comment.