diff --git a/s_tui/s_tui.py b/s_tui/s_tui.py index 76db817..f014786 100755 --- a/s_tui/s_tui.py +++ b/s_tui/s_tui.py @@ -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 @@ -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": @@ -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) @@ -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)) @@ -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") @@ -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()) ) @@ -641,7 +641,7 @@ 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, @@ -649,15 +649,15 @@ def _load_config(self, t_thresh): 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, @@ -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, @@ -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 @@ -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): @@ -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""" @@ -868,14 +868,14 @@ 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") @@ -883,7 +883,7 @@ def _save_displayed_setting(conf, submenu): 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): diff --git a/s_tui/sources/rapl_read.py b/s_tui/sources/rapl_read.py index 30f039c..c5dde5d 100644 --- a/s_tui/sources/rapl_read.py +++ b/s_tui/sources/rapl_read.py @@ -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 diff --git a/s_tui/sources/source.py b/s_tui/sources/source.py index 471b678..bb861e9 100644 --- a/s_tui/sources/source.py +++ b/s_tui/sources/source.py @@ -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): diff --git a/s_tui/sources/temp_source.py b/s_tui/sources/temp_source.py index e5e135e..7c918e5 100644 --- a/s_tui/sources/temp_source.py +++ b/s_tui/sources/temp_source.py @@ -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 diff --git a/s_tui/stress_menu.py b/s_tui/stress_menu.py index 0ad28a4..73cc61f 100644 --- a/s_tui/stress_menu.py +++ b/s_tui/stress_menu.py @@ -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 diff --git a/s_tui/sturwid/bar_graph_vector.py b/s_tui/sturwid/bar_graph_vector.py index 0805427..e2231cd 100644 --- a/s_tui/sturwid/bar_graph_vector.py +++ b/s_tui/sturwid/bar_graph_vector.py @@ -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: @@ -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]: diff --git a/s_tui/sturwid/complex_bar_graph.py b/s_tui/sturwid/complex_bar_graph.py index 09e3053..f1a46f1 100644 --- a/s_tui/sturwid/complex_bar_graph.py +++ b/s_tui/sturwid/complex_bar_graph.py @@ -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) diff --git a/s_tui/sturwid/summary_text_list.py b/s_tui/sturwid/summary_text_list.py index 90b5d85..760df91 100644 --- a/s_tui/sturwid/summary_text_list.py +++ b/s_tui/sturwid/summary_text_list.py @@ -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) @@ -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