Skip to content

Commit

Permalink
fix : autopep8 #48
Browse files Browse the repository at this point in the history
  • Loading branch information
sepandhaghighi committed Dec 27, 2020
1 parent 666d3c4 commit 87e9127
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions orangetool/orangetool_ram.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from .orangetool_params import GENERAL_ERROR_MESSAGE
from .orangetool_utils import convert_bytes


def ram_total(convert=True):
"""
Return total ram of board.
Expand Down
1 change: 1 addition & 0 deletions orangetool/orangetool_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def unmount_all(debug=False):
print(str(e))
return GENERAL_ERROR_MESSAGE


def mount(device_name, mount_address=None, debug=False):
"""
Mount memory devices by addresses.
Expand Down
14 changes: 10 additions & 4 deletions orangetool/orangetool_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def get_temp(zone=0, debug=False):
print(str(e))
return GENERAL_ERROR_MESSAGE

def time_control(mode="uptime",debug=False):

def time_control(mode="uptime", debug=False):
"""
Return system time.
Expand All @@ -65,7 +66,7 @@ def time_control(mode="uptime",debug=False):
:return: system time as string
"""
index = 0
if mode in ["idle","idletime"]:
if mode in ["idle", "idletime"]:
index = 1
try:
command = open("/proc/uptime")
Expand All @@ -76,6 +77,7 @@ def time_control(mode="uptime",debug=False):
print(str(e))
return GENERAL_ERROR_MESSAGE


def uptime(debug=False):
"""
Return system uptime.
Expand All @@ -84,7 +86,7 @@ def uptime(debug=False):
:type debug:bool
:return: system uptime as string
"""
return time_control(mode="uptime",debug=debug)
return time_control(mode="uptime", debug=debug)


def idletime(debug=False):
Expand Down Expand Up @@ -126,7 +128,11 @@ def wakeup(day=0, hour=0, minute=0, sync=True, debug=False):
"""
try:
if sync:
_ = sub.Popen("hwclock -w",stderr=sub.PIPE,stdout=sub.PIPE,stdin=sub.PIPE)
_ = sub.Popen(
"hwclock -w",
stderr=sub.PIPE,
stdout=sub.PIPE,
stdin=sub.PIPE)
total_time = day * 24 * 60 + hour * 60 + minute
epoch = time.time() + total_time * 60
file = open("/sys/class/rtc/rtc0/wakealarm", "w")
Expand Down
2 changes: 1 addition & 1 deletion orangetool/orangetool_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

if __name__ == "__main__":
version()
check_update()
check_update()
2 changes: 2 additions & 0 deletions orangetool/orangetool_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""Orangetool utils."""
import random


def zero_insert(input_string):
"""
Get a string as input if input is one digit add a zero.
Expand Down Expand Up @@ -49,6 +50,7 @@ def random_generator(number):
response += str(random.randint(0, 9))
return response


def convert_bytes(num):
"""
Convert num to idiomatic byte unit.
Expand Down

0 comments on commit 87e9127

Please sign in to comment.