Skip to content

Commit

Permalink
add code checker flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuxem committed Sep 26, 2016
1 parent 3efa2c3 commit 6c8fbeb
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
# distutils
dist/
MANIFEST
build/
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lint:
flake8 --exclude=build,dist,tests/samples.py .
2 changes: 1 addition & 1 deletion rblwatch/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .rblwatch import RBLSearch
from .rblwatch import RBLSearch # NOQA
12 changes: 7 additions & 5 deletions rblwatch/rblwatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def run(self):
self.listed[self.dnslist]['ERROR'] = True
self.listed[self.dnslist]['ERRORTYPE'] = NoAnswer


class RBLSearch(object):
def __init__(self, lookup_host):
self.lookup_host = lookup_host
Expand All @@ -147,7 +148,8 @@ def search(self, RBLS=RBLS):
threads = []
for LIST in RBLS:
self._listed[LIST] = {'LISTED': False}
query = Lookup("%s.%s" % (host, LIST), LIST, self._listed, self.resolver)
query = Lookup(
"%s.%s" % (host, LIST), LIST, self._listed, self.resolver)
threads.append(query)
query.start()
for thread in threads:
Expand All @@ -165,13 +167,13 @@ def print_results(self):
if not listed[key].get('ERROR'):
if listed[key]['LISTED']:
print("Results for %s: %s" % (key, listed[key]['LISTED']))
print(" + Host information: %s" % \
print(" + Host information: %s" %
(listed[key]['HOST']))
if 'TEXT' in listed[key].keys():
print(" + Additional information: %s" % \
print(" + Additional information: %s" %
(listed[key]['TEXT']))
else:
#print "*** Error contacting %s ***" % key
# print "*** Error contacting %s ***" % key
pass

if __name__ == "__main__":
Expand All @@ -185,7 +187,7 @@ def print_results(self):
if not is_ip_address:
try:
ip = socket.gethostbyname(ip)
print("Hostname %s resolved to ip %s" % (sys.argv[1],ip))
print("Hostname %s resolved to ip %s" % (sys.argv[1], ip))
except socket.error:
print("IP %s can't be resolved" % ip)
ip = ""
Expand Down
24 changes: 12 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from distutils.core import setup
setup(
name = 'rblwatch',
packages = ['rblwatch'],
scripts = ['bin/rblcheck', 'bin/rblwatch'],
version = '0.2.4',
description = 'RBL lookups with Python',
author = 'James Polera',
author_email = '[email protected]',
maintainer = 'Thomas Merkel',
maintainer_email = '[email protected]',
url = 'https://github.com/drscream/rblwatch',
keywords = ['rbl', 'blacklist', 'mail'],
install_requires = ['IPy', 'dnspython'],
name='rblwatch',
packages=['rblwatch'],
scripts=['bin/rblcheck', 'bin/rblwatch'],
version='0.2.4',
description='RBL lookups with Python',
author='James Polera',
author_email='[email protected]',
maintainer='Thomas Merkel',
maintainer_email='[email protected]',
url='https://github.com/drscream/rblwatch',
keywords=['rbl', 'blacklist', 'mail'],
install_requires=['IPy', 'dnspython'],
)

0 comments on commit 6c8fbeb

Please sign in to comment.