Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #214

Merged
merged 1 commit into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions s_tui/s_tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
except ImportError:
import ConfigParser as configparser

# Menues
# Menus
from s_tui.about_menu import AboutMenu
from s_tui.help_menu import HelpMenu
from s_tui.help_menu import HELP_MESSAGE
Expand Down Expand Up @@ -110,13 +110,13 @@ class MainLoop(urwid.MainLoop):

def signal_handler(self, frame):
"""signal handler for properly exiting Ctrl+C"""
graph_controller.stress_conroller.kill_stress_process()
graph_controller.stress_controller.kill_stress_process()
raise urwid.ExitMainLoop()

def unhandled_input(self, uinput):
logging.debug("Caught %s", uinput)
if uinput == "q":
graph_controller.stress_conroller.kill_stress_process()
graph_controller.stress_controller.kill_stress_process()
raise urwid.ExitMainLoop()

if uinput == "f1":
Expand Down Expand Up @@ -276,7 +276,7 @@ def update_displayed_information(self):
pass

# Only update clock if not is stress mode
if self.controller.stress_conroller.get_current_mode() != "Monitor":
if self.controller.stress_controller.get_current_mode() != "Monitor":
self.clock_view.set_text(
seconds_to_text(
(timeit.default_timer() - self.controller.stress_start_time)
Expand Down Expand Up @@ -424,7 +424,7 @@ def on_exit_program(self, w=None):
def _generate_graph_controls(self):
"""Display sidebar controls. i.e. buttons, and controls"""
# setup mode radio buttons
stress_modes = self.controller.stress_conroller.get_modes()
stress_modes = self.controller.stress_controller.get_modes()
group = []
for mode in stress_modes:
self.mode_buttons.append(radio_button(group, mode, self.on_mode_button))
Expand Down Expand Up @@ -453,7 +453,7 @@ def _generate_graph_controls(self):
unicode_checkbox = urwid.CheckBox(
"UTF-8", state=default_smooth, on_state_change=self.on_unicode_checkbox
)
# Init the state of the graph accoding to the selected mode
# Init the state of the graph according to the selected mode
self.on_unicode_checkbox(state=default_smooth)
else:
unicode_checkbox = urwid.Text("[N/A] UTF-8")
Expand Down Expand Up @@ -514,7 +514,7 @@ def _generate_summaries(self):
return urwid.Pile(fixed_stats)

def show_graphs(self):
"""Show a pile of the graph selected for dislpay"""
"""Show a pile of the graph selected for display"""
elements = itertools.chain.from_iterable(
([graph] for graph in self.visible_graphs.values())
)
Expand Down Expand Up @@ -641,23 +641,23 @@ def _load_config(self, t_thresh):

# Load refresh refresh rate from config
try:
self.refresh_rate = str(self.conf.getfloat("GraphControll", "refresh"))
self.refresh_rate = str(self.conf.getfloat("GraphControl", "refresh"))
logging.debug("User refresh rate: %s", self.refresh_rate)
except (
AttributeError,
ValueError,
configparser.NoOptionError,
configparser.NoSectionError,
):
logging.debug("No refresh rate configed")
logging.debug("No refresh rate configured")

# Change UTF8 setting from config
try:
if self.conf.getboolean("GraphControll", "UTF8"):
if self.conf.getboolean("GraphControl", "UTF8"):
self.smooth_graph_mode = True
else:
logging.debug(
"UTF8 selected as %s", self.conf.get("GraphControll", "UTF8")
"UTF8 selected as %s", self.conf.get("GraphControl", "UTF8")
)
except (
AttributeError,
Expand All @@ -670,7 +670,7 @@ def _load_config(self, t_thresh):
# Try to load high temperature threshold if configured
if t_thresh is None:
try:
self.temp_thresh = self.conf.get("GraphControll", "TTHRESH")
self.temp_thresh = self.conf.get("GraphControl", "TTHRESH")
logging.debug("Temperature threshold set to %s", self.temp_thresh)
except (
AttributeError,
Expand Down Expand Up @@ -760,7 +760,7 @@ def __init__(self, args):
# Needed for use in view
self.args = args

self.stress_conroller = self._config_stress()
self.stress_controller = self._config_stress()

self.handle_mouse = not args.no_mouse

Expand All @@ -785,7 +785,7 @@ def __init__(self, args):

def set_mode(self, mode):
"""Allow our view to set the mode."""
self.stress_conroller.set_mode(mode)
self.stress_controller.set_mode(mode)
self.update_stress_mode()

def main(self):
Expand Down Expand Up @@ -822,19 +822,19 @@ def main(self):
def update_stress_mode(self):
"""Updates stress mode according to radio buttons state"""

self.stress_conroller.kill_stress_process()
self.stress_controller.kill_stress_process()

# Start a new clock upon starting a new stress test
self.view.clock_view.set_text(ZERO_TIME)
self.stress_start_time = timeit.default_timer()

if self.stress_conroller.get_current_mode() == "Stress":
if self.stress_controller.get_current_mode() == "Stress":
stress_cmd = self.view.stress_menu.get_stress_cmd()
self.stress_conroller.start_stress(stress_cmd)
self.stress_controller.start_stress(stress_cmd)

elif self.stress_conroller.get_current_mode() == "FIRESTARTER":
elif self.stress_controller.get_current_mode() == "FIRESTARTER":
stress_cmd = [self.firestarter]
self.stress_conroller.start_stress(stress_cmd)
self.stress_controller.start_stress(stress_cmd)

def save_settings(self):
"""Save the current configuration to a user config file"""
Expand Down Expand Up @@ -868,22 +868,22 @@ def _save_displayed_setting(conf, submenu):
conf = configparser.ConfigParser()
config_file = get_user_config_file()
with open(config_file, "w") as cfgfile:
conf.add_section("GraphControll")
conf.add_section("GraphControl")
# Save the configured refresh rete
conf.set("GraphControll", "refresh", str(self.refresh_rate))
conf.set("GraphControl", "refresh", str(self.refresh_rate))
# Save the configured UTF8 setting
conf.set("GraphControll", "UTF8", str(self.smooth_graph_mode))
conf.set("GraphControl", "UTF8", str(self.smooth_graph_mode))
# Save the configured t_thresh
if self.temp_thresh:
conf.set("GraphControll", "TTHRESH", str(self.temp_thresh))
conf.set("GraphControl", "TTHRESH", str(self.temp_thresh))

_save_displayed_setting(conf, "Graphs")
_save_displayed_setting(conf, "Summaries")
conf.write(cfgfile)

def exit_program(self):
"""Kill all stress operations upon exit"""
self.stress_conroller.kill_stress_process()
self.stress_controller.kill_stress_process()
raise urwid.ExitMainLoop()

def animate_graph(self, loop, user_data=None):
Expand Down
2 changes: 1 addition & 1 deletion s_tui/sources/rapl_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def available():
# all_info = cpuinfo.readlines()
# for line in all_info:
# if b"vendor_id" in line:
# print("Verndor id", line)
# print("Vendor id", line)
# if b"AuthenticAMD" not in line:
# return False

Expand Down
2 changes: 1 addition & 1 deletion s_tui/sources/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_maximum(self):
raise NotImplementedError("Get maximum is not implemented")

def get_top(self):
"""Returns higest theoretical value the sensors can reach"""
"""Returns highest theoretical value the sensors can reach"""
raise NotImplementedError("get_top is not implemented")

def get_is_available(self):
Expand Down
2 changes: 1 addition & 1 deletion s_tui/sources/temp_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


class TempSource(Source):
"""This class inherits a source and implements a temprature source"""
"""This class inherits a source and implements a temperature source"""

THRESHOLD_TEMP = 80

Expand Down
2 changes: 1 addition & 1 deletion s_tui/stress_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA

"""A class to control the optoins of stress in a menu
"""A class to control the options of stress in a menu
"""

from __future__ import print_function
Expand Down
4 changes: 2 additions & 2 deletions s_tui/sturwid/bar_graph_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def get_is_available(self):
return self.source.get_is_available()

def get_label_scale(self, min_val, max_val, size):
"""Dynamically change the scale of the graph (y lable)"""
"""Dynamically change the scale of the graph (y label)"""
if size < self.SCALE_DENSITY:
label_cnt = 1
else:
Expand Down Expand Up @@ -171,7 +171,7 @@ def update(self):
try:
_ = self.visible_graph_list[graph_idx]
except IndexError:
# If a new graph "Appers", append it to visibles
# If a new graph "Appears", append it to visible
self.visible_graph_list.append(True)
bars = []
if self.visible_graph_list[graph_idx]:
Expand Down
2 changes: 1 addition & 1 deletion s_tui/sturwid/complex_bar_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@


class ScalableBarGraph(urwid.BarGraph):
"""Scale the graph acording to screen size"""
"""Scale the graph according to screen size"""

_size = (0, 0)

Expand Down
4 changes: 2 additions & 2 deletions s_tui/sturwid/summary_text_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get_text_item_list(self):
try:
_ = self.visible_summaries[key]
except KeyError:
# If an unkonwn key appers, add it to list
# If an unknown key appears, add it to list
self.visible_summaries[key] = True
if self.visible_summaries[key]:
summery_text_list.append(col_w)
Expand All @@ -57,7 +57,7 @@ def get_text_item_list(self):
def update_visibility(self, visible_sensors):
keys = list(self.visible_summaries.keys())
self.visible_summaries[keys[0]] = any(visible_sensors)
# Do not change visiblity of title
# Do not change visibility of title
for sensor, visible in zip(keys[1:], visible_sensors):
self.visible_summaries[sensor] = visible

Expand Down