Skip to content

Commit

Permalink
fix : autopep8 #35
Browse files Browse the repository at this point in the history
  • Loading branch information
sepandhaghighi committed Dec 28, 2020
1 parent 01f3ffd commit 20be870
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions orangetool/orangetool_ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ def mac(debug=False):
print(str(e))
return GENERAL_ERROR_MESSAGE


def network_control(command, device="eth0", debug=False):
"""
Control network adaptor.
Expand All @@ -198,7 +199,7 @@ def network_control(command, device="eth0", debug=False):
if command == "down":
cmd = "down"
output = sub.Popen(["ifconfig", device, cmd],
stderr=sub.PIPE, stdin=sub.PIPE, stdout=sub.PIPE)
stderr=sub.PIPE, stdin=sub.PIPE, stdout=sub.PIPE)
if len(output[0]) == 0 and len(output[1]) == 0:
return True
return False
Expand All @@ -207,6 +208,7 @@ def network_control(command, device="eth0", debug=False):
print(str(e))
return GENERAL_ERROR_MESSAGE


def network_enable(device="eth0", debug=False):
"""
Shortcut to enable network adaptor.
Expand All @@ -217,7 +219,8 @@ def network_enable(device="eth0", debug=False):
:type debug:bool
:return: True in successful and False otherwise
"""
return network_control("up",device=device,debug=debug)
return network_control("up", device=device, debug=debug)


def network_disable(device="eth0", debug=False):
"""
Expand Down
2 changes: 1 addition & 1 deletion orangetool/orangetool_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def wakeup(day=0, hour=0, minute=0, sync=True, debug=False):
try:
if sync:
_ = sub.Popen(
["hwclock","-w"],
["hwclock", "-w"],
stderr=sub.PIPE,
stdout=sub.PIPE,
stdin=sub.PIPE)
Expand Down

0 comments on commit 20be870

Please sign in to comment.