Skip to content

Commit

Permalink
Fixed arguments parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
RafayGhafoor committed Jul 30, 2017
1 parent ff415e4 commit 3153472
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions ptcl.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,28 @@ def main():
elif args.unblock not in my_macs.iterkeys():
print "User not found."

elif args.active_devices:
print "Calling Station info Function"
ptcl.get_stationinfo()
print "Currently active devices are:", len(ptcl.active_dev)

elif args.restart:
print "Calling restart Function"
ptcl.get_sessionkey()
ptcl.reboot_router()

elif args.show_dhcp:
print "Calling DHCP_info Function"
# ptcl.get_sessionkey()
ptcl.show_dhcpinfo()

elif args.show_active == '.':
print "Calling show_active Function"
ptcl.show_active_dev()

else:
print "Invalid Argument"


elif not args.quiet:
if not args.block:
Expand All @@ -69,27 +91,6 @@ def main():
ptcl.unblock_dev(ptcl.mac_and_host[name[dev_mac]])
print "%s has been unblocked." % name[dev_mac].capitalize()

elif args.active_devices:
print "Calling Station info Function"
ptcl.get_stationinfo()
print "Currently active devices are:", len(ptcl.active_dev)

elif args.restart:
print "Calling restart Function"
ptcl.get_sessionkey()
ptcl.reboot_router()

elif args.show_dhcp:
print "Calling DHCP_info Function"
# ptcl.get_sessionkey()
ptcl.show_dhcpinfo()

elif args.show_active == '.':
print "Calling show_active Function"
ptcl.show_active_dev()

else:
print "Invalid Argument"

import time
start_time = time.time()
Expand Down

0 comments on commit 3153472

Please sign in to comment.