1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 12:19:02 +00:00

Enforce PEP 8 style on Ndiff

Issues fixed:

1       E111 indentation is not a multiple of four
1       E201 whitespace after '['
14      E251 no spaces around keyword / parameter equals
7       E301 expected 1 blank line, found 0
55      E302 expected 2 blank lines, found 1
69      E501 line too long (80 characters)
3       W291 trailing whitespace
4       W601 .has_key() is deprecated, use 'in'
This commit is contained in:
dmiller
2014-01-10 20:43:32 +00:00
parent 393b4b21ee
commit da0c947004
4 changed files with 249 additions and 118 deletions

View File

@@ -6,29 +6,34 @@ import distutils.core
import distutils.cmd
import distutils.errors
class null_command(distutils.cmd.Command):
"""This is a dummy distutils command that does nothing. We use it to replace
the install_egg_info and avoid installing a .egg-info file, because there's
no option to disable that."""
"""This is a dummy distutils command that does nothing. We use it to
replace the install_egg_info and avoid installing a .egg-info file, because
there's no option to disable that."""
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
pass
class checked_install(distutils.command.install.install):
"""This is a wrapper around the install command that checks for an error
caused by not having the python-dev package installed. By default, distutils
gives a misleading error message: "invalid Python installation." """
caused by not having the python-dev package installed. By default,
distutils gives a misleading error message: "invalid Python installation."
"""
def finalize_options(self):
try:
distutils.command.install.install.finalize_options(self)
except distutils.errors.DistutilsPlatformError, e:
raise distutils.errors.DistutilsPlatformError(str(e) + "\n"
+ "Installing your distribution's python-dev package may solve this problem.")
raise distutils.errors.DistutilsPlatformError(str(e) + """
Installing your distribution's python-dev package may solve this problem.""")
distutils.core.setup(name = u"ndiff", scripts = [u"scripts/ndiff"],
py_modules = [u"ndiff"],
data_files = [(u"share/man/man1", [u"docs/ndiff.1"])],
cmdclass = {"install_egg_info": null_command, "install": checked_install})
distutils.core.setup(name=u"ndiff", scripts=[u"scripts/ndiff"],
py_modules=[u"ndiff"],
data_files=[(u"share/man/man1", [u"docs/ndiff.1"])],
cmdclass={"install_egg_info": null_command, "install": checked_install})