Skip to content

Commit

Permalink
xml2nroff: Fix issues pointed out by flake8.
Browse files Browse the repository at this point in the history
This patch includes a few minor fixes pointed out by the flake8 tool.
It drops an unused variable and the related imports, adds some blank
lines where the PEP8 formatting standard indicates they should be, and
does a comparison with None as "is None" instead of "== None".

Signed-off-by: Russell Bryant <[email protected]>
Acked-by: Justin Pettit <[email protected]>
  • Loading branch information
russellb committed Dec 11, 2015
1 parent d43bf6a commit e78cd62
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions build-aux/xml2nroff
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from datetime import date
import getopt
import os
import sys
import xml.dom.minidom

import build.nroff

argv0 = sys.argv[0]


def usage():
print """\
%(argv0)s: XML to nroff converter
Expand All @@ -40,6 +39,7 @@ The following options are also available:
""" % {'argv0': argv0}
sys.exit(0)


def manpage_to_nroff(xml_file, subst, version=None):
f = open(xml_file)
input = []
Expand All @@ -48,9 +48,8 @@ def manpage_to_nroff(xml_file, subst, version=None):
line = line.replace(k, v)
input += [line]
doc = xml.dom.minidom.parseString(''.join(input)).documentElement
d = date.fromtimestamp(os.stat(xml_file).st_mtime)

if version == None:
if version is None:
version = "UNKNOWN"
program = doc.attributes['program'].nodeValue
title = doc.attributes['title'].nodeValue
Expand Down

0 comments on commit e78cd62

Please sign in to comment.