Skip to content

Commit

Permalink
Merge pull request gongjianhui#51 from cclauss/patch-1
Browse files Browse the repository at this point in the history
Compound compares
  • Loading branch information
septs committed Apr 19, 2016
2 parents 379002a + 79e1c41 commit 0f2128c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions export-configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

def check_requirements():
def check_python_version():
if sys.hexversion >= 0x2000000 and sys.hexversion <= 0x2070000:
if 0x2000000 <= sys.hexversion <= 0x2070000:
print('your "python" lower than 2.7.0 upgrade.')
return False
if sys.hexversion >= 0x3000000 and sys.hexversion <= 0x3040000:
elif 0x3000000 <= sys.hexversion <= 0x3040000: # Is Python 3.5.1 not acceptable??
print('your "python" lower than 3.4.0 upgrade.')
return False
return True
Expand All @@ -42,7 +42,7 @@ def handle_delta(items):
def handle(item):
ip, delta = item
delta = list(item for item in delta if item != None)
if len(delta):
if delta:
return Item(tag, ip, sum(delta) / float(len(delta)))
return Item(tag, ip, float('NaN'))

Expand All @@ -53,9 +53,7 @@ def handle_sorted():
return sorted(data, key=attrgetter('avg_rtt'))

iptable = handle_sorted()

if len(iptable):
return iptable[0]
return iptable[0] if iptable else None


def export(payload, target):
Expand Down

0 comments on commit 0f2128c

Please sign in to comment.