[tor-commits] [arm/master] Making arm PEP8 compliant

atagar at torproject.org atagar at torproject.org
Sun Jan 19 00:34:25 UTC 2014


commit 56869756899356854bae7804690de99cf78fac5f
Author: Damian Johnson <atagar at torproject.org>
Date:   Sat Jan 11 20:51:05 2014 -0800

    Making arm PEP8 compliant
    
    Yikes, that was a bigger project than I expected. Arm is a big codebase, and
    this overhauls a huge portion of it. This was done in a couple steps...
    
    1. Use sed to change are camelcase variables and functions to the underscore
       convention...
    
       grep -ilr 'old_name' arm/* | xargs -i@ sed -i 's/old_name/new_name/g' @
    
    2. Remove files from the PEP8 blacklist and correct all the issues.
---
 arm/__init__.py                    |    1 -
 arm/configPanel.py                 |  674 +++++++++++---------
 arm/connections/__init__.py        |    3 +-
 arm/connections/circEntry.py       |  168 ++---
 arm/connections/connEntry.py       |  803 +++++++++++++-----------
 arm/connections/connPanel.py       |  563 +++++++++--------
 arm/connections/countPopup.py      |   83 +--
 arm/connections/descriptorPopup.py |  273 ++++----
 arm/connections/entries.py         |  128 ++--
 arm/controller.py                  |  449 ++++++++------
 arm/graphing/__init__.py           |    3 +-
 arm/graphing/bandwidthStats.py     |  458 ++++++++------
 arm/graphing/connStats.py          |   68 +-
 arm/graphing/graphPanel.py         |  452 ++++++++------
 arm/graphing/resourceStats.py      |   51 +-
 arm/headerPanel.py                 |  602 ++++++++++--------
 arm/logPanel.py                    | 1200 +++++++++++++++++++++---------------
 arm/menu/__init__.py               |    1 -
 arm/menu/actions.py                |  283 +++++----
 arm/menu/item.py                   |   90 +--
 arm/menu/menu.py                   |  177 +++---
 arm/popups.py                      |  281 +++++----
 arm/starter.py                     |    4 +-
 arm/torrcPanel.py                  |  356 ++++++-----
 arm/util/panel.py                  |  470 ++++++++------
 arm/util/textInput.py              |  118 ++--
 arm/util/torConfig.py              |  997 ++++++++++++++++++------------
 arm/util/torTools.py               |  618 ++++++++++---------
 arm/util/uiTools.py                |  431 ++++++++-----
 test/settings.cfg                  |   39 --
 30 files changed, 5646 insertions(+), 4198 deletions(-)

diff --git a/arm/__init__.py b/arm/__init__.py
index ec6e69a..8147e38 100644
--- a/arm/__init__.py
+++ b/arm/__init__.py
@@ -6,4 +6,3 @@ __all__ = ["starter", "prereq", "version", "configPanel", "controller", "headerP
 
 __version__ = '1.4.6_dev'
 __release_date__ = 'April 28, 2011'
-
diff --git a/arm/configPanel.py b/arm/configPanel.py
index c0fb974..d78d4d4 100644
--- a/arm/configPanel.py
+++ b/arm/configPanel.py
@@ -18,31 +18,48 @@ from stem.util import conf, enum, str_tools
 # TODO: The arm use cases are incomplete since they currently can't be
 # modified, have their descriptions fetched, or even get a complete listing
 # of what's available.
-State = enum.Enum("TOR", "ARM") # state to be presented
+
+State = enum.Enum("TOR", "ARM")  # state to be presented
 
 # mappings of option categories to the color for their entries
-CATEGORY_COLOR = {torConfig.Category.GENERAL: "green",
-                  torConfig.Category.CLIENT: "blue",
-                  torConfig.Category.RELAY: "yellow",
-                  torConfig.Category.DIRECTORY: "magenta",
-                  torConfig.Category.AUTHORITY: "red",
-                  torConfig.Category.HIDDEN_SERVICE: "cyan",
-                  torConfig.Category.TESTING: "white",
-                  torConfig.Category.UNKNOWN: "white"}
+
+CATEGORY_COLOR = {
+  torConfig.Category.GENERAL: "green",
+  torConfig.Category.CLIENT: "blue",
+  torConfig.Category.RELAY: "yellow",
+  torConfig.Category.DIRECTORY: "magenta",
+  torConfig.Category.AUTHORITY: "red",
+  torConfig.Category.HIDDEN_SERVICE: "cyan",
+  torConfig.Category.TESTING: "white",
+  torConfig.Category.UNKNOWN: "white",
+}
 
 # attributes of a ConfigEntry
-Field = enum.Enum("CATEGORY", "OPTION", "VALUE", "TYPE", "ARG_USAGE",
-                  "SUMMARY", "DESCRIPTION", "MAN_ENTRY", "IS_DEFAULT")
-
-FIELD_ATTR = {Field.CATEGORY: ("Category", "red"),
-              Field.OPTION: ("Option Name", "blue"),
-              Field.VALUE: ("Value", "cyan"),
-              Field.TYPE: ("Arg Type", "green"),
-              Field.ARG_USAGE: ("Arg Usage", "yellow"),
-              Field.SUMMARY: ("Summary", "green"),
-              Field.DESCRIPTION: ("Description", "white"),
-              Field.MAN_ENTRY: ("Man Page Entry", "blue"),
-              Field.IS_DEFAULT: ("Is Default", "magenta")}
+
+Field = enum.Enum(
+  "CATEGORY",
+  "OPTION",
+  "VALUE",
+  "TYPE",
+  "ARG_USAGE",
+  "SUMMARY",
+  "DESCRIPTION",
+  "MAN_ENTRY",
+  "IS_DEFAULT",
+)
+
+FIELD_ATTR = {
+  Field.CATEGORY: ("Category", "red"),
+  Field.OPTION: ("Option Name", "blue"),
+  Field.VALUE: ("Value", "cyan"),
+  Field.TYPE: ("Arg Type", "green"),
+  Field.ARG_USAGE: ("Arg Usage", "yellow"),
+  Field.SUMMARY: ("Summary", "green"),
+  Field.DESCRIPTION: ("Description", "white"),
+  Field.MAN_ENTRY: ("Man Page Entry", "blue"),
+  Field.IS_DEFAULT: ("Is Default", "magenta"),
+}
+
 
 def conf_handler(key, value):
   if key == "features.config.selectionDetails.height":
@@ -54,6 +71,7 @@ def conf_handler(key, value):
   elif key == "features.config.order":
     return conf.parse_enum_csv(key, value[0], Field, 3)
 
+
 CONFIG = conf.config_dict("arm", {
   "features.config.order": [Field.MAN_ENTRY, Field.OPTION, Field.IS_DEFAULT],
   "features.config.selectionDetails.height": 6,
@@ -64,49 +82,54 @@ CONFIG = conf.config_dict("arm", {
   "features.config.state.colWidth.value": 15,
 }, conf_handler)
 
-def getFieldFromLabel(fieldLabel):
+
+def get_field_from_label(field_label):
   """
   Converts field labels back to their enumeration, raising a ValueError if it
   doesn't exist.
   """
 
-  for entryEnum in FIELD_ATTR:
-    if fieldLabel == FIELD_ATTR[entryEnum][0]:
-      return entryEnum
+  for entry_enum in FIELD_ATTR:
+    if field_label == FIELD_ATTR[entry_enum][0]:
+      return entry_enum
+
 
 class ConfigEntry():
   """
   Configuration option in the panel.
   """
 
-  def __init__(self, option, type, isDefault):
+  def __init__(self, option, type, is_default):
     self.fields = {}
     self.fields[Field.OPTION] = option
     self.fields[Field.TYPE] = type
-    self.fields[Field.IS_DEFAULT] = isDefault
+    self.fields[Field.IS_DEFAULT] = is_default
 
     # Fetches extra infromation from external sources (the arm config and tor
     # man page). These are None if unavailable for this config option.
-    summary = torConfig.getConfigSummary(option)
-    manEntry = torConfig.getConfigDescription(option)
-
-    if manEntry:
-      self.fields[Field.MAN_ENTRY] = manEntry.index
-      self.fields[Field.CATEGORY] = manEntry.category
-      self.fields[Field.ARG_USAGE] = manEntry.argUsage
-      self.fields[Field.DESCRIPTION] = manEntry.description
+
+    summary = torConfig.get_config_summary(option)
+    man_entry = torConfig.get_config_description(option)
+
+    if man_entry:
+      self.fields[Field.MAN_ENTRY] = man_entry.index
+      self.fields[Field.CATEGORY] = man_entry.category
+      self.fields[Field.ARG_USAGE] = man_entry.arg_usage
+      self.fields[Field.DESCRIPTION] = man_entry.description
     else:
-      self.fields[Field.MAN_ENTRY] = 99999 # sorts non-man entries last
+      self.fields[Field.MAN_ENTRY] = 99999  # sorts non-man entries last
       self.fields[Field.CATEGORY] = torConfig.Category.UNKNOWN
       self.fields[Field.ARG_USAGE] = ""
       self.fields[Field.DESCRIPTION] = ""
 
     # uses the full man page description if a summary is unavailable
-    self.fields[Field.SUMMARY] = summary if summary != None else self.fields[Field.DESCRIPTION]
+
+    self.fields[Field.SUMMARY] = summary if summary is not None else self.fields[Field.DESCRIPTION]
 
     # cache of what's displayed for this configuration option
-    self.labelCache = None
-    self.labelCacheArgs = None
+
+    self.label_cache = None
+    self.label_cache_args = None
 
   def get(self, field):
     """
@@ -116,10 +139,12 @@ class ConfigEntry():
       field - enum for the field to be provided back
     """
 
-    if field == Field.VALUE: return self._getValue()
-    else: return self.fields[field]
+    if field == Field.VALUE:
+      return self._get_value()
+    else:
+      return self.fields[field]
 
-  def getAll(self, fields):
+  def get_all(self, fields):
     """
     Provides back a list with the given field values.
 
@@ -129,58 +154,63 @@ class ConfigEntry():
 
     return [self.get(field) for field in fields]
 
-  def getLabel(self, optionWidth, valueWidth, summaryWidth):
+  def get_label(self, option_width, value_width, summary_width):
     """
     Provides display string of the configuration entry with the given
     constraints on the width of the contents.
 
     Arguments:
-      optionWidth  - width of the option column
-      valueWidth   - width of the value column
-      summaryWidth - width of the summary column
+      option_width  - width of the option column
+      value_width   - width of the value column
+      summary_width - width of the summary column
     """
 
     # Fetching the display entries is very common so this caches the values.
     # Doing this substantially drops cpu usage when scrolling (by around 40%).
 
-    argSet = (optionWidth, valueWidth, summaryWidth)
-    if not self.labelCache or self.labelCacheArgs != argSet:
-      optionLabel = uiTools.cropStr(self.get(Field.OPTION), optionWidth)
-      valueLabel = uiTools.cropStr(self.get(Field.VALUE), valueWidth)
-      summaryLabel = uiTools.cropStr(self.get(Field.SUMMARY), summaryWidth, None)
-      lineTextLayout = "%%-%is %%-%is %%-%is" % (optionWidth, valueWidth, summaryWidth)
-      self.labelCache = lineTextLayout % (optionLabel, valueLabel, summaryLabel)
-      self.labelCacheArgs = argSet
+    arg_set = (option_width, value_width, summary_width)
+
+    if not self.label_cache or self.label_cache_args != arg_set:
+      option_label = uiTools.crop_str(self.get(Field.OPTION), option_width)
+      value_label = uiTools.crop_str(self.get(Field.VALUE), value_width)
+      summary_label = uiTools.crop_str(self.get(Field.SUMMARY), summary_width, None)
+      line_text_layout = "%%-%is %%-%is %%-%is" % (option_width, value_width, summary_width)
+      self.label_cache = line_text_layout % (option_label, value_label, summary_label)
+      self.label_cache_args = arg_set
 
-    return self.labelCache
+    return self.label_cache
 
-  def isUnset(self):
+  def is_unset(self):
     """
     True if we have no value, false otherwise.
     """
 
-    confValue = torTools.getConn().getOption(self.get(Field.OPTION), [], True)
-    return not bool(confValue)
+    conf_value = torTools.get_conn().get_option(self.get(Field.OPTION), [], True)
 
-  def _getValue(self):
+    return not bool(conf_value)
+
+  def _get_value(self):
     """
     Provides the current value of the configuration entry, taking advantage of
     the torTools caching to effectively query the accurate value. This uses the
     value's type to provide a user friendly representation if able.
     """
 
-    confValue = ", ".join(torTools.getConn().getOption(self.get(Field.OPTION), [], True))
+    conf_value = ", ".join(torTools.get_conn().get_option(self.get(Field.OPTION), [], True))
 
     # provides nicer values for recognized types
-    if not confValue: confValue = "<none>"
-    elif self.get(Field.TYPE) == "Boolean" and confValue in ("0", "1"):
-      confValue = "False" if confValue == "0" else "True"
-    elif self.get(Field.TYPE) == "DataSize" and confValue.isdigit():
-      confValue = str_tools.get_size_label(int(confValue))
-    elif self.get(Field.TYPE) == "TimeInterval" and confValue.isdigit():
-      confValue = str_tools.get_time_label(int(confValue), is_long = True)
 
-    return confValue
+    if not conf_value:
+      conf_value = "<none>"
+    elif self.get(Field.TYPE) == "Boolean" and conf_value in ("0", "1"):
+      conf_value = "False" if conf_value == "0" else "True"
+    elif self.get(Field.TYPE) == "DataSize" and conf_value.isdigit():
+      conf_value = str_tools.get_size_label(int(conf_value))
+    elif self.get(Field.TYPE) == "TimeInterval" and conf_value.isdigit():
+      conf_value = str_tools.get_time_label(int(conf_value), is_long = True)
+
+    return conf_value
+
 
 class ConfigPanel(panel.Panel):
   """
@@ -188,99 +218,111 @@ class ConfigPanel(panel.Panel):
   be selected and edited.
   """
 
-  def __init__(self, stdscr, configType):
+  def __init__(self, stdscr, config_type):
     panel.Panel.__init__(self, stdscr, "configuration", 0)
 
-    self.configType = configType
-    self.confContents = []
-    self.confImportantContents = []
+    self.config_type = config_type
+    self.conf_contents = []
+    self.conf_important_contents = []
     self.scroller = uiTools.Scroller(True)
-    self.valsLock = threading.RLock()
+    self.vals_lock = threading.RLock()
 
     # shows all configuration options if true, otherwise only the ones with
     # the 'important' flag are shown
-    self.showAll = False
+
+    self.show_all = False
 
     # initializes config contents if we're connected
-    conn = torTools.getConn()
-    conn.addStatusListener(self.resetListener)
-    if conn.isAlive(): self.resetListener(None, stem.control.State.INIT, None)
 
-  def resetListener(self, controller, eventType, _):
+    conn = torTools.get_conn()
+    conn.add_status_listener(self.reset_listener)
+
+    if conn.is_alive():
+      self.reset_listener(None, stem.control.State.INIT, None)
+
+  def reset_listener(self, controller, event_type, _):
     # fetches configuration options if a new instance, otherewise keeps our
     # current contents
 
-    if eventType == stem.control.State.INIT:
-      self._loadConfigOptions()
+    if event_type == stem.control.State.INIT:
+      self._load_config_options()
 
-  def _loadConfigOptions(self):
+  def _load_config_options(self):
     """
     Fetches the configuration options available from tor or arm.
     """
 
-    self.confContents = []
-    self.confImportantContents = []
+    self.conf_contents = []
+    self.conf_important_contents = []
 
-    if self.configType == State.TOR:
-      conn, configOptionLines = torTools.getConn(), []
-      customOptions = torConfig.getCustomOptions()
-      configOptionQuery = conn.getInfo("config/names", None)
+    if self.config_type == State.TOR:
+      conn, config_option_lines = torTools.get_conn(), []
+      custom_options = torConfig.get_custom_options()
+      config_option_query = conn.get_info("config/names", None)
 
-      if configOptionQuery:
-        configOptionLines = configOptionQuery.strip().split("\n")
+      if config_option_query:
+        config_option_lines = config_option_query.strip().split("\n")
 
-      for line in configOptionLines:
+      for line in config_option_lines:
         # lines are of the form "<option> <type>[ <documentation>]", like:
         # UseEntryGuards Boolean
         # documentation is aparently only in older versions (for instance,
         # 0.2.1.25)
-        lineComp = line.strip().split(" ")
-        confOption, confType = lineComp[0], lineComp[1]
+
+        line_comp = line.strip().split(" ")
+        conf_option, conf_type = line_comp[0], line_comp[1]
 
         # skips private and virtual entries if not configured to show them
-        if not CONFIG["features.config.state.showPrivateOptions"] and confOption.startswith("__"):
+
+        if not CONFIG["features.config.state.showPrivateOptions"] and conf_option.startswith("__"):
           continue
-        elif not CONFIG["features.config.state.showVirtualOptions"] and confType == "Virtual":
+        elif not CONFIG["features.config.state.showVirtualOptions"] and conf_type == "Virtual":
           continue
 
-        self.confContents.append(ConfigEntry(confOption, confType, not confOption in customOptions))
-    elif self.configType == State.ARM:
+        self.conf_contents.append(ConfigEntry(conf_option, conf_type, not conf_option in custom_options))
+
+    elif self.config_type == State.ARM:
       # loaded via the conf utility
-      armConf = conf.get_config("arm")
-      for key in armConf.keys():
-        pass # TODO: implement
+
+      arm_config = conf.get_config("arm")
+
+      for key in arm_config.keys():
+        pass  # TODO: implement
 
     # mirror listing with only the important configuration options
-    self.confImportantContents = []
-    for entry in self.confContents:
-      if torConfig.isImportant(entry.get(Field.OPTION)):
-        self.confImportantContents.append(entry)
+
+    self.conf_important_contents = []
+
+    for entry in self.conf_contents:
+      if torConfig.is_important(entry.get(Field.OPTION)):
+        self.conf_important_contents.append(entry)
 
     # if there aren't any important options then show everything
-    if not self.confImportantContents:
-      self.confImportantContents = self.confContents
 
-    self.setSortOrder() # initial sorting of the contents
+    if not self.conf_important_contents:
+      self.conf_important_contents = self.conf_contents
+
+    self.set_sort_order()  # initial sorting of the contents
 
-  def getSelection(self):
+  def get_selection(self):
     """
     Provides the currently selected entry.
     """
 
-    return self.scroller.getCursorSelection(self._getConfigOptions())
+    return self.scroller.get_cursor_selection(self._get_config_options())
 
-  def setFiltering(self, isFiltered):
+  def set_filtering(self, is_filtered):
     """
     Sets if configuration options are filtered or not.
 
     Arguments:
-      isFiltered - if true then only relatively important options will be
+      is_filtered - if true then only relatively important options will be
                    shown, otherwise everything is shown
     """
 
-    self.showAll = not isFiltered
+    self.show_all = not is_filtered
 
-  def setSortOrder(self, ordering = None):
+  def set_sort_order(self, ordering = None):
     """
     Sets the configuration attributes we're sorting by and resorts the
     contents.
@@ -290,133 +332,163 @@ class ConfigPanel(panel.Panel):
                  set ordering
     """
 
-    self.valsLock.acquire()
-    if ordering: CONFIG["features.config.order"] = ordering
-    self.confContents.sort(key=lambda i: (i.getAll(CONFIG["features.config.order"])))
-    self.confImportantContents.sort(key=lambda i: (i.getAll(CONFIG["features.config.order"])))
-    self.valsLock.release()
+    self.vals_lock.acquire()
+
+    if ordering:
+      CONFIG["features.config.order"] = ordering
 
-  def showSortDialog(self):
+    self.conf_contents.sort(key=lambda i: (i.get_all(CONFIG["features.config.order"])))
+    self.conf_important_contents.sort(key=lambda i: (i.get_all(CONFIG["features.config.order"])))
+    self.vals_lock.release()
+
+  def show_sort_dialog(self):
     """
     Provides the sort dialog for our configuration options.
     """
 
     # set ordering for config options
-    titleLabel = "Config Option Ordering:"
+
+    title_label = "Config Option Ordering:"
     options = [FIELD_ATTR[field][0] for field in Field]
-    oldSelection = [FIELD_ATTR[field][0] for field in CONFIG["features.config.order"]]
-    optionColors = dict([FIELD_ATTR[field] for field in Field])
-    results = popups.showSortDialog(titleLabel, options, oldSelection, optionColors)
+    old_selection = [FIELD_ATTR[field][0] for field in CONFIG["features.config.order"]]
+    option_colors = dict([FIELD_ATTR[field] for field in Field])
+    results = popups.show_sort_dialog(title_label, options, old_selection, option_colors)
 
     if results:
       # converts labels back to enums
-      resultEnums = [getFieldFromLabel(label) for label in results]
-      self.setSortOrder(resultEnums)
-
-  def handleKey(self, key):
-    self.valsLock.acquire()
-    isKeystrokeConsumed = True
-    if uiTools.isScrollKey(key):
-      pageHeight = self.getPreferredSize()[0] - 1
-      detailPanelHeight = CONFIG["features.config.selectionDetails.height"]
-      if detailPanelHeight > 0 and detailPanelHeight + 2 <= pageHeight:
-        pageHeight -= (detailPanelHeight + 1)
-
-      isChanged = self.scroller.handleKey(key, self._getConfigOptions(), pageHeight)
-      if isChanged: self.redraw(True)
-    elif uiTools.isSelectionKey(key) and self._getConfigOptions():
+      result_enums = [get_field_from_label(label) for label in results]
+      self.set_sort_order(result_enums)
+
+  def handle_key(self, key):
+    self.vals_lock.acquire()
+    is_keystroke_consumed = True
+
+    if uiTools.is_scroll_key(key):
+      page_height = self.get_preferred_size()[0] - 1
+      detail_panel_height = CONFIG["features.config.selectionDetails.height"]
+
+      if detail_panel_height > 0 and detail_panel_height + 2 <= page_height:
+        page_height -= (detail_panel_height + 1)
+
+      is_changed = self.scroller.handle_key(key, self._get_config_options(), page_height)
+
+      if is_changed:
+        self.redraw(True)
+    elif uiTools.is_selection_key(key) and self._get_config_options():
       # Prompts the user to edit the selected configuration value. The
       # interface is locked to prevent updates between setting the value
       # and showing any errors.
 
       panel.CURSES_LOCK.acquire()
+
       try:
-        selection = self.getSelection()
-        configOption = selection.get(Field.OPTION)
-        if selection.isUnset(): initialValue = ""
-        else: initialValue = selection.get(Field.VALUE)
+        selection = self.get_selection()
+        config_option = selection.get(Field.OPTION)
+
+        if selection.is_unset():
+          initial_value = ""
+        else:
+          initial_value = selection.get(Field.VALUE)
 
-        promptMsg = "%s Value (esc to cancel): " % configOption
-        isPrepopulated = CONFIG["features.config.prepopulateEditValues"]
-        newValue = popups.inputPrompt(promptMsg, initialValue if isPrepopulated else "")
+        prompt_msg = "%s Value (esc to cancel): " % config_option
+        is_prepopulated = CONFIG["features.config.prepopulateEditValues"]
+        new_value = popups.input_prompt(prompt_msg, initial_value if is_prepopulated else "")
 
-        if newValue != None and newValue != initialValue:
+        if new_value is not None and new_value != initial_value:
           try:
             if selection.get(Field.TYPE) == "Boolean":
               # if the value's a boolean then allow for 'true' and 'false' inputs
-              if newValue.lower() == "true": newValue = "1"
-              elif newValue.lower() == "false": newValue = "0"
+
+              if new_value.lower() == "true":
+                new_value = "1"
+              elif new_value.lower() == "false":
+                new_value = "0"
             elif selection.get(Field.TYPE) == "LineList":
-              # setOption accepts list inputs when there's multiple values
-              newValue = newValue.split(",")
+              # set_option accepts list inputs when there's multiple values
+              new_value = new_value.split(",")
 
-            torTools.getConn().setOption(configOption, newValue)
+            torTools.get_conn().set_option(config_option, new_value)
 
             # forces the label to be remade with the new value
-            selection.labelCache = None
 
-            # resets the isDefault flag
-            customOptions = torConfig.getCustomOptions()
-            selection.fields[Field.IS_DEFAULT] = not configOption in customOptions
+            selection.label_cache = None
+
+            # resets the is_default flag
+
+            custom_options = torConfig.get_custom_options()
+            selection.fields[Field.IS_DEFAULT] = not config_option in custom_options
 
             self.redraw(True)
-          except Exception, exc:
-            popups.showMsg("%s (press any key)" % exc)
+          except Exception as exc:
+            popups.show_msg("%s (press any key)" % exc)
       finally:
         panel.CURSES_LOCK.release()
     elif key == ord('a') or key == ord('A'):
-      self.showAll = not self.showAll
+      self.show_all = not self.show_all
       self.redraw(True)
     elif key == ord('s') or key == ord('S'):
-      self.showSortDialog()
+      self.show_sort_dialog()
     elif key == ord('v') or key == ord('V'):
-      self.showWriteDialog()
-    else: isKeystrokeConsumed = False
+      self.show_write_dialog()
+    else:
+      is_keystroke_consumed = False
 
-    self.valsLock.release()
-    return isKeystrokeConsumed
+    self.vals_lock.release()
+    return is_keystroke_consumed
 
-  def showWriteDialog(self):
+  def show_write_dialog(self):
     """
     Provies an interface to confirm if the configuration is saved and, if so,
     where.
     """
 
     # display a popup for saving the current configuration
-    configLines = torConfig.getCustomOptions(True)
-    popup, width, height = popups.init(len(configLines) + 2)
-    if not popup: return
+
+    config_lines = torConfig.get_custom_options(True)
+    popup, width, height = popups.init(len(config_lines) + 2)
+
+    if not popup:
+      return
 
     try:
       # displayed options (truncating the labels if there's limited room)
-      if width >= 30: selectionOptions = ("Save", "Save As...", "Cancel")
-      else: selectionOptions = ("Save", "Save As", "X")
+
+      if width >= 30:
+        selection_options = ("Save", "Save As...", "Cancel")
+      else:
+        selection_options = ("Save", "Save As", "X")
 
       # checks if we can show options beside the last line of visible content
-      isOptionLineSeparate = False
-      lastIndex = min(height - 2, len(configLines) - 1)
+
+      is_option_line_separate = False
+      last_index = min(height - 2, len(config_lines) - 1)
 
       # if we don't have room to display the selection options and room to
       # grow then display the selection options on its own line
-      if width < (30 + len(configLines[lastIndex])):
-        popup.setHeight(height + 1)
-        popup.redraw(True) # recreates the window instance
-        newHeight, _ = popup.getPreferredSize()
 
-        if newHeight > height:
-          height = newHeight
-          isOptionLineSeparate = True
+      if width < (30 + len(config_lines[last_index])):
+        popup.set_height(height + 1)
+        popup.redraw(True)  # recreates the window instance
+        new_height, _ = popup.get_preferred_size()
+
+        if new_height > height:
+          height = new_height
+          is_option_line_separate = True
 
       key, selection = 0, 2
-      while not uiTools.isSelectionKey(key):
+
+      while not uiTools.is_selection_key(key):
         # if the popup has been resized then recreate it (needed for the
         # proper border height)
-        newHeight, newWidth = popup.getPreferredSize()
-        if (height, width) != (newHeight, newWidth):
-          height, width = newHeight, newWidth
+
+        new_height, new_width = popup.get_preferred_size()
+
+        if (height, width) != (new_height, new_width):
+          height, width = new_height, new_width
           popup.redraw(True)
 
         # if there isn't room to display the popup then cancel it
+
         if height <= 2:
           selection = 2
           break
@@ -425,61 +497,75 @@ class ConfigPanel(panel.Panel):
         popup.win.box()
         popup.addstr(0, 0, "Configuration being saved:", curses.A_STANDOUT)
 
-        visibleConfigLines = height - 3 if isOptionLineSeparate else height - 2
-        for i in range(visibleConfigLines):
-          line = uiTools.cropStr(configLines[i], width - 2)
+        visible_config_lines = height - 3 if is_option_line_separate else height - 2
+
+        for i in range(visible_config_lines):
+          line = uiTools.crop_str(config_lines[i], width - 2)
 
           if " " in line:
             option, arg = line.split(" ", 1)
-            popup.addstr(i + 1, 1, option, curses.A_BOLD | uiTools.getColor("green"))
-            popup.addstr(i + 1, len(option) + 2, arg, curses.A_BOLD | uiTools.getColor("cyan"))
+            popup.addstr(i + 1, 1, option, curses.A_BOLD | uiTools.get_color("green"))
+            popup.addstr(i + 1, len(option) + 2, arg, curses.A_BOLD | uiTools.get_color("cyan"))
           else:
-            popup.addstr(i + 1, 1, line, curses.A_BOLD | uiTools.getColor("green"))
+            popup.addstr(i + 1, 1, line, curses.A_BOLD | uiTools.get_color("green"))
 
         # draws selection options (drawn right to left)
-        drawX = width - 1
-        for i in range(len(selectionOptions) - 1, -1, -1):
-          optionLabel = selectionOptions[i]
-          drawX -= (len(optionLabel) + 2)
+
+        draw_x = width - 1
+
+        for i in range(len(selection_options) - 1, -1, -1):
+          option_label = selection_options[i]
+          draw_x -= (len(option_label) + 2)
 
           # if we've run out of room then drop the option (this will only
           # occure on tiny displays)
-          if drawX < 1: break
 
-          selectionFormat = curses.A_STANDOUT if i == selection else curses.A_NORMAL
-          popup.addstr(height - 2, drawX, "[")
-          popup.addstr(height - 2, drawX + 1, optionLabel, selectionFormat | curses.A_BOLD)
-          popup.addstr(height - 2, drawX + len(optionLabel) + 1, "]")
+          if draw_x < 1:
+            break
 
-          drawX -= 1 # space gap between the options
+          selection_format = curses.A_STANDOUT if i == selection else curses.A_NORMAL
+          popup.addstr(height - 2, draw_x, "[")
+          popup.addstr(height - 2, draw_x + 1, option_label, selection_format | curses.A_BOLD)
+          popup.addstr(height - 2, draw_x + len(option_label) + 1, "]")
+
+          draw_x -= 1  # space gap between the options
 
         popup.win.refresh()
 
-        key = arm.controller.getController().getScreen().getch()
-        if key == curses.KEY_LEFT: selection = max(0, selection - 1)
-        elif key == curses.KEY_RIGHT: selection = min(len(selectionOptions) - 1, selection + 1)
+        key = arm.controller.get_controller().get_screen().getch()
+
+        if key == curses.KEY_LEFT:
+          selection = max(0, selection - 1)
+        elif key == curses.KEY_RIGHT:
+          selection = min(len(selection_options) - 1, selection + 1)
 
       if selection in (0, 1):
-        loadedTorrc, promptCanceled = torConfig.getTorrc(), False
-        try: configLocation = loadedTorrc.getConfigLocation()
-        except IOError: configLocation = ""
+        loaded_torrc, prompt_canceled = torConfig.get_torrc(), False
+
+        try:
+          config_location = loaded_torrc.get_config_location()
+        except IOError:
+          config_location = ""
 
         if selection == 1:
           # prompts user for a configuration location
-          configLocation = popups.inputPrompt("Save to (esc to cancel): ", configLocation)
-          if not configLocation: promptCanceled = True
+          config_location = popups.input_prompt("Save to (esc to cancel): ", config_location)
 
-        if not promptCanceled:
+          if not config_location:
+            prompt_canceled = True
+
+        if not prompt_canceled:
           try:
-            torConfig.saveConf(configLocation, configLines)
-            msg = "Saved configuration to %s" % configLocation
-          except IOError, exc:
+            torConfig.save_conf(config_location, config_lines)
+            msg = "Saved configuration to %s" % config_location
+          except IOError as exc:
             msg = "Unable to save configuration (%s)" % exc.strerror
 
-          popups.showMsg(msg, 2)
-    finally: popups.finalize()
+          popups.show_msg(msg, 2)
+    finally:
+      popups.finalize()
 
-  def getHelp(self):
+  def get_help(self):
     options = []
     options.append(("up arrow", "scroll up a line", None))
     options.append(("down arrow", "scroll down a line", None))
@@ -492,123 +578,149 @@ class ConfigPanel(panel.Panel):
     return options
 
   def draw(self, width, height):
-    self.valsLock.acquire()
+    self.vals_lock.acquire()
 
     # panel with details for the current selection
-    detailPanelHeight = CONFIG["features.config.selectionDetails.height"]
-    isScrollbarVisible = False
-    if detailPanelHeight == 0 or detailPanelHeight + 2 >= height:
+
+    detail_panel_height = CONFIG["features.config.selectionDetails.height"]
+    is_scrollbar_visible = False
+
+    if detail_panel_height == 0 or detail_panel_height + 2 >= height:
       # no detail panel
-      detailPanelHeight = 0
-      scrollLoc = self.scroller.getScrollLoc(self._getConfigOptions(), height - 1)
-      cursorSelection = self.getSelection()
-      isScrollbarVisible = len(self._getConfigOptions()) > height - 1
+
+      detail_panel_height = 0
+      scroll_location = self.scroller.get_scroll_location(self._get_config_options(), height - 1)
+      cursor_selection = self.get_selection()
+      is_scrollbar_visible = len(self._get_config_options()) > height - 1
     else:
       # Shrink detail panel if there isn't sufficient room for the whole
       # thing. The extra line is for the bottom border.
-      detailPanelHeight = min(height - 1, detailPanelHeight + 1)
-      scrollLoc = self.scroller.getScrollLoc(self._getConfigOptions(), height - 1 - detailPanelHeight)
-      cursorSelection = self.getSelection()
-      isScrollbarVisible = len(self._getConfigOptions()) > height - detailPanelHeight - 1
 
-      if cursorSelection != None:
-        self._drawSelectionPanel(cursorSelection, width, detailPanelHeight, isScrollbarVisible)
+      detail_panel_height = min(height - 1, detail_panel_height + 1)
+      scroll_location = self.scroller.get_scroll_location(self._get_config_options(), height - 1 - detail_panel_height)
+      cursor_selection = self.get_selection()
+      is_scrollbar_visible = len(self._get_config_options()) > height - detail_panel_height - 1
+
+      if cursor_selection is not None:
+        self._draw_selection_panel(cursor_selection, width, detail_panel_height, is_scrollbar_visible)
 
     # draws the top label
-    if self.isTitleVisible():
-      configType = "Tor" if self.configType == State.TOR else "Arm"
-      hiddenMsg = "press 'a' to hide most options" if self.showAll else "press 'a' to show all options"
-      titleLabel = "%s Configuration (%s):" % (configType, hiddenMsg)
-      self.addstr(0, 0, titleLabel, curses.A_STANDOUT)
+
+    if self.is_title_visible():
+      config_type = "Tor" if self.config_type == State.TOR else "Arm"
+      hidden_msg = "press 'a' to hide most options" if self.show_all else "press 'a' to show all options"
+      title_label = "%s Configuration (%s):" % (config_type, hidden_msg)
+      self.addstr(0, 0, title_label, curses.A_STANDOUT)
 
     # draws left-hand scroll bar if content's longer than the height
-    scrollOffset = 1
-    if isScrollbarVisible:
-      scrollOffset = 3
-      self.addScrollBar(scrollLoc, scrollLoc + height - detailPanelHeight - 1, len(self._getConfigOptions()), 1 + detailPanelHeight)
 
-    optionWidth = CONFIG["features.config.state.colWidth.option"]
-    valueWidth = CONFIG["features.config.state.colWidth.value"]
-    descriptionWidth = max(0, width - scrollOffset - optionWidth - valueWidth - 2)
+    scroll_offset = 1
+
+    if is_scrollbar_visible:
+      scroll_offset = 3
+      self.add_scroll_bar(scroll_location, scroll_location + height - detail_panel_height - 1, len(self._get_config_options()), 1 + detail_panel_height)
+
+    option_width = CONFIG["features.config.state.colWidth.option"]
+    value_width = CONFIG["features.config.state.colWidth.value"]
+    description_width = max(0, width - scroll_offset - option_width - value_width - 2)
 
     # if the description column is overly long then use its space for the
     # value instead
-    if descriptionWidth > 80:
-      valueWidth += descriptionWidth - 80
-      descriptionWidth = 80
 
-    for lineNum in range(scrollLoc, len(self._getConfigOptions())):
-      entry = self._getConfigOptions()[lineNum]
-      drawLine = lineNum + detailPanelHeight + 1 - scrollLoc
+    if description_width > 80:
+      value_width += description_width - 80
+      description_width = 80
+
+    for line_number in range(scroll_location, len(self._get_config_options())):
+      entry = self._get_config_options()[line_number]
+      draw_line = line_number + detail_panel_height + 1 - scroll_location
+
+      line_format = curses.A_NORMAL if entry.get(Field.IS_DEFAULT) else curses.A_BOLD
 
-      lineFormat = curses.A_NORMAL if entry.get(Field.IS_DEFAULT) else curses.A_BOLD
-      if entry.get(Field.CATEGORY): lineFormat |= uiTools.getColor(CATEGORY_COLOR[entry.get(Field.CATEGORY)])
-      if entry == cursorSelection: lineFormat |= curses.A_STANDOUT
+      if entry.get(Field.CATEGORY):
+        line_format |= uiTools.get_color(CATEGORY_COLOR[entry.get(Field.CATEGORY)])
 
-      lineText = entry.getLabel(optionWidth, valueWidth, descriptionWidth)
-      self.addstr(drawLine, scrollOffset, lineText, lineFormat)
+      if entry == cursor_selection:
+        line_format |= curses.A_STANDOUT
 
-      if drawLine >= height: break
+      line_text = entry.get_label(option_width, value_width, description_width)
+      self.addstr(draw_line, scroll_offset, line_text, line_format)
 
-    self.valsLock.release()
+      if draw_line >= height:
+        break
 
-  def _getConfigOptions(self):
-    return self.confContents if self.showAll else self.confImportantContents
+    self.vals_lock.release()
 
-  def _drawSelectionPanel(self, selection, width, detailPanelHeight, isScrollbarVisible):
+  def _get_config_options(self):
+    return self.conf_contents if self.show_all else self.conf_important_contents
+
+  def _draw_selection_panel(self, selection, width, detail_panel_height, is_scrollbar_visible):
     """
     Renders a panel for the selected configuration option.
     """
 
     # This is a solid border unless the scrollbar is visible, in which case a
     # 'T' pipe connects the border to the bar.
-    uiTools.drawBox(self, 0, 0, width, detailPanelHeight + 1)
-    if isScrollbarVisible: self.addch(detailPanelHeight, 1, curses.ACS_TTEE)
 
-    selectionFormat = curses.A_BOLD | uiTools.getColor(CATEGORY_COLOR[selection.get(Field.CATEGORY)])
+    uiTools.draw_box(self, 0, 0, width, detail_panel_height + 1)
+
+    if is_scrollbar_visible:
+      self.addch(detail_panel_height, 1, curses.ACS_TTEE)
+
+    selection_format = curses.A_BOLD | uiTools.get_color(CATEGORY_COLOR[selection.get(Field.CATEGORY)])
 
     # first entry:
     # <option> (<category> Option)
-    optionLabel =" (%s Option)" % selection.get(Field.CATEGORY)
-    self.addstr(1, 2, selection.get(Field.OPTION) + optionLabel, selectionFormat)
+
+    option_label = " (%s Option)" % selection.get(Field.CATEGORY)
+    self.addstr(1, 2, selection.get(Field.OPTION) + option_label, selection_format)
 
     # second entry:
     # Value: <value> ([default|custom], <type>, usage: <argument usage>)
-    if detailPanelHeight >= 3:
-      valueAttr = []
-      valueAttr.append("default" if selection.get(Field.IS_DEFAULT) else "custom")
-      valueAttr.append(selection.get(Field.TYPE))
-      valueAttr.append("usage: %s" % (selection.get(Field.ARG_USAGE)))
-      valueAttrLabel = ", ".join(valueAttr)
 
-      valueLabelWidth = width - 12 - len(valueAttrLabel)
-      valueLabel = uiTools.cropStr(selection.get(Field.VALUE), valueLabelWidth)
+    if detail_panel_height >= 3:
+      value_attr = []
+      value_attr.append("default" if selection.get(Field.IS_DEFAULT) else "custom")
+      value_attr.append(selection.get(Field.TYPE))
+      value_attr.append("usage: %s" % (selection.get(Field.ARG_USAGE)))
+      value_attr_label = ", ".join(value_attr)
+
+      value_label_width = width - 12 - len(value_attr_label)
+      value_label = uiTools.crop_str(selection.get(Field.VALUE), value_label_width)
 
-      self.addstr(2, 2, "Value: %s (%s)" % (valueLabel, valueAttrLabel), selectionFormat)
+      self.addstr(2, 2, "Value: %s (%s)" % (value_label, value_attr_label), selection_format)
 
     # remainder is filled with the man page description
-    descriptionHeight = max(0, detailPanelHeight - 3)
-    descriptionContent = "Description: " + selection.get(Field.DESCRIPTION)
 
-    for i in range(descriptionHeight):
+    description_height = max(0, detail_panel_height - 3)
+    description_content = "Description: " + selection.get(Field.DESCRIPTION)
+
+    for i in range(description_height):
       # checks if we're done writing the description
-      if not descriptionContent: break
+
+      if not description_content:
+        break
 
       # there's a leading indent after the first line
-      if i > 0: descriptionContent = "  " + descriptionContent
+
+      if i > 0:
+        description_content = "  " + description_content
 
       # we only want to work with content up until the next newline
-      if "\n" in descriptionContent:
-        lineContent, descriptionContent = descriptionContent.split("\n", 1)
-      else: lineContent, descriptionContent = descriptionContent, ""
 
-      if i != descriptionHeight - 1:
+      if "\n" in description_content:
+        line_content, description_content = description_content.split("\n", 1)
+      else:
+        line_content, description_content = description_content, ""
+
+      if i != description_height - 1:
         # there's more lines to display
-        msg, remainder = uiTools.cropStr(lineContent, width - 3, 4, 4, uiTools.Ending.HYPHEN, True)
-        descriptionContent = remainder.strip() + descriptionContent
+
+        msg, remainder = uiTools.crop_str(line_content, width - 3, 4, 4, uiTools.Ending.HYPHEN, True)
+        description_content = remainder.strip() + description_content
       else:
         # this is the last line, end it with an ellipse
-        msg = uiTools.cropStr(lineContent, width - 3, 4, 4)
 
-      self.addstr(3 + i, 2, msg, selectionFormat)
+        msg = uiTools.crop_str(line_content, width - 3, 4, 4)
 
+      self.addstr(3 + i, 2, msg, selection_format)
diff --git a/arm/connections/__init__.py b/arm/connections/__init__.py
index abd3410..8e0444a 100644
--- a/arm/connections/__init__.py
+++ b/arm/connections/__init__.py
@@ -2,5 +2,4 @@
 Connection panel related resources.
 """
 
-__all__ = ["circEntry", "connEntry", "connPanel", "countPopup", "descriptorPopup", "entries"]
-
+__all__ = ["circEntry", "connEntry", "conn_panel", "countPopup", "descriptorPopup", "entries"]
diff --git a/arm/connections/circEntry.py b/arm/connections/circEntry.py
index cef6820..bed6528 100644
--- a/arm/connections/circEntry.py
+++ b/arm/connections/circEntry.py
@@ -13,23 +13,25 @@ import curses
 from arm.connections import entries, connEntry
 from arm.util import torTools, uiTools
 
+
 class CircEntry(connEntry.ConnectionEntry):
-  def __init__(self, circuitID, status, purpose, path):
+  def __init__(self, circuit_id, status, purpose, path):
     connEntry.ConnectionEntry.__init__(self, "127.0.0.1", "0", "127.0.0.1", "0")
 
-    self.circuitID = circuitID
+    self.circuit_id = circuit_id
     self.status = status
 
     # drops to lowercase except the first letter
+
     if len(purpose) >= 2:
       purpose = purpose[0].upper() + purpose[1:].lower()
 
-    self.lines = [CircHeaderLine(self.circuitID, purpose)]
+    self.lines = [CircHeaderLine(self.circuit_id, purpose)]
 
     # Overwrites attributes of the initial line to make it more fitting as the
     # header for our listing.
 
-    self.lines[0].baseType = connEntry.Category.CIRCUIT
+    self.lines[0].base_type = connEntry.Category.CIRCUIT
 
     self.update(status, path)
 
@@ -46,27 +48,32 @@ class CircEntry(connEntry.ConnectionEntry):
 
     self.status = status
     self.lines = [self.lines[0]]
-    conn = torTools.getConn()
+    conn = torTools.get_conn()
 
-    if status == "BUILT" and not self.lines[0].isBuilt:
-      exitIp, exitORPort = conn.getRelayAddress(path[-1], ("192.168.0.1", "0"))
-      self.lines[0].setExit(exitIp, exitORPort, path[-1])
+    if status == "BUILT" and not self.lines[0].is_built:
+      exit_ip, exit_port = conn.get_relay_address(path[-1], ("192.168.0.1", "0"))
+      self.lines[0].set_exit(exit_ip, exit_port, path[-1])
 
     for i in range(len(path)):
-      relayFingerprint = path[i]
-      relayIp, relayOrPort = conn.getRelayAddress(relayFingerprint, ("192.168.0.1", "0"))
+      relay_fingerprint = path[i]
+      relay_ip, relay_port = conn.get_relay_address(relay_fingerprint, ("192.168.0.1", "0"))
 
       if i == len(path) - 1:
-        if status == "BUILT": placementType = "Exit"
-        else: placementType = "Extending"
-      elif i == 0: placementType = "Guard"
-      else: placementType = "Middle"
+        if status == "BUILT":
+          placement_type = "Exit"
+        else:
+          placement_type = "Extending"
+      elif i == 0:
+        placement_type = "Guard"
+      else:
+        placement_type = "Middle"
 
-      placementLabel = "%i / %s" % (i + 1, placementType)
+      placement_label = "%i / %s" % (i + 1, placement_type)
 
-      self.lines.append(CircLine(relayIp, relayOrPort, relayFingerprint, placementLabel))
+      self.lines.append(CircLine(relay_ip, relay_port, relay_fingerprint, placement_label))
+
+    self.lines[-1].is_last = True
 
-    self.lines[-1].isLast = True
 
 class CircHeaderLine(connEntry.ConnectionLine):
   """
@@ -74,44 +81,49 @@ class CircHeaderLine(connEntry.ConnectionLine):
   lines except that its etc field has circuit attributes.
   """
 
-  def __init__(self, circuitID, purpose):
+  def __init__(self, circuit_id, purpose):
     connEntry.ConnectionLine.__init__(self, "127.0.0.1", "0", "0.0.0.0", "0", False, False)
-    self.circuitID = circuitID
+    self.circuit_id = circuit_id
     self.purpose = purpose
-    self.isBuilt = False
+    self.is_built = False
 
-  def setExit(self, exitIpAddr, exitPort, exitFingerprint):
-    connEntry.ConnectionLine.__init__(self, "127.0.0.1", "0", exitIpAddr, exitPort, False, False)
-    self.isBuilt = True
-    self.foreign.fingerprintOverwrite = exitFingerprint
+  def set_exit(self, exit_address, exit_port, exit_fingerprint):
+    connEntry.ConnectionLine.__init__(self, "127.0.0.1", "0", exit_address, exit_port, False, False)
+    self.is_built = True
+    self.foreign.fingerprint_overwrite = exit_fingerprint
 
-  def getType(self):
+  def get_type(self):
     return connEntry.Category.CIRCUIT
 
-  def getDestinationLabel(self, maxLength, includeLocale=False, includeHostname=False):
-    if not self.isBuilt: return "Building..."
-    return connEntry.ConnectionLine.getDestinationLabel(self, maxLength, includeLocale, includeHostname)
+  def get_destination_label(self, max_length, include_locale=False, include_hostname=False):
+    if not self.is_built:
+      return "Building..."
+
+    return connEntry.ConnectionLine.get_destination_label(self, max_length, include_locale, include_hostname)
 
-  def getEtcContent(self, width, listingType):
+  def get_etc_content(self, width, listing_type):
     """
     Attempts to provide all circuit related stats. Anything that can't be
     shown completely (not enough room) is dropped.
     """
 
-    etcAttr = ["Purpose: %s" % self.purpose, "Circuit ID: %i" % self.circuitID]
+    etc_attr = ["Purpose: %s" % self.purpose, "Circuit ID: %i" % self.circuit_id]
 
-    for i in range(len(etcAttr), -1, -1):
-      etcLabel = ", ".join(etcAttr[:i])
-      if len(etcLabel) <= width:
-        return ("%%-%is" % width) % etcLabel
+    for i in range(len(etc_attr), -1, -1):
+      etc_label = ", ".join(etc_attr[:i])
+
+      if len(etc_label) <= width:
+        return ("%%-%is" % width) % etc_label
 
     return ""
 
-  def getDetails(self, width):
-    if not self.isBuilt:
-      detailFormat = curses.A_BOLD | uiTools.getColor(connEntry.CATEGORY_COLOR[self.getType()])
-      return [("Building Circuit...", detailFormat)]
-    else: return connEntry.ConnectionLine.getDetails(self, width)
+  def get_details(self, width):
+    if not self.is_built:
+      detail_format = curses.A_BOLD | uiTools.get_color(connEntry.CATEGORY_COLOR[self.get_type()])
+      return [("Building Circuit...", detail_format)]
+    else:
+      return connEntry.ConnectionLine.get_details(self, width)
+
 
 class CircLine(connEntry.ConnectionLine):
   """
@@ -120,23 +132,26 @@ class CircLine(connEntry.ConnectionLine):
   caching, etc).
   """
 
-  def __init__(self, fIpAddr, fPort, fFingerprint, placementLabel):
-    connEntry.ConnectionLine.__init__(self, "127.0.0.1", "0", fIpAddr, fPort)
-    self.foreign.fingerprintOverwrite = fFingerprint
-    self.placementLabel = placementLabel
-    self.includePort = False
+  def __init__(self, remote_address, remote_port, remote_fingerprint, placement_label):
+    connEntry.ConnectionLine.__init__(self, "127.0.0.1", "0", remote_address, remote_port)
+    self.foreign.fingerprint_overwrite = remote_fingerprint
+    self.placement_label = placement_label
+    self.include_port = False
 
     # determines the sort of left hand bracketing we use
-    self.isLast = False
 
-  def getType(self):
+    self.is_last = False
+
+  def get_type(self):
     return connEntry.Category.CIRCUIT
 
-  def getListingPrefix(self):
-    if self.isLast: return (ord(' '), curses.ACS_LLCORNER, curses.ACS_HLINE, ord(' '))
-    else: return (ord(' '), curses.ACS_VLINE, ord(' '), ord(' '))
+  def get_listing_prefix(self):
+    if self.is_last:
+      return (ord(' '), curses.ACS_LLCORNER, curses.ACS_HLINE, ord(' '))
+    else:
+      return (ord(' '), curses.ACS_VLINE, ord(' '), ord(' '))
 
-  def getListingEntry(self, width, currentTime, listingType):
+  def get_listing_entry(self, width, current_time, listing_type):
     """
     Provides the [(msg, attr)...] listing for this relay in the circuilt
     listing. Lines are composed of the following components:
@@ -146,51 +161,56 @@ class CircLine(connEntry.ConnectionLine):
 
     Arguments:
       width       - maximum length of the line
-      currentTime - the current unix time (ignored)
-      listingType - primary attribute we're listing connections by
+      current_time - the current unix time (ignored)
+      listing_type - primary attribute we're listing connections by
     """
 
-    return entries.ConnectionPanelLine.getListingEntry(self, width, currentTime, listingType)
+    return entries.ConnectionPanelLine.get_listing_entry(self, width, current_time, listing_type)
 
-  def _getListingEntry(self, width, currentTime, listingType):
-    lineFormat = uiTools.getColor(connEntry.CATEGORY_COLOR[self.getType()])
+  def _get_listing_entry(self, width, current_time, listing_type):
+    line_format = uiTools.get_color(connEntry.CATEGORY_COLOR[self.get_type()])
 
     # The required widths are the sum of the following:
     # initial space (1 character)
     # bracketing (3 characters)
-    # placementLabel (14 characters)
+    # placement_label (14 characters)
     # gap between etc and placement label (5 characters)
 
-    baselineSpace = 14 + 5
+    baseline_space = 14 + 5
 
     dst, etc = "", ""
-    if listingType == entries.ListingType.IP_ADDRESS:
+
+    if listing_type == entries.ListingType.IP_ADDRESS:
       # TODO: include hostname when that's available
       # dst width is derived as:
       # src (21) + dst (26) + divider (7) + right gap (2) - bracket (3) = 53 char
-      dst = "%-53s" % self.getDestinationLabel(53, includeLocale = True)
+
+      dst = "%-53s" % self.get_destination_label(53, include_locale = True)
 
       # fills the nickname into the empty space here
-      dst = "%s%-25s   " % (dst[:25], uiTools.cropStr(self.foreign.getNickname(), 25, 0))
 
-      etc = self.getEtcContent(width - baselineSpace - len(dst), listingType)
-    elif listingType == entries.ListingType.HOSTNAME:
+      dst = "%s%-25s   " % (dst[:25], uiTools.crop_str(self.foreign.get_nickname(), 25, 0))
+
+      etc = self.get_etc_content(width - baseline_space - len(dst), listing_type)
+    elif listing_type == entries.ListingType.HOSTNAME:
       # min space for the hostname is 40 characters
-      etc = self.getEtcContent(width - baselineSpace - 40, listingType)
-      dstLayout = "%%-%is" % (width - baselineSpace - len(etc))
-      dst = dstLayout % self.foreign.getHostname(self.foreign.getIpAddr())
-    elif listingType == entries.ListingType.FINGERPRINT:
+
+      etc = self.get_etc_content(width - baseline_space - 40, listing_type)
+      dst_layout = "%%-%is" % (width - baseline_space - len(etc))
+      dst = dst_layout % self.foreign.get_hostname(self.foreign.get_address())
+    elif listing_type == entries.ListingType.FINGERPRINT:
       # dst width is derived as:
       # src (9) + dst (40) + divider (7) + right gap (2) - bracket (3) = 55 char
-      dst = "%-55s" % self.foreign.getFingerprint()
-      etc = self.getEtcContent(width - baselineSpace - len(dst), listingType)
+
+      dst = "%-55s" % self.foreign.get_fingerprint()
+      etc = self.get_etc_content(width - baseline_space - len(dst), listing_type)
     else:
       # min space for the nickname is 56 characters
-      etc = self.getEtcContent(width - baselineSpace - 56, listingType)
-      dstLayout = "%%-%is" % (width - baselineSpace - len(etc))
-      dst = dstLayout % self.foreign.getNickname()
 
-    return ((dst + etc, lineFormat),
-            (" " * (width - baselineSpace - len(dst) - len(etc) + 5), lineFormat),
-            ("%-14s" % self.placementLabel, lineFormat))
+      etc = self.get_etc_content(width - baseline_space - 56, listing_type)
+      dst_layout = "%%-%is" % (width - baseline_space - len(etc))
+      dst = dst_layout % self.foreign.get_nickname()
 
+    return ((dst + etc, line_format),
+            (" " * (width - baseline_space - len(dst) - len(etc) + 5), line_format),
+            ("%-14s" % self.placement_label, line_format))
diff --git a/arm/connections/connEntry.py b/arm/connections/connEntry.py
index 592eb7b..230ca7f 100644
--- a/arm/connections/connEntry.py
+++ b/arm/connections/connEntry.py
@@ -22,17 +22,26 @@ from stem.util import conf, connection, enum, str_tools
 #   Control      Tor controller (arm, vidalia, etc).
 
 Category = enum.Enum("INBOUND", "OUTBOUND", "EXIT", "HIDDEN", "SOCKS", "CIRCUIT", "DIRECTORY", "CONTROL")
-CATEGORY_COLOR = {Category.INBOUND: "green",      Category.OUTBOUND: "blue",
-                  Category.EXIT: "red",           Category.HIDDEN: "magenta",
-                  Category.SOCKS: "yellow",       Category.CIRCUIT: "cyan",
-                  Category.DIRECTORY: "magenta",  Category.CONTROL: "red"}
+
+CATEGORY_COLOR = {
+  Category.INBOUND: "green",
+  Category.OUTBOUND: "blue",
+  Category.EXIT: "red",
+  Category.HIDDEN: "magenta",
+  Category.SOCKS: "yellow",
+  Category.CIRCUIT: "cyan",
+  Category.DIRECTORY: "magenta",
+  Category.CONTROL: "red",
+}
 
 # static data for listing format
 # <src>  -->  <dst>  <etc><padding>
+
 LABEL_FORMAT = "%s  -->  %s  %s%s"
-LABEL_MIN_PADDING = 2 # min space between listing label and following data
+LABEL_MIN_PADDING = 2  # min space between listing label and following data
 
 # sort value for scrubbed ip addresses
+
 SCRUBBED_IP_VAL = 255 ** 4
 
 CONFIG = conf.config_dict("arm", {
@@ -45,6 +54,7 @@ CONFIG = conf.config_dict("arm", {
   "features.connection.showColumn.expandedIp": True,
 })
 
+
 class Endpoint:
   """
   Collection of attributes associated with a connection endpoint. This is a
@@ -52,33 +62,35 @@ class Endpoint:
   performance.
   """
 
-  def __init__(self, ipAddr, port):
-    self.ipAddr = ipAddr
+  def __init__(self, address, port):
+    self.address = address
     self.port = port
 
     # if true, we treat the port as an definitely not being an ORPort when
     # searching for matching fingerprints (otherwise we use it to possably
     # narrow results when unknown)
-    self.isNotORPort = True
+
+    self.is_not_or_port = True
 
     # if set then this overwrites fingerprint lookups
-    self.fingerprintOverwrite = None
 
-  def getIpAddr(self):
+    self.fingerprint_overwrite = None
+
+  def get_address(self):
     """
     Provides the IP address of the endpoint.
     """
 
-    return self.ipAddr
+    return self.address
 
-  def getPort(self):
+  def get_port(self):
     """
     Provides the port of the endpoint.
     """
 
     return self.port
 
-  def getHostname(self, default = None):
+  def get_hostname(self, default = None):
     """
     Provides the hostname associated with the relay's address. This is a
     non-blocking call and returns None if the address either can't be resolved
@@ -90,7 +102,7 @@ class Endpoint:
 
     # TODO: skipping all hostname resolution to be safe for now
     #try:
-    #  myHostname = hostnames.resolve(self.ipAddr)
+    #  myHostname = hostnames.resolve(self.address)
     #except:
     #  # either a ValueError or IOError depending on the source of the lookup failure
     #  myHostname = None
@@ -100,7 +112,7 @@ class Endpoint:
 
     return default
 
-  def getLocale(self, default=None):
+  def get_locale(self, default=None):
     """
     Provides the two letter country code for the IP address' locale.
 
@@ -108,44 +120,51 @@ class Endpoint:
       default - return value if no locale information is available
     """
 
-    conn = torTools.getConn()
-    return conn.getInfo("ip-to-country/%s" % self.ipAddr, default)
+    conn = torTools.get_conn()
+    return conn.get_info("ip-to-country/%s" % self.address, default)
 
-  def getFingerprint(self):
+  def get_fingerprint(self):
     """
     Provides the fingerprint of the relay, returning "UNKNOWN" if it can't be
     determined.
     """
 
-    if self.fingerprintOverwrite:
-      return self.fingerprintOverwrite
+    if self.fingerprint_overwrite:
+      return self.fingerprint_overwrite
 
-    conn = torTools.getConn()
-    myFingerprint = conn.getRelayFingerprint(self.ipAddr)
+    conn = torTools.get_conn()
+    my_fingerprint = conn.get_relay_fingerprint(self.address)
 
     # If there were multiple matches and our port is likely the ORPort then
     # try again with that to narrow the results.
-    if not myFingerprint and not self.isNotORPort:
-      myFingerprint = conn.getRelayFingerprint(self.ipAddr, self.port)
 
-    if myFingerprint: return myFingerprint
-    else: return "UNKNOWN"
+    if not my_fingerprint and not self.is_not_or_port:
+      my_fingerprint = conn.get_relay_fingerprint(self.address, self.port)
+
+    if my_fingerprint:
+      return my_fingerprint
+    else:
+      return "UNKNOWN"
 
-  def getNickname(self):
+  def get_nickname(self):
     """
     Provides the nickname of the relay, retuning "UNKNOWN" if it can't be
     determined.
     """
 
-    myFingerprint = self.getFingerprint()
+    my_fingerprint = self.get_fingerprint()
 
-    if myFingerprint != "UNKNOWN":
-      conn = torTools.getConn()
-      myNickname = conn.getRelayNickname(myFingerprint)
+    if my_fingerprint != "UNKNOWN":
+      conn = torTools.get_conn()
+      my_nickname = conn.get_relay_nickname(my_fingerprint)
+
+      if my_nickname:
+        return my_nickname
+      else:
+        return "UNKNOWN"
+    else:
+      return "UNKNOWN"
 
-      if myNickname: return myNickname
-      else: return "UNKNOWN"
-    else: return "UNKNOWN"
 
 class ConnectionEntry(entries.ConnectionPanelEntry):
   """
@@ -154,56 +173,68 @@ class ConnectionEntry(entries.ConnectionPanelEntry):
   application, and controller categories.
   """
 
-  def __init__(self, lIpAddr, lPort, fIpAddr, fPort):
+  def __init__(self, local_address, local_port, remote_address, remote_port):
     entries.ConnectionPanelEntry.__init__(self)
-    self.lines = [ConnectionLine(lIpAddr, lPort, fIpAddr, fPort)]
+    self.lines = [ConnectionLine(local_address, local_port, remote_address, remote_port)]
 
-  def getSortValue(self, attr, listingType):
+  def get_sort_value(self, attr, listing_type):
     """
     Provides the value of a single attribute used for sorting purposes.
     """
 
-    connLine = self.lines[0]
+    connection_line = self.lines[0]
+
     if attr == entries.SortAttr.IP_ADDRESS:
-      if connLine.isPrivate(): return SCRUBBED_IP_VAL # orders at the end
-      return connLine.sortIpAddr
+      if connection_line.is_private():
+        return SCRUBBED_IP_VAL  # orders at the end
+
+      return connection_line.sort_address
     elif attr == entries.SortAttr.PORT:
-      return connLine.sortPort
+      return connection_line.sort_port
     elif attr == entries.SortAttr.HOSTNAME:
-      if connLine.isPrivate(): return ""
-      return connLine.foreign.getHostname("")
+      if connection_line.is_private():
+        return ""
+
+      return connection_line.foreign.get_hostname("")
     elif attr == entries.SortAttr.FINGERPRINT:
-      return connLine.foreign.getFingerprint()
+      return connection_line.foreign.get_fingerprint()
     elif attr == entries.SortAttr.NICKNAME:
-      myNickname = connLine.foreign.getNickname()
-      if myNickname == "UNKNOWN": return "z" * 20 # orders at the end
-      else: return myNickname.lower()
+      my_nickname = connection_line.foreign.get_nickname()
+
+      if my_nickname == "UNKNOWN":
+        return "z" * 20  # orders at the end
+      else:
+        return my_nickname.lower()
     elif attr == entries.SortAttr.CATEGORY:
-      return Category.index_of(connLine.getType())
+      return Category.index_of(connection_line.get_type())
     elif attr == entries.SortAttr.UPTIME:
-      return connLine.startTime
+      return connection_line.start_time
     elif attr == entries.SortAttr.COUNTRY:
-      if connection.is_private_address(self.lines[0].foreign.getIpAddr()): return ""
-      else: return connLine.foreign.getLocale("")
+      if connection.is_private_address(self.lines[0].foreign.get_address()):
+        return ""
+      else:
+        return connection_line.foreign.get_locale("")
     else:
-      return entries.ConnectionPanelEntry.getSortValue(self, attr, listingType)
+      return entries.ConnectionPanelEntry.get_sort_value(self, attr, listing_type)
+
 
 class ConnectionLine(entries.ConnectionPanelLine):
   """
   Display component of the ConnectionEntry.
   """
 
-  def __init__(self, lIpAddr, lPort, fIpAddr, fPort, includePort=True, includeExpandedIpAddr=True):
+  def __init__(self, local_address, local_port, remote_address, remote_port, include_port=True, include_expanded_addresses=True):
     entries.ConnectionPanelLine.__init__(self)
 
-    self.local = Endpoint(lIpAddr, lPort)
-    self.foreign = Endpoint(fIpAddr, fPort)
-    self.startTime = time.time()
-    self.isInitialConnection = False
+    self.local = Endpoint(local_address, local_port)
+    self.foreign = Endpoint(remote_address, remote_port)
+    self.start_time = time.time()
+    self.is_initial_connection = False
 
     # overwrite the local fingerprint with ours
-    conn = torTools.getConn()
-    self.local.fingerprintOverwrite = conn.getInfo("fingerprint", None)
+
+    conn = torTools.get_conn()
+    self.local.fingerprint_overwrite = conn.get_info("fingerprint", None)
 
     # True if the connection has matched the properties of a client/directory
     # connection every time we've checked. The criteria we check is...
@@ -211,57 +242,61 @@ class ConnectionLine(entries.ConnectionPanelLine):
     #   directory - matches an established single-hop circuit (probably a
     #               directory mirror)
 
-    self._possibleClient = True
-    self._possibleDirectory = True
+    self._possible_client = True
+    self._possible_directory = True
 
     # attributes for SOCKS, HIDDEN, and CONTROL connections
-    self.appName = None
-    self.appPid = None
-    self.isAppResolving = False
 
-    myOrPort = conn.getOption("ORPort", None)
-    myDirPort = conn.getOption("DirPort", None)
-    mySocksPort = conn.getOption("SocksPort", "9050")
-    myCtlPort = conn.getOption("ControlPort", None)
-    myHiddenServicePorts = conn.getHiddenServicePorts()
+    self.application_name = None
+    self.application_pid = None
+    self.is_application_resolving = False
+
+    my_or_port = conn.get_option("ORPort", None)
+    my_dir_port = conn.get_option("DirPort", None)
+    my_socks_port = conn.get_option("SocksPort", "9050")
+    my_ctl_port = conn.get_option("ControlPort", None)
+    my_hidden_service_ports = conn.get_hidden_service_ports()
 
     # the ORListenAddress can overwrite the ORPort
-    listenAddr = conn.getOption("ORListenAddress", None)
-    if listenAddr and ":" in listenAddr:
-      myOrPort = listenAddr[listenAddr.find(":") + 1:]
-
-    if lPort in (myOrPort, myDirPort):
-      self.baseType = Category.INBOUND
-      self.local.isNotORPort = False
-    elif lPort == mySocksPort:
-      self.baseType = Category.SOCKS
-    elif fPort in myHiddenServicePorts:
-      self.baseType = Category.HIDDEN
-    elif lPort == myCtlPort:
-      self.baseType = Category.CONTROL
+
+    listen_addr = conn.get_option("ORListenAddress", None)
+
+    if listen_addr and ":" in listen_addr:
+      my_or_port = listen_addr[listen_addr.find(":") + 1:]
+
+    if local_port in (my_or_port, my_dir_port):
+      self.base_type = Category.INBOUND
+      self.local.is_not_or_port = False
+    elif local_port == my_socks_port:
+      self.base_type = Category.SOCKS
+    elif remote_port in my_hidden_service_ports:
+      self.base_type = Category.HIDDEN
+    elif local_port == my_ctl_port:
+      self.base_type = Category.CONTROL
     else:
-      self.baseType = Category.OUTBOUND
-      self.foreign.isNotORPort = False
+      self.base_type = Category.OUTBOUND
+      self.foreign.is_not_or_port = False
 
-    self.cachedType = None
+    self.cached_type = None
 
     # includes the port or expanded ip address field when displaying listing
     # information if true
-    self.includePort = includePort
-    self.includeExpandedIpAddr = includeExpandedIpAddr
+
+    self.include_port = include_port
+    self.include_expanded_addresses = include_expanded_addresses
 
     # cached immutable values used for sorting
 
     ip_value = 0
 
-    for comp in self.foreign.getIpAddr().split("."):
+    for comp in self.foreign.get_address().split("."):
       ip_value *= 255
       ip_value += int(comp)
 
-    self.sortIpAddr = ip_value
-    self.sortPort = int(self.foreign.getPort())
+    self.sort_address = ip_value
+    self.sort_port = int(self.foreign.get_port())
 
-  def getListingEntry(self, width, currentTime, listingType):
+  def get_listing_entry(self, width, current_time, listing_type):
     """
     Provides the tuple list for this connection's listing. Lines are composed
     of the following components:
@@ -289,33 +324,36 @@ class ConnectionLine(entries.ConnectionPanelLine):
 
     Arguments:
       width       - maximum length of the line
-      currentTime - unix timestamp for what the results should consider to be
+      current_time - unix timestamp for what the results should consider to be
                     the current time
-      listingType - primary attribute we're listing connections by
+      listing_type - primary attribute we're listing connections by
     """
 
     # fetch our (most likely cached) display entry for the listing
-    myListing = entries.ConnectionPanelLine.getListingEntry(self, width, currentTime, listingType)
+
+    my_listing = entries.ConnectionPanelLine.get_listing_entry(self, width, current_time, listing_type)
 
     # fill in the current uptime and return the results
+
     if CONFIG["features.connection.markInitialConnections"]:
-      timePrefix = "+" if self.isInitialConnection else " "
-    else: timePrefix = ""
+      time_prefix = "+" if self.is_initial_connection else " "
+    else:
+      time_prefix = ""
 
-    timeLabel = timePrefix + "%5s" % str_tools.get_time_label(currentTime - self.startTime, 1)
-    myListing[2] = (timeLabel, myListing[2][1])
+    time_label = time_prefix + "%5s" % str_tools.get_time_label(current_time - self.start_time, 1)
+    my_listing[2] = (time_label, my_listing[2][1])
 
-    return myListing
+    return my_listing
 
-  def isUnresolvedApp(self):
+  def is_unresolved_application(self):
     """
     True if our display uses application information that hasn't yet been resolved.
     """
 
-    return self.appName == None and self.getType() in (Category.SOCKS, Category.HIDDEN, Category.CONTROL)
+    return self.application_name is None and self.get_type() in (Category.SOCKS, Category.HIDDEN, Category.CONTROL)
 
-  def _getListingEntry(self, width, currentTime, listingType):
-    entryType = self.getType()
+  def _get_listing_entry(self, width, current_time, listing_type):
+    entry_type = self.get_type()
 
     # Lines are split into the following components in reverse:
     # init gap - " "
@@ -325,18 +363,19 @@ class ConnectionLine(entries.ConnectionPanelLine):
     # category - "<type>"
     # postType - ")   "
 
-    lineFormat = uiTools.getColor(CATEGORY_COLOR[entryType])
-    timeWidth = 6 if CONFIG["features.connection.markInitialConnections"] else 5
+    line_format = uiTools.get_color(CATEGORY_COLOR[entry_type])
+    time_width = 6 if CONFIG["features.connection.markInitialConnections"] else 5
 
-    drawEntry = [(" ", lineFormat),
-                 (self._getListingContent(width - (12 + timeWidth) - 1, listingType), lineFormat),
-                 (" " * timeWidth, lineFormat),
-                 (" (", lineFormat),
-                 (entryType.upper(), lineFormat | curses.A_BOLD),
-                 (")" + " " * (9 - len(entryType)), lineFormat)]
-    return drawEntry
+    draw_entry = [(" ", line_format),
+                  (self._get_listing_content(width - (12 + time_width) - 1, listing_type), line_format),
+                  (" " * time_width, line_format),
+                  (" (", line_format),
+                  (entry_type.upper(), line_format | curses.A_BOLD),
+                  (")" + " " * (9 - len(entry_type)), line_format)]
 
-  def _getDetails(self, width):
+    return draw_entry
+
+  def _get_details(self, width):
     """
     Provides details on the connection, correlated against available consensus
     data.
@@ -345,36 +384,39 @@ class ConnectionLine(entries.ConnectionPanelLine):
       width - available space to display in
     """
 
-    detailFormat = curses.A_BOLD | uiTools.getColor(CATEGORY_COLOR[self.getType()])
-    return [(line, detailFormat) for line in self._getDetailContent(width)]
+    detail_format = curses.A_BOLD | uiTools.get_color(CATEGORY_COLOR[self.get_type()])
+    return [(line, detail_format) for line in self._get_detail_content(width)]
 
-  def resetDisplay(self):
-    entries.ConnectionPanelLine.resetDisplay(self)
-    self.cachedType = None
+  def reset_display(self):
+    entries.ConnectionPanelLine.reset_display(self)
+    self.cached_type = None
 
-  def isPrivate(self):
+  def is_private(self):
     """
     Returns true if the endpoint is private, possibly belonging to a client
     connection or exit traffic.
     """
 
-    if not CONFIG["features.connection.showIps"]: return True
+    if not CONFIG["features.connection.showIps"]:
+      return True
 
     # This is used to scrub private information from the interface. Relaying
     # etiquette (and wiretapping laws) say these are bad things to look at so
     # DON'T CHANGE THIS UNLESS YOU HAVE A DAMN GOOD REASON!
 
-    myType = self.getType()
+    my_type = self.get_type()
 
-    if myType == Category.INBOUND:
+    if my_type == Category.INBOUND:
       # if we're a guard or bridge and the connection doesn't belong to a
       # known relay then it might be client traffic
 
-      conn = torTools.getConn()
-      if "Guard" in conn.getMyFlags([]) or conn.getOption("BridgeRelay", None) == "1":
-        allMatches = conn.getRelayFingerprint(self.foreign.getIpAddr(), getAllMatches = True)
-        return allMatches == []
-    elif myType == Category.EXIT:
+      conn = torTools.get_conn()
+
+      if "Guard" in conn.get_my_flags([]) or conn.get_option("BridgeRelay", None) == "1":
+        all_matches = conn.get_relay_fingerprint(self.foreign.get_address(), get_all_matches = True)
+
+        return all_matches == []
+    elif my_type == Category.EXIT:
       # DNS connections exiting us aren't private (since they're hitting our
       # resolvers). Everything else, however, is.
 
@@ -382,12 +424,14 @@ class ConnectionLine(entries.ConnectionPanelLine):
       # (since DNS is the only UDP connections Tor will relay), however this
       # will take a bit more work to propagate the information up from the
       # connection resolver.
-      return self.foreign.getPort() != "53"
+
+      return self.foreign.get_port() != "53"
 
     # for everything else this isn't a concern
+
     return False
 
-  def getType(self):
+  def get_type(self):
     """
     Provides our best guess at the current type of the connection. This
     depends on consensus results, our current client circuits, etc. Results
@@ -396,8 +440,9 @@ class ConnectionLine(entries.ConnectionPanelLine):
 
     # caches both to simplify the calls and to keep the type consistent until
     # we want to reflect changes
-    if not self.cachedType:
-      if self.baseType == Category.OUTBOUND:
+
+    if not self.cached_type:
+      if self.base_type == Category.OUTBOUND:
         # Currently the only non-static categories are OUTBOUND vs...
         # - EXIT since this depends on the current consensus
         # - CIRCUIT if this is likely to belong to our guard usage
@@ -406,164 +451,178 @@ class ConnectionLine(entries.ConnectionPanelLine):
         # The exitability, circuits, and fingerprints are all cached by the
         # torTools util keeping this a quick lookup.
 
-        conn = torTools.getConn()
-        destFingerprint = self.foreign.getFingerprint()
+        conn = torTools.get_conn()
+        destination_fingerprint = self.foreign.get_fingerprint()
 
-        if destFingerprint == "UNKNOWN":
+        if destination_fingerprint == "UNKNOWN":
           # Not a known relay. This might be an exit connection.
 
-          if conn.isExitingAllowed(self.foreign.getIpAddr(), self.foreign.getPort()):
-            self.cachedType = Category.EXIT
-        elif self._possibleClient or self._possibleDirectory:
+          if conn.is_exiting_allowed(self.foreign.get_address(), self.foreign.get_port()):
+            self.cached_type = Category.EXIT
+        elif self._possible_client or self._possible_directory:
           # This belongs to a known relay. If we haven't eliminated ourselves as
           # a possible client or directory connection then check if it still
           # holds true.
 
-          myCircuits = conn.getCircuits()
+          my_circuits = conn.get_circuits()
 
-          if self._possibleClient:
+          if self._possible_client:
             # Checks that this belongs to the first hop in a circuit that's
             # either unestablished or longer than a single hop (ie, anything but
             # a built 1-hop connection since those are most likely a directory
             # mirror).
 
-            for _, status, _, path in myCircuits:
-              if path and path[0] == destFingerprint and (status != "BUILT" or len(path) > 1):
-                self.cachedType = Category.CIRCUIT # matched a probable guard connection
+            for _, status, _, path in my_circuits:
+              if path and path[0] == destination_fingerprint and (status != "BUILT" or len(path) > 1):
+                self.cached_type = Category.CIRCUIT  # matched a probable guard connection
 
             # if we fell through, we can eliminate ourselves as a guard in the future
-            if not self.cachedType:
-              self._possibleClient = False
+            if not self.cached_type:
+              self._possible_client = False
 
-          if self._possibleDirectory:
+          if self._possible_directory:
             # Checks if we match a built, single hop circuit.
 
-            for _, status, _, path in myCircuits:
-              if path and path[0] == destFingerprint and status == "BUILT" and len(path) == 1:
-                self.cachedType = Category.DIRECTORY
+            for _, status, _, path in my_circuits:
+              if path and path[0] == destination_fingerprint and status == "BUILT" and len(path) == 1:
+                self.cached_type = Category.DIRECTORY
 
             # if we fell through, eliminate ourselves as a directory connection
-            if not self.cachedType:
-              self._possibleDirectory = False
+            if not self.cached_type:
+              self._possible_directory = False
 
-      if not self.cachedType:
-        self.cachedType = self.baseType
+      if not self.cached_type:
+        self.cached_type = self.base_type
 
-    return self.cachedType
+    return self.cached_type
 
-  def getEtcContent(self, width, listingType):
+  def get_etc_content(self, width, listing_type):
     """
     Provides the optional content for the connection.
 
     Arguments:
       width       - maximum length of the line
-      listingType - primary attribute we're listing connections by
+      listing_type - primary attribute we're listing connections by
     """
 
     # for applications show the command/pid
-    if self.getType() in (Category.SOCKS, Category.HIDDEN, Category.CONTROL):
-      displayLabel = ""
 
-      if self.appName:
-        if self.appPid: displayLabel = "%s (%s)" % (self.appName, self.appPid)
-        else: displayLabel = self.appName
-      elif self.isAppResolving:
-        displayLabel = "resolving..."
-      else: displayLabel = "UNKNOWN"
+    if self.get_type() in (Category.SOCKS, Category.HIDDEN, Category.CONTROL):
+      display_label = ""
 
-      if len(displayLabel) < width:
-        return ("%%-%is" % width) % displayLabel
-      else: return ""
+      if self.application_name:
+        if self.application_pid:
+          display_label = "%s (%s)" % (self.application_name, self.application_pid)
+        else:
+          display_label = self.application_name
+      elif self.is_application_resolving:
+        display_label = "resolving..."
+      else:
+        display_label = "UNKNOWN"
+
+      if len(display_label) < width:
+        return ("%%-%is" % width) % display_label
+      else:
+        return ""
 
     # for everything else display connection/consensus information
-    dstAddress = self.getDestinationLabel(26, includeLocale = True)
-    etc, usedSpace = "", 0
-    if listingType == entries.ListingType.IP_ADDRESS:
-      if width > usedSpace + 42 and CONFIG["features.connection.showColumn.fingerprint"]:
+
+    destination_address = self.get_destination_label(26, include_locale = True)
+    etc, used_space = "", 0
+
+    if listing_type == entries.ListingType.IP_ADDRESS:
+      if width > used_space + 42 and CONFIG["features.connection.showColumn.fingerprint"]:
         # show fingerprint (column width: 42 characters)
-        etc += "%-40s  " % self.foreign.getFingerprint()
-        usedSpace += 42
 
-      if width > usedSpace + 10 and CONFIG["features.connection.showColumn.nickname"]:
+        etc += "%-40s  " % self.foreign.get_fingerprint()
+        used_space += 42
+
+      if width > used_space + 10 and CONFIG["features.connection.showColumn.nickname"]:
         # show nickname (column width: remainder)
-        nicknameSpace = width - usedSpace
-        nicknameLabel = uiTools.cropStr(self.foreign.getNickname(), nicknameSpace, 0)
-        etc += ("%%-%is  " % nicknameSpace) % nicknameLabel
-        usedSpace += nicknameSpace + 2
-    elif listingType == entries.ListingType.HOSTNAME:
-      if width > usedSpace + 28 and CONFIG["features.connection.showColumn.destination"]:
+
+        nickname_space = width - used_space
+        nickname_label = uiTools.crop_str(self.foreign.get_nickname(), nickname_space, 0)
+        etc += ("%%-%is  " % nickname_space) % nickname_label
+        used_space += nickname_space + 2
+    elif listing_type == entries.ListingType.HOSTNAME:
+      if width > used_space + 28 and CONFIG["features.connection.showColumn.destination"]:
         # show destination ip/port/locale (column width: 28 characters)
-        etc += "%-26s  " % dstAddress
-        usedSpace += 28
+        etc += "%-26s  " % destination_address
+        used_space += 28
 
-      if width > usedSpace + 42 and CONFIG["features.connection.showColumn.fingerprint"]:
+      if width > used_space + 42 and CONFIG["features.connection.showColumn.fingerprint"]:
         # show fingerprint (column width: 42 characters)
-        etc += "%-40s  " % self.foreign.getFingerprint()
-        usedSpace += 42
+        etc += "%-40s  " % self.foreign.get_fingerprint()
+        used_space += 42
 
-      if width > usedSpace + 17 and CONFIG["features.connection.showColumn.nickname"]:
+      if width > used_space + 17 and CONFIG["features.connection.showColumn.nickname"]:
         # show nickname (column width: min 17 characters, uses half of the remainder)
-        nicknameSpace = 15 + (width - (usedSpace + 17)) / 2
-        nicknameLabel = uiTools.cropStr(self.foreign.getNickname(), nicknameSpace, 0)
-        etc += ("%%-%is  " % nicknameSpace) % nicknameLabel
-        usedSpace += (nicknameSpace + 2)
-    elif listingType == entries.ListingType.FINGERPRINT:
-      if width > usedSpace + 17:
+        nickname_space = 15 + (width - (used_space + 17)) / 2
+        nickname_label = uiTools.crop_str(self.foreign.get_nickname(), nickname_space, 0)
+        etc += ("%%-%is  " % nickname_space) % nickname_label
+        used_space += (nickname_space + 2)
+    elif listing_type == entries.ListingType.FINGERPRINT:
+      if width > used_space + 17:
         # show nickname (column width: min 17 characters, consumes any remaining space)
-        nicknameSpace = width - usedSpace - 2
+
+        nickname_space = width - used_space - 2
 
         # if there's room then also show a column with the destination
         # ip/port/locale (column width: 28 characters)
-        isIpLocaleIncluded = width > usedSpace + 45
-        isIpLocaleIncluded &= CONFIG["features.connection.showColumn.destination"]
-        if isIpLocaleIncluded: nicknameSpace -= 28
+
+        is_locale_included = width > used_space + 45
+        is_locale_included &= CONFIG["features.connection.showColumn.destination"]
+
+        if is_locale_included:
+          nickname_space -= 28
 
         if CONFIG["features.connection.showColumn.nickname"]:
-          nicknameLabel = uiTools.cropStr(self.foreign.getNickname(), nicknameSpace, 0)
-          etc += ("%%-%is  " % nicknameSpace) % nicknameLabel
-          usedSpace += nicknameSpace + 2
+          nickname_label = uiTools.crop_str(self.foreign.get_nickname(), nickname_space, 0)
+          etc += ("%%-%is  " % nickname_space) % nickname_label
+          used_space += nickname_space + 2
 
-        if isIpLocaleIncluded:
-          etc += "%-26s  " % dstAddress
-          usedSpace += 28
+        if is_locale_included:
+          etc += "%-26s  " % destination_address
+          used_space += 28
     else:
-      if width > usedSpace + 42 and CONFIG["features.connection.showColumn.fingerprint"]:
+      if width > used_space + 42 and CONFIG["features.connection.showColumn.fingerprint"]:
         # show fingerprint (column width: 42 characters)
-        etc += "%-40s  " % self.foreign.getFingerprint()
-        usedSpace += 42
+        etc += "%-40s  " % self.foreign.get_fingerprint()
+        used_space += 42
 
-      if width > usedSpace + 28 and CONFIG["features.connection.showColumn.destination"]:
+      if width > used_space + 28 and CONFIG["features.connection.showColumn.destination"]:
         # show destination ip/port/locale (column width: 28 characters)
-        etc += "%-26s  " % dstAddress
-        usedSpace += 28
+        etc += "%-26s  " % destination_address
+        used_space += 28
 
     return ("%%-%is" % width) % etc
 
-  def _getListingContent(self, width, listingType):
+  def _get_listing_content(self, width, listing_type):
     """
     Provides the source, destination, and extra info for our listing.
 
     Arguments:
       width       - maximum length of the line
-      listingType - primary attribute we're listing connections by
+      listing_type - primary attribute we're listing connections by
     """
 
-    conn = torTools.getConn()
-    myType = self.getType()
-    dstAddress = self.getDestinationLabel(26, includeLocale = True)
+    conn = torTools.get_conn()
+    my_type = self.get_type()
+    destination_address = self.get_destination_label(26, include_locale = True)
 
     # The required widths are the sum of the following:
     # - room for LABEL_FORMAT and LABEL_MIN_PADDING (11 characters)
     # - base data for the listing
     # - that extra field plus any previous
 
-    usedSpace = len(LABEL_FORMAT % tuple([""] * 4)) + LABEL_MIN_PADDING
-    localPort = ":%s" % self.local.getPort() if self.includePort else ""
+    used_space = len(LABEL_FORMAT % tuple([""] * 4)) + LABEL_MIN_PADDING
+    local_port = ":%s" % self.local.get_port() if self.include_port else ""
 
     src, dst, etc = "", "", ""
-    if listingType == entries.ListingType.IP_ADDRESS:
-      myExternalIpAddr = conn.getInfo("address", self.local.getIpAddr())
-      addrDiffer = myExternalIpAddr != self.local.getIpAddr()
+
+    if listing_type == entries.ListingType.IP_ADDRESS:
+      my_external_address = conn.get_info("address", self.local.get_address())
+      address_differ = my_external_address != self.local.get_address()
 
       # Expanding doesn't make sense, if the connection isn't actually
       # going through Tor's external IP address. As there isn't a known
@@ -573,105 +632,126 @@ class ConnectionLine(entries.ConnectionPanelLine):
       # the source and destination addresses are both private, but that might
       # not be perfectly reliable either.
 
-      isExpansionType = not myType in (Category.SOCKS, Category.HIDDEN, Category.CONTROL)
+      is_expansion_type = not my_type in (Category.SOCKS, Category.HIDDEN, Category.CONTROL)
 
-      if isExpansionType: srcAddress = myExternalIpAddr + localPort
-      else: srcAddress = self.local.getIpAddr() + localPort
+      if is_expansion_type:
+        src_address = my_external_address + local_port
+      else:
+        src_address = self.local.get_address() + local_port
 
-      if myType in (Category.SOCKS, Category.CONTROL):
+      if my_type in (Category.SOCKS, Category.CONTROL):
         # Like inbound connections these need their source and destination to
         # be swapped. However, this only applies when listing by IP or hostname
         # (their fingerprint and nickname are both for us). Reversing the
         # fields here to keep the same column alignments.
 
-        src = "%-21s" % dstAddress
-        dst = "%-26s" % srcAddress
+        src = "%-21s" % destination_address
+        dst = "%-26s" % src_address
       else:
-        src = "%-21s" % srcAddress # ip:port = max of 21 characters
-        dst = "%-26s" % dstAddress # ip:port (xx) = max of 26 characters
+        src = "%-21s" % src_address  # ip:port = max of 21 characters
+        dst = "%-26s" % destination_address  # ip:port (xx) = max of 26 characters
 
-      usedSpace += len(src) + len(dst) # base data requires 47 characters
+      used_space += len(src) + len(dst)  # base data requires 47 characters
 
       # Showing the fingerprint (which has the width of 42) has priority over
       # an expanded address field. Hence check if we either have space for
       # both or wouldn't be showing the fingerprint regardless.
 
-      isExpandedAddrVisible = width > usedSpace + 28
-      if isExpandedAddrVisible and CONFIG["features.connection.showColumn.fingerprint"]:
-        isExpandedAddrVisible = width < usedSpace + 42 or width > usedSpace + 70
+      is_expanded_address_visible = width > used_space + 28
+
+      if is_expanded_address_visible and CONFIG["features.connection.showColumn.fingerprint"]:
+        is_expanded_address_visible = width < used_space + 42 or width > used_space + 70
 
-      if addrDiffer and isExpansionType and isExpandedAddrVisible and self.includeExpandedIpAddr and CONFIG["features.connection.showColumn.expandedIp"]:
+      if address_differ and is_expansion_type and is_expanded_address_visible and self.include_expanded_addresses and CONFIG["features.connection.showColumn.expandedIp"]:
         # include the internal address in the src (extra 28 characters)
-        internalAddress = self.local.getIpAddr() + localPort
+
+        internal_address = self.local.get_address() + local_port
 
         # If this is an inbound connection then reverse ordering so it's:
         # <foreign> --> <external> --> <internal>
         # when the src and dst are swapped later
 
-        if myType == Category.INBOUND: src = "%-21s  -->  %s" % (src, internalAddress)
-        else: src = "%-21s  -->  %s" % (internalAddress, src)
+        if my_type == Category.INBOUND:
+          src = "%-21s  -->  %s" % (src, internal_address)
+        else:
+          src = "%-21s  -->  %s" % (internal_address, src)
 
-        usedSpace += 28
+        used_space += 28
 
-      etc = self.getEtcContent(width - usedSpace, listingType)
-      usedSpace += len(etc)
-    elif listingType == entries.ListingType.HOSTNAME:
+      etc = self.get_etc_content(width - used_space, listing_type)
+      used_space += len(etc)
+    elif listing_type == entries.ListingType.HOSTNAME:
       # 15 characters for source, and a min of 40 reserved for the destination
       # TODO: when actually functional the src and dst need to be swapped for
       # SOCKS and CONTROL connections
-      src = "localhost%-6s" % localPort
-      usedSpace += len(src)
-      minHostnameSpace = 40
 
-      etc = self.getEtcContent(width - usedSpace - minHostnameSpace, listingType)
-      usedSpace += len(etc)
+      src = "localhost%-6s" % local_port
+      used_space += len(src)
+      min_hostname_space = 40
+
+      etc = self.get_etc_content(width - used_space - min_hostname_space, listing_type)
+      used_space += len(etc)
 
-      hostnameSpace = width - usedSpace
-      usedSpace = width # prevents padding at the end
-      if self.isPrivate():
-        dst = ("%%-%is" % hostnameSpace) % "<scrubbed>"
+      hostname_space = width - used_space
+      used_space = width  # prevents padding at the end
+
+      if self.is_private():
+        dst = ("%%-%is" % hostname_space) % "<scrubbed>"
       else:
-        hostname = self.foreign.getHostname(self.foreign.getIpAddr())
-        portLabel = ":%-5s" % self.foreign.getPort() if self.includePort else ""
+        hostname = self.foreign.get_hostname(self.foreign.get_address())
+        port_label = ":%-5s" % self.foreign.get_port() if self.include_port else ""
 
         # truncates long hostnames and sets dst to <hostname>:<port>
-        hostname = uiTools.cropStr(hostname, hostnameSpace, 0)
-        dst = ("%%-%is" % hostnameSpace) % (hostname + portLabel)
-    elif listingType == entries.ListingType.FINGERPRINT:
+
+        hostname = uiTools.crop_str(hostname, hostname_space, 0)
+        dst = ("%%-%is" % hostname_space) % (hostname + port_label)
+    elif listing_type == entries.ListingType.FINGERPRINT:
       src = "localhost"
-      if myType == Category.CONTROL: dst = "localhost"
-      else: dst = self.foreign.getFingerprint()
+
+      if my_type == Category.CONTROL:
+        dst = "localhost"
+      else:
+        dst = self.foreign.get_fingerprint()
+
       dst = "%-40s" % dst
 
-      usedSpace += len(src) + len(dst) # base data requires 49 characters
+      used_space += len(src) + len(dst)  # base data requires 49 characters
 
-      etc = self.getEtcContent(width - usedSpace, listingType)
-      usedSpace += len(etc)
+      etc = self.get_etc_content(width - used_space, listing_type)
+      used_space += len(etc)
     else:
       # base data requires 50 min characters
-      src = self.local.getNickname()
-      if myType == Category.CONTROL: dst = self.local.getNickname()
-      else: dst = self.foreign.getNickname()
-      minBaseSpace = 50
+      src = self.local.get_nickname()
 
-      etc = self.getEtcContent(width - usedSpace - minBaseSpace, listingType)
-      usedSpace += len(etc)
+      if my_type == Category.CONTROL:
+        dst = self.local.get_nickname()
+      else:
+        dst = self.foreign.get_nickname()
+
+      min_base_space = 50
 
-      baseSpace = width - usedSpace
-      usedSpace = width # prevents padding at the end
+      etc = self.get_etc_content(width - used_space - min_base_space, listing_type)
+      used_space += len(etc)
 
-      if len(src) + len(dst) > baseSpace:
-        src = uiTools.cropStr(src, baseSpace / 3)
-        dst = uiTools.cropStr(dst, baseSpace - len(src))
+      base_space = width - used_space
+      used_space = width  # prevents padding at the end
+
+      if len(src) + len(dst) > base_space:
+        src = uiTools.crop_str(src, base_space / 3)
+        dst = uiTools.crop_str(dst, base_space - len(src))
 
       # pads dst entry to its max space
-      dst = ("%%-%is" % (baseSpace - len(src))) % dst
 
-    if myType == Category.INBOUND: src, dst = dst, src
-    padding = " " * (width - usedSpace + LABEL_MIN_PADDING)
+      dst = ("%%-%is" % (base_space - len(src))) % dst
+
+    if my_type == Category.INBOUND:
+      src, dst = dst, src
+
+    padding = " " * (width - used_space + LABEL_MIN_PADDING)
+
     return LABEL_FORMAT % (src, dst, etc, padding)
 
-  def _getDetailContent(self, width):
+  def _get_detail_content(self, width):
     """
     Provides a list with detailed information for this connection.
 
@@ -680,8 +760,8 @@ class ConnectionLine(entries.ConnectionPanelLine):
     """
 
     lines = [""] * 7
-    lines[0] = "address: %s" % self.getDestinationLabel(width - 11)
-    lines[1] = "locale: %s" % ("??" if self.isPrivate() else self.foreign.getLocale("??"))
+    lines[0] = "address: %s" % self.get_destination_label(width - 11)
+    lines[1] = "locale: %s" % ("??" if self.is_private() else self.foreign.get_locale("??"))
 
     # Remaining data concerns the consensus results, with three possible cases:
     # - if there's a single match then display its details
@@ -690,101 +770,118 @@ class ConnectionLine(entries.ConnectionPanelLine):
     # - if no consensus data is available then say so (probably a client or
     #   exit connection)
 
-    fingerprint = self.foreign.getFingerprint()
-    conn = torTools.getConn()
+    fingerprint = self.foreign.get_fingerprint()
+    conn = torTools.get_conn()
 
     if fingerprint != "UNKNOWN":
       # single match - display information available about it
-      nsEntry = conn.getConsensusEntry(fingerprint)
-      descEntry = conn.getDescriptorEntry(fingerprint)
+
+      ns_entry = conn.get_consensus_entry(fingerprint)
+      desc_entry = conn.get_descriptor_entry(fingerprint)
 
       # append the fingerprint to the second line
+
       lines[1] = "%-13sfingerprint: %s" % (lines[1], fingerprint)
 
-      if nsEntry:
+      if ns_entry:
         # example consensus entry:
         # r murble R8sCM1ar1sS2GulQYFVmvN95xsk RJr6q+wkTFG+ng5v2bdCbVVFfA4 2011-02-21 00:25:32 195.43.157.85 443 0
         # s Exit Fast Guard Named Running Stable Valid
         # w Bandwidth=2540
         # p accept 20-23,43,53,79-81,88,110,143,194,443
 
-        nsLines = nsEntry.split("\n")
+        ns_lines = ns_entry.split("\n")
+
+        first_line_comp = ns_lines[0].split(" ")
 
-        firstLineComp = nsLines[0].split(" ")
-        if len(firstLineComp) >= 9:
-          _, nickname, _, _, pubDate, pubTime, _, orPort, dirPort = firstLineComp[:9]
-        else: nickname, pubDate, pubTime, orPort, dirPort = "", "", "", "", ""
+        if len(first_line_comp) >= 9:
+          _, nickname, _, _, published_date, published_time, _, or_port, dir_port = first_line_comp[:9]
+        else:
+          nickname, published_date, published_time, or_port, dir_port = "", "", "", "", ""
 
         flags = "unknown"
-        if len(nsLines) >= 2 and nsLines[1].startswith("s "):
-          flags = nsLines[1][2:]
 
-        exitPolicy = conn.getRelayExitPolicy(fingerprint)
+        if len(ns_lines) >= 2 and ns_lines[1].startswith("s "):
+          flags = ns_lines[1][2:]
 
-        if exitPolicy: policyLabel = exitPolicy.summary()
-        else: policyLabel = "unknown"
+        exit_policy = conn.get_relay_exit_policy(fingerprint)
 
-        dirPortLabel = "" if dirPort == "0" else "dirport: %s" % dirPort
-        lines[2] = "nickname: %-25s orport: %-10s %s" % (nickname, orPort, dirPortLabel)
-        lines[3] = "published: %s %s" % (pubTime, pubDate)
+        if exit_policy:
+          policy_label = exit_policy.summary()
+        else:
+          policy_label = "unknown"
+
+        dir_port_label = "" if dir_port == "0" else "dirport: %s" % dir_port
+        lines[2] = "nickname: %-25s orport: %-10s %s" % (nickname, or_port, dir_port_label)
+        lines[3] = "published: %s %s" % (published_time, published_date)
         lines[4] = "flags: %s" % flags.replace(" ", ", ")
-        lines[5] = "exit policy: %s" % policyLabel
+        lines[5] = "exit policy: %s" % policy_label
 
-      if descEntry:
-        torVersion, platform, contact = "", "", ""
+      if desc_entry:
+        tor_version, platform, contact = "", "", ""
 
-        for descLine in descEntry.split("\n"):
-          if descLine.startswith("platform"):
+        for desc_line in desc_entry.split("\n"):
+          if desc_line.startswith("platform"):
             # has the tor version and platform, ex:
             # platform Tor 0.2.1.29 (r318f470bc5f2ad43) on Linux x86_64
 
-            torVersion = descLine[13:descLine.find(" ", 13)]
-            platform = descLine[descLine.rfind(" on ") + 4:]
-          elif descLine.startswith("contact"):
-            contact = descLine[8:]
+            tor_version = desc_line[13:desc_line.find(" ", 13)]
+            platform = desc_line[desc_line.rfind(" on ") + 4:]
+          elif desc_line.startswith("contact"):
+            contact = desc_line[8:]
 
             # clears up some highly common obscuring
-            for alias in (" at ", " AT "): contact = contact.replace(alias, "@")
-            for alias in (" dot ", " DOT "): contact = contact.replace(alias, ".")
 
-            break # contact lines come after the platform
+            for alias in (" at ", " AT "):
+              contact = contact.replace(alias, "@")
+
+            for alias in (" dot ", " DOT "):
+              contact = contact.replace(alias, ".")
 
-        lines[3] = "%-35s os: %-14s version: %s" % (lines[3], platform, torVersion)
+            break  # contact lines come after the platform
+
+        lines[3] = "%-35s os: %-14s version: %s" % (lines[3], platform, tor_version)
 
         # contact information is an optional field
-        if contact: lines[6] = "contact: %s" % contact
+
+        if contact:
+          lines[6] = "contact: %s" % contact
     else:
-      allMatches = conn.getRelayFingerprint(self.foreign.getIpAddr(), getAllMatches = True)
+      all_matches = conn.get_relay_fingerprint(self.foreign.get_address(), get_all_matches = True)
 
-      if allMatches:
+      if all_matches:
         # multiple matches
         lines[2] = "Multiple matches, possible fingerprints are:"
 
-        for i in range(len(allMatches)):
-          isLastLine = i == 3
+        for i in range(len(all_matches)):
+          is_last_line = i == 3
 
-          relayPort, relayFingerprint = allMatches[i]
-          lineText = "%i. or port: %-5s fingerprint: %s" % (i, relayPort, relayFingerprint)
+          relay_port, relay_fingerprint = all_matches[i]
+          line_text = "%i. or port: %-5s fingerprint: %s" % (i, relay_port, relay_fingerprint)
 
           # if there's multiple lines remaining at the end then give a count
-          remainingRelays = len(allMatches) - i
-          if isLastLine and remainingRelays > 1:
-            lineText = "... %i more" % remainingRelays
 
-          lines[3 + i] = lineText
+          remaining_relays = len(all_matches) - i
 
-          if isLastLine: break
+          if is_last_line and remaining_relays > 1:
+            line_text = "... %i more" % remaining_relays
+
+          lines[3 + i] = line_text
+
+          if is_last_line:
+            break
       else:
         # no consensus entry for this ip address
         lines[2] = "No consensus data found"
 
     # crops any lines that are too long
+
     for i in range(len(lines)):
-      lines[i] = uiTools.cropStr(lines[i], width - 2)
+      lines[i] = uiTools.crop_str(lines[i], width - 2)
 
     return lines
 
-  def getDestinationLabel(self, maxLength, includeLocale=False, includeHostname=False):
+  def get_destination_label(self, max_length, include_locale = False, include_hostname = False):
     """
     Provides a short description of the destination. This is made up of two
     components, the base <ip addr>:<port> and an extra piece of information in
@@ -797,60 +894,64 @@ class ConnectionLine(entries.ConnectionPanelLine):
     - nothing otherwise
 
     Arguments:
-      maxLength       - maximum length of the string returned
-      includeLocale   - possibly includes the locale
-      includeHostname - possibly includes the hostname
+      max_length       - maximum length of the string returned
+      include_locale   - possibly includes the locale
+      include_hostname - possibly includes the hostname
     """
 
-    # the port and port derived data can be hidden by config or without includePort
-    includePort = self.includePort and (CONFIG["features.connection.showExitPort"] or self.getType() != Category.EXIT)
+    # the port and port derived data can be hidden by config or without include_port
+
+    include_port = self.include_port and (CONFIG["features.connection.showExitPort"] or self.get_type() != Category.EXIT)
 
     # destination of the connection
-    ipLabel = "<scrubbed>" if self.isPrivate() else self.foreign.getIpAddr()
-    portLabel = ":%s" % self.foreign.getPort() if includePort else ""
-    dstAddress = ipLabel + portLabel
+
+    address_label = "<scrubbed>" if self.is_private() else self.foreign.get_address()
+    port_label = ":%s" % self.foreign.get_port() if include_port else ""
+    destination_address = address_label + port_label
 
     # Only append the extra info if there's at least a couple characters of
     # space (this is what's needed for the country codes).
-    if len(dstAddress) + 5 <= maxLength:
-      spaceAvailable = maxLength - len(dstAddress) - 3
 
-      if self.getType() == Category.EXIT and includePort:
-        purpose = connection.port_usage(self.foreign.getPort())
+    if len(destination_address) + 5 <= max_length:
+      space_available = max_length - len(destination_address) - 3
+
+      if self.get_type() == Category.EXIT and include_port:
+        purpose = connection.port_usage(self.foreign.get_port())
 
         if purpose:
           # BitTorrent is a common protocol to truncate, so just use "Torrent"
           # if there's not enough room.
-          if len(purpose) > spaceAvailable and purpose == "BitTorrent":
+
+          if len(purpose) > space_available and purpose == "BitTorrent":
             purpose = "Torrent"
 
           # crops with a hyphen if too long
-          purpose = uiTools.cropStr(purpose, spaceAvailable, endType = uiTools.Ending.HYPHEN)
 
-          dstAddress += " (%s)" % purpose
-      elif not connection.is_private_address(self.foreign.getIpAddr()):
-        extraInfo = []
-        conn = torTools.getConn()
+          purpose = uiTools.crop_str(purpose, space_available, end_type = uiTools.Ending.HYPHEN)
 
-        if includeLocale and not conn.isGeoipUnavailable():
-          foreignLocale = self.foreign.getLocale("??")
-          extraInfo.append(foreignLocale)
-          spaceAvailable -= len(foreignLocale) + 2
+          destination_address += " (%s)" % purpose
+      elif not connection.is_private_address(self.foreign.get_address()):
+        extra_info = []
+        conn = torTools.get_conn()
 
-        if includeHostname:
-          dstHostname = self.foreign.getHostname()
+        if include_locale and not conn.is_geoip_unavailable():
+          foreign_locale = self.foreign.get_locale("??")
+          extra_info.append(foreign_locale)
+          space_available -= len(foreign_locale) + 2
 
-          if dstHostname:
+        if include_hostname:
+          destination_hostname = self.foreign.get_hostname()
+
+          if destination_hostname:
             # determines the full space available, taking into account the ", "
             # dividers if there's multiple pieces of extra data
 
-            maxHostnameSpace = spaceAvailable - 2 * len(extraInfo)
-            dstHostname = uiTools.cropStr(dstHostname, maxHostnameSpace)
-            extraInfo.append(dstHostname)
-            spaceAvailable -= len(dstHostname)
-
-        if extraInfo:
-          dstAddress += " (%s)" % ", ".join(extraInfo)
+            max_hostname_space = space_available - 2 * len(extra_info)
+            destination_hostname = uiTools.crop_str(destination_hostname, max_hostname_space)
+            extra_info.append(destination_hostname)
+            space_available -= len(destination_hostname)
 
-    return dstAddress[:maxLength]
+        if extra_info:
+          destination_address += " (%s)" % ", ".join(extra_info)
 
+    return destination_address[:max_length]
diff --git a/arm/connections/connPanel.py b/arm/connections/connPanel.py
index bded9bc..f0b5ebc 100644
--- a/arm/connections/connPanel.py
+++ b/arm/connections/connPanel.py
@@ -17,22 +17,26 @@ from stem.control import State
 from stem.util import conf, connection, enum
 
 # height of the detail panel content, not counting top and bottom border
+
 DETAILS_HEIGHT = 7
 
 # listing types
+
 Listing = enum.Enum(("IP_ADDRESS", "IP Address"), "HOSTNAME", "FINGERPRINT", "NICKNAME")
 
+
 def conf_handler(key, value):
-  if key == "features.connection.listingType":
+  if key == "features.connection.listing_type":
     return conf.parse_enum(key, value, Listing)
   elif key == "features.connection.refreshRate":
     return max(1, value)
   elif key == "features.connection.order":
     return conf.parse_enum_csv(key, value[0], entries.SortAttr, 3)
 
+
 CONFIG = conf.config_dict("arm", {
   "features.connection.resolveApps": True,
-  "features.connection.listingType": Listing.IP_ADDRESS,
+  "features.connection.listing_type": Listing.IP_ADDRESS,
   "features.connection.order": [
     entries.SortAttr.CATEGORY,
     entries.SortAttr.LISTING,
@@ -41,6 +45,7 @@ CONFIG = conf.config_dict("arm", {
   "features.connection.showIps": True,
 }, conf_handler)
 
+
 class ConnectionPanel(panel.Panel, threading.Thread):
   """
   Listing of connections tor is making, with information correlated against
@@ -58,89 +63,100 @@ class ConnectionPanel(panel.Panel, threading.Thread):
     # TODO: This is a little sucky in that it won't work if showIps changes
     # while we're running (... but arm doesn't allow for that atm)
 
-    if not CONFIG["features.connection.showIps"] and CONFIG["features.connection.listingType"] == 0:
-      armConf = conf.get_config("arm")
-      armConf.set("features.connection.listingType", Listing.keys()[Listing.index_of(Listing.FINGERPRINT)])
+    if not CONFIG["features.connection.showIps"] and CONFIG["features.connection.listing_type"] == 0:
+      arm_config = conf.get_config("arm")
+      arm_config.set("features.connection.listing_type", Listing.keys()[Listing.index_of(Listing.FINGERPRINT)])
 
     self._scroller = uiTools.Scroller(True)
-    self._title = "Connections:" # title line of the panel
-    self._entries = []          # last fetched display entries
-    self._entryLines = []       # individual lines rendered from the entries listing
-    self._showDetails = False   # presents the details panel if true
-
-    self._lastUpdate = -1       # time the content was last revised
-    self._isTorRunning = True   # indicates if tor is currently running or not
-    self._haltTime = None       # time when tor was stopped
-    self._halt = False          # terminates thread if true
+    self._title = "Connections:"  # title line of the panel
+    self._entries = []            # last fetched display entries
+    self._entry_lines = []        # individual lines rendered from the entries listing
+    self._show_details = False    # presents the details panel if true
+
+    self._last_update = -1        # time the content was last revised
+    self._is_tor_running = True   # indicates if tor is currently running or not
+    self._halt_time = None        # time when tor was stopped
+    self._halt = False            # terminates thread if true
     self._cond = threading.Condition()  # used for pausing the thread
-    self.valsLock = threading.RLock()
+    self.vals_lock = threading.RLock()
 
     # Tracks exiting port and client country statistics
-    self._clientLocaleUsage = {}
-    self._exitPortUsage = {}
+
+    self._client_locale_usage = {}
+    self._exit_port_usage = {}
 
     # If we're a bridge and been running over a day then prepopulates with the
     # last day's clients.
 
-    conn = torTools.getConn()
-    bridgeClients = conn.getInfo("status/clients-seen", None)
+    conn = torTools.get_conn()
+    bridge_clients = conn.get_info("status/clients-seen", None)
 
-    if bridgeClients:
+    if bridge_clients:
       # Response has a couple arguments...
       # TimeStarted="2011-08-17 15:50:49" CountrySummary=us=16,de=8,uk=8
 
-      countrySummary = None
-      for arg in bridgeClients.split():
+      country_summary = None
+
+      for arg in bridge_clients.split():
         if arg.startswith("CountrySummary="):
-          countrySummary = arg[15:]
+          country_summary = arg[15:]
           break
 
-      if countrySummary:
-        for entry in countrySummary.split(","):
+      if country_summary:
+        for entry in country_summary.split(","):
           if re.match("^..=[0-9]+$", entry):
             locale, count = entry.split("=", 1)
-            self._clientLocaleUsage[locale] = int(count)
+            self._client_locale_usage[locale] = int(count)
 
     # Last sampling received from the ConnectionResolver, used to detect when
     # it changes.
-    self._lastResourceFetch = -1
+
+    self._last_resource_fetch = -1
 
     # resolver for the command/pid associated with SOCKS, HIDDEN, and CONTROL connections
-    self._appResolver = tracker.get_port_usage_tracker()
+
+    self._app_resolver = tracker.get_port_usage_tracker()
 
     # rate limits appResolver queries to once per update
-    self.appResolveSinceUpdate = False
+
+    self.app_resolve_since_update = False
 
     # mark the initially exitsing connection uptimes as being estimates
+
     for entry in self._entries:
       if isinstance(entry, connEntry.ConnectionEntry):
-        entry.getLines()[0].isInitialConnection = True
+        entry.getLines()[0].is_initial_connection = True
 
     # listens for when tor stops so we know to stop reflecting changes
-    conn.addStatusListener(self.torStateListener)
 
-  def torStateListener(self, controller, eventType, _):
+    conn.add_status_listener(self.tor_state_listener)
+
+  def tor_state_listener(self, controller, event_type, _):
     """
     Freezes the connection contents when Tor stops.
     """
 
-    self._isTorRunning = eventType in (State.INIT, State.RESET)
+    self._is_tor_running = event_type in (State.INIT, State.RESET)
 
-    if self._isTorRunning: self._haltTime = None
-    else: self._haltTime = time.time()
+    if self._is_tor_running:
+      self._halt_time = None
+    else:
+      self._halt_time = time.time()
 
     self.redraw(True)
 
-  def getPauseTime(self):
+  def get_pause_time(self):
     """
     Provides the time Tor stopped if it isn't running. Otherwise this is the
     time we were last paused.
     """
 
-    if self._haltTime: return self._haltTime
-    else: return panel.Panel.getPauseTime(self)
+    if self._halt_time:
+      return self._halt_time
+    else:
+      return panel.Panel.get_pause_time(self)
 
-  def setSortOrder(self, ordering = None):
+  def set_sort_order(self, ordering = None):
     """
     Sets the connection attributes we're sorting by and resorts the contents.
 
@@ -149,172 +165,204 @@ class ConnectionPanel(panel.Panel, threading.Thread):
                  set ordering
     """
 
-    self.valsLock.acquire()
+    self.vals_lock.acquire()
 
     if ordering:
-      armConf = conf.get_config("arm")
+      arm_config = conf.get_config("arm")
 
       ordering_keys = [entries.SortAttr.keys()[entries.SortAttr.index_of(v)] for v in ordering]
-      armConf.set("features.connection.order", ", ".join(ordering_keys))
+      arm_config.set("features.connection.order", ", ".join(ordering_keys))
 
-    self._entries.sort(key=lambda i: (i.getSortValues(CONFIG["features.connection.order"], self.getListingType())))
+    self._entries.sort(key = lambda i: (i.get_sort_values(CONFIG["features.connection.order"], self.get_listing_type())))
+
+    self._entry_lines = []
 
-    self._entryLines = []
     for entry in self._entries:
-      self._entryLines += entry.getLines()
-    self.valsLock.release()
+      self._entry_lines += entry.getLines()
+
+    self.vals_lock.release()
 
-  def getListingType(self):
+  def get_listing_type(self):
     """
     Provides the priority content we list connections by.
     """
 
-    return CONFIG["features.connection.listingType"]
+    return CONFIG["features.connection.listing_type"]
 
-  def setListingType(self, listingType):
+  def set_listing_type(self, listing_type):
     """
     Sets the priority information presented by the panel.
 
     Arguments:
-      listingType - Listing instance for the primary information to be shown
+      listing_type - Listing instance for the primary information to be shown
     """
 
-    if self.getListingType() == listingType: return
+    if self.get_listing_type() == listing_type:
+      return
 
-    self.valsLock.acquire()
+    self.vals_lock.acquire()
 
-    armConf = conf.get_config("arm")
-    armConf.set("features.connection.listingType", Listing.keys()[Listing.index_of(listingType)])
+    arm_config = conf.get_config("arm")
+    arm_config.set("features.connection.listing_type", Listing.keys()[Listing.index_of(listing_type)])
 
     # if we're sorting by the listing then we need to resort
+
     if entries.SortAttr.LISTING in CONFIG["features.connection.order"]:
-      self.setSortOrder()
+      self.set_sort_order()
 
-    self.valsLock.release()
+    self.vals_lock.release()
 
-  def isClientsAllowed(self):
+  def is_clients_allowed(self):
     """
     True if client connections are permissable, false otherwise.
     """
 
-    conn = torTools.getConn()
-    return "Guard" in conn.getMyFlags([]) or conn.getOption("BridgeRelay", None) == "1"
+    conn = torTools.get_conn()
+    return "Guard" in conn.get_my_flags([]) or conn.get_option("BridgeRelay", None) == "1"
 
-  def isExitsAllowed(self):
+  def is_exits_allowed(self):
     """
     True if exit connections are permissable, false otherwise.
     """
 
-    if not torTools.getConn().getOption("ORPort", None):
-      return False # no ORPort
+    if not torTools.get_conn().get_option("ORPort", None):
+      return False  # no ORPort
+
+    policy = torTools.get_conn().get_exit_policy()
 
-    policy = torTools.getConn().getExitPolicy()
     return policy and policy.is_exiting_allowed()
 
-  def showSortDialog(self):
+  def show_sort_dialog(self):
     """
     Provides the sort dialog for our connections.
     """
 
     # set ordering for connection options
-    titleLabel = "Connection Ordering:"
+
+    title_label = "Connection Ordering:"
     options = list(entries.SortAttr)
-    oldSelection = CONFIG["features.connection.order"]
-    optionColors = dict([(attr, entries.SORT_COLORS[attr]) for attr in options])
-    results = arm.popups.showSortDialog(titleLabel, options, oldSelection, optionColors)
-    if results: self.setSortOrder(results)
-
-  def handleKey(self, key):
-    self.valsLock.acquire()
-
-    isKeystrokeConsumed = True
-    if uiTools.isScrollKey(key):
-      pageHeight = self.getPreferredSize()[0] - 1
-      if self._showDetails: pageHeight -= (DETAILS_HEIGHT + 1)
-      isChanged = self._scroller.handleKey(key, self._entryLines, pageHeight)
-      if isChanged: self.redraw(True)
-    elif uiTools.isSelectionKey(key):
-      self._showDetails = not self._showDetails
+    old_selection = CONFIG["features.connection.order"]
+    option_colors = dict([(attr, entries.SORT_COLORS[attr]) for attr in options])
+    results = arm.popups.show_sort_dialog(title_label, options, old_selection, option_colors)
+
+    if results:
+      self.set_sort_order(results)
+
+  def handle_key(self, key):
+    self.vals_lock.acquire()
+
+    is_keystroke_consumed = True
+
+    if uiTools.is_scroll_key(key):
+      page_height = self.get_preferred_size()[0] - 1
+
+      if self._show_details:
+        page_height -= (DETAILS_HEIGHT + 1)
+
+      is_changed = self._scroller.handle_key(key, self._entry_lines, page_height)
+
+      if is_changed:
+        self.redraw(True)
+    elif uiTools.is_selection_key(key):
+      self._show_details = not self._show_details
       self.redraw(True)
     elif key == ord('s') or key == ord('S'):
-      self.showSortDialog()
+      self.show_sort_dialog()
     elif key == ord('u') or key == ord('U'):
       # provides a menu to pick the connection resolver
+
       title = "Resolver Util:"
       options = ["auto"] + list(connection.Resolver)
-      connResolver = arm.util.tracker.get_connection_tracker()
+      conn_resolver = arm.util.tracker.get_connection_tracker()
 
-      currentOverwrite = connResolver.get_custom_resolver()
-      if currentOverwrite == None: oldSelection = 0
-      else: oldSelection = options.index(currentOverwrite)
+      current_overwrite = conn_resolver.get_custom_resolver()
+
+      if current_overwrite is None:
+        old_selection = 0
+      else:
+        old_selection = options.index(current_overwrite)
 
-      selection = arm.popups.showMenu(title, options, oldSelection)
+      selection = arm.popups.show_menu(title, options, old_selection)
 
       # applies new setting
+
       if selection != -1:
-        selectedOption = options[selection] if selection != 0 else None
-        connResolver.set_custom_resolver(selectedOption)
+        selected_option = options[selection] if selection != 0 else None
+        conn_resolver.set_custom_resolver(selected_option)
     elif key == ord('l') or key == ord('L'):
       # provides a menu to pick the primary information we list connections by
+
       title = "List By:"
       options = list(entries.ListingType)
 
       # dropping the HOSTNAME listing type until we support displaying that content
+
       options.remove(arm.connections.entries.ListingType.HOSTNAME)
 
-      oldSelection = options.index(self.getListingType())
-      selection = arm.popups.showMenu(title, options, oldSelection)
+      old_selection = options.index(self.get_listing_type())
+      selection = arm.popups.show_menu(title, options, old_selection)
 
       # applies new setting
-      if selection != -1: self.setListingType(options[selection])
+
+      if selection != -1:
+        self.set_listing_type(options[selection])
     elif key == ord('d') or key == ord('D'):
       # presents popup for raw consensus data
-      descriptorPopup.showDescriptorPopup(self)
-    elif (key == ord('c') or key == ord('C')) and self.isClientsAllowed():
-      countPopup.showCountDialog(countPopup.CountType.CLIENT_LOCALE, self._clientLocaleUsage)
-    elif (key == ord('e') or key == ord('E')) and self.isExitsAllowed():
-      countPopup.showCountDialog(countPopup.CountType.EXIT_PORT, self._exitPortUsage)
-    else: isKeystrokeConsumed = False
+      descriptorPopup.show_descriptor_popup(self)
+    elif (key == ord('c') or key == ord('C')) and self.is_clients_allowed():
+      countPopup.showCountDialog(countPopup.CountType.CLIENT_LOCALE, self._client_locale_usage)
+    elif (key == ord('e') or key == ord('E')) and self.is_exits_allowed():
+      countPopup.showCountDialog(countPopup.CountType.EXIT_PORT, self._exit_port_usage)
+    else:
+      is_keystroke_consumed = False
 
-    self.valsLock.release()
-    return isKeystrokeConsumed
+    self.vals_lock.release()
+    return is_keystroke_consumed
 
   def run(self):
     """
     Keeps connections listing updated, checking for new entries at a set rate.
     """
 
-    lastDraw = time.time() - 1
+    last_draw = time.time() - 1
 
     # Fetches out initial connection results. The wait is so this doesn't
     # run during arm's interface initialization (otherwise there's a
     # noticeable pause before the first redraw).
+
     self._cond.acquire()
     self._cond.wait(0.2)
     self._cond.release()
-    self._update()            # populates initial entries
-    self._resolveApps(False)  # resolves initial applications
+    self._update()             # populates initial entries
+    self._resolve_apps(False)  # resolves initial applications
 
     while not self._halt:
-      currentTime = time.time()
+      current_time = time.time()
 
-      if self.isPaused() or not self._isTorRunning or currentTime - lastDraw < CONFIG["features.connection.refreshRate"]:
+      if self.is_paused() or not self._is_tor_running or current_time - last_draw < CONFIG["features.connection.refreshRate"]:
         self._cond.acquire()
-        if not self._halt: self._cond.wait(0.2)
+
+        if not self._halt:
+          self._cond.wait(0.2)
+
         self._cond.release()
       else:
         # updates content if their's new results, otherwise just redraws
+
         self._update()
         self.redraw(True)
 
         # we may have missed multiple updates due to being paused, showing
-        # another panel, etc so lastDraw might need to jump multiple ticks
-        drawTicks = (time.time() - lastDraw) / CONFIG["features.connection.refreshRate"]
-        lastDraw += CONFIG["features.connection.refreshRate"] * drawTicks
+        # another panel, etc so last_draw might need to jump multiple ticks
+
+        draw_ticks = (time.time() - last_draw) / CONFIG["features.connection.refreshRate"]
+        last_draw += CONFIG["features.connection.refreshRate"] * draw_ticks
 
-  def getHelp(self):
-    resolverUtil = arm.util.tracker.get_connection_tracker().get_custom_resolver()
-    if resolverUtil == None: resolverUtil = "auto"
+  def get_help(self):
+    resolver_util = arm.util.tracker.get_connection_tracker().get_custom_resolver()
+
+    if resolver_util is None:
+      resolver_util = "auto"
 
     options = []
     options.append(("up arrow", "scroll up a line", None))
@@ -324,90 +372,105 @@ class ConnectionPanel(panel.Panel, threading.Thread):
     options.append(("enter", "show connection details", None))
     options.append(("d", "raw consensus descriptor", None))
 
-    if self.isClientsAllowed():
+    if self.is_clients_allowed():
       options.append(("c", "client locale usage summary", None))
 
-    if self.isExitsAllowed():
+    if self.is_exits_allowed():
       options.append(("e", "exit port usage summary", None))
 
-    options.append(("l", "listed identity", self.getListingType().lower()))
+    options.append(("l", "listed identity", self.get_listing_type().lower()))
     options.append(("s", "sort ordering", None))
-    options.append(("u", "resolving utility", resolverUtil))
+    options.append(("u", "resolving utility", resolver_util))
     return options
 
-  def getSelection(self):
+  def get_selection(self):
     """
     Provides the currently selected connection entry.
     """
 
-    return self._scroller.getCursorSelection(self._entryLines)
+    return self._scroller.get_cursor_selection(self._entry_lines)
 
   def draw(self, width, height):
-    self.valsLock.acquire()
+    self.vals_lock.acquire()
 
     # if we don't have any contents then refuse to show details
-    if not self._entries: self._showDetails = False
+
+    if not self._entries:
+      self._show_details = False
 
     # extra line when showing the detail panel is for the bottom border
-    detailPanelOffset = DETAILS_HEIGHT + 1 if self._showDetails else 0
-    isScrollbarVisible = len(self._entryLines) > height - detailPanelOffset - 1
 
-    scrollLoc = self._scroller.getScrollLoc(self._entryLines, height - detailPanelOffset - 1)
-    cursorSelection = self.getSelection()
+    detail_panel_offset = DETAILS_HEIGHT + 1 if self._show_details else 0
+    is_scrollbar_visible = len(self._entry_lines) > height - detail_panel_offset - 1
+
+    scroll_location = self._scroller.get_scroll_location(self._entry_lines, height - detail_panel_offset - 1)
+    cursor_selection = self.get_selection()
 
     # draws the detail panel if currently displaying it
-    if self._showDetails and cursorSelection:
+
+    if self._show_details and cursor_selection:
       # This is a solid border unless the scrollbar is visible, in which case a
       # 'T' pipe connects the border to the bar.
-      uiTools.drawBox(self, 0, 0, width, DETAILS_HEIGHT + 2)
-      if isScrollbarVisible: self.addch(DETAILS_HEIGHT + 1, 1, curses.ACS_TTEE)
 
-      drawEntries = cursorSelection.getDetails(width)
-      for i in range(min(len(drawEntries), DETAILS_HEIGHT)):
-        self.addstr(1 + i, 2, drawEntries[i][0], drawEntries[i][1])
+      uiTools.draw_box(self, 0, 0, width, DETAILS_HEIGHT + 2)
+
+      if is_scrollbar_visible:
+        self.addch(DETAILS_HEIGHT + 1, 1, curses.ACS_TTEE)
+
+      draw_entries = cursor_selection.get_details(width)
+
+      for i in range(min(len(draw_entries), DETAILS_HEIGHT)):
+        self.addstr(1 + i, 2, draw_entries[i][0], draw_entries[i][1])
 
     # title label with connection counts
-    if self.isTitleVisible():
-      title = "Connection Details:" if self._showDetails else self._title
+
+    if self.is_title_visible():
+      title = "Connection Details:" if self._show_details else self._title
       self.addstr(0, 0, title, curses.A_STANDOUT)
 
-    scrollOffset = 0
-    if isScrollbarVisible:
-      scrollOffset = 2
-      self.addScrollBar(scrollLoc, scrollLoc + height - detailPanelOffset - 1, len(self._entryLines), 1 + detailPanelOffset)
+    scroll_offset = 0
 
-    if self.isPaused() or not self._isTorRunning:
-      currentTime = self.getPauseTime()
-    else: currentTime = time.time()
+    if is_scrollbar_visible:
+      scroll_offset = 2
+      self.add_scroll_bar(scroll_location, scroll_location + height - detail_panel_offset - 1, len(self._entry_lines), 1 + detail_panel_offset)
 
-    for lineNum in range(scrollLoc, len(self._entryLines)):
-      entryLine = self._entryLines[lineNum]
+    if self.is_paused() or not self._is_tor_running:
+      current_time = self.get_pause_time()
+    else:
+      current_time = time.time()
+
+    for line_number in range(scroll_location, len(self._entry_lines)):
+      entry_line = self._entry_lines[line_number]
 
       # if this is an unresolved SOCKS, HIDDEN, or CONTROL entry then queue up
       # resolution for the applicaitions they belong to
-      if isinstance(entryLine, connEntry.ConnectionLine) and entryLine.isUnresolvedApp():
-        self._resolveApps()
+
+      if isinstance(entry_line, connEntry.ConnectionLine) and entry_line.is_unresolved_application():
+        self._resolve_apps()
 
       # hilighting if this is the selected line
-      extraFormat = curses.A_STANDOUT if entryLine == cursorSelection else curses.A_NORMAL
 
-      drawLine = lineNum + detailPanelOffset + 1 - scrollLoc
+      extra_format = curses.A_STANDOUT if entry_line == cursor_selection else curses.A_NORMAL
+
+      draw_line = line_number + detail_panel_offset + 1 - scroll_location
+
+      prefix = entry_line.get_listing_prefix()
 
-      prefix = entryLine.getListingPrefix()
       for i in range(len(prefix)):
-        self.addch(drawLine, scrollOffset + i, prefix[i])
+        self.addch(draw_line, scroll_offset + i, prefix[i])
 
-      xOffset = scrollOffset + len(prefix)
-      drawEntry = entryLine.getListingEntry(width - scrollOffset - len(prefix), currentTime, self.getListingType())
+      x_offset = scroll_offset + len(prefix)
+      draw_entry = entry_line.get_listing_entry(width - scroll_offset - len(prefix), current_time, self.get_listing_type())
 
-      for msg, attr in drawEntry:
-        attr |= extraFormat
-        self.addstr(drawLine, xOffset, msg, attr)
-        xOffset += len(msg)
+      for msg, attr in draw_entry:
+        attr |= extra_format
+        self.addstr(draw_line, x_offset, msg, attr)
+        x_offset += len(msg)
 
-      if drawLine >= height: break
+      if draw_line >= height:
+        break
 
-    self.valsLock.release()
+    self.vals_lock.release()
 
   def stop(self):
     """
@@ -424,166 +487,182 @@ class ConnectionPanel(panel.Panel, threading.Thread):
     Fetches the newest resolved connections.
     """
 
-    self.appResolveSinceUpdate = False
+    self.app_resolve_since_update = False
 
     # if we don't have an initialized resolver then this is a no-op
-    if not arm.util.tracker.get_connection_tracker().is_alive(): return
 
-    connResolver = arm.util.tracker.get_connection_tracker()
-    currentResolutionCount = connResolver.run_counter()
+    if not arm.util.tracker.get_connection_tracker().is_alive():
+      return
 
-    self.valsLock.acquire()
+    conn_resolver = arm.util.tracker.get_connection_tracker()
+    current_resolution_count = conn_resolver.run_counter()
 
-    newEntries = [] # the new results we'll display
+    self.vals_lock.acquire()
+
+    new_entries = []  # the new results we'll display
 
     # Fetches new connections and client circuits...
-    # newConnections  [(local ip, local port, foreign ip, foreign port)...]
-    # newCircuits     {circuitID => (status, purpose, path)...}
+    # new_connections  [(local ip, local port, foreign ip, foreign port)...]
+    # new_circuits     {circuit_id => (status, purpose, path)...}
 
-    newConnections = [(conn.local_address, conn.local_port, conn.remote_address, conn.remote_port) for conn in connResolver.get_connections()]
-    newCircuits = {}
+    new_connections = [(conn.local_address, conn.local_port, conn.remote_address, conn.remote_port) for conn in conn_resolver.get_connections()]
+    new_circuits = {}
 
-    for circuitID, status, purpose, path in torTools.getConn().getCircuits():
+    for circuit_id, status, purpose, path in torTools.get_conn().get_circuits():
       # Skips established single-hop circuits (these are for directory
       # fetches, not client circuits)
+
       if not (status == "BUILT" and len(path) == 1):
-        newCircuits[circuitID] = (status, purpose, path)
+        new_circuits[circuit_id] = (status, purpose, path)
 
-    # Populates newEntries with any of our old entries that still exist.
+    # Populates new_entries with any of our old entries that still exist.
     # This is both for performance and to keep from resetting the uptime
     # attributes. Note that CircEntries are a ConnectionEntry subclass so
     # we need to check for them first.
 
-    for oldEntry in self._entries:
-      if isinstance(oldEntry, circEntry.CircEntry):
-        newEntry = newCircuits.get(oldEntry.circuitID)
+    for old_entry in self._entries:
+      if isinstance(old_entry, circEntry.CircEntry):
+        new_entry = new_circuits.get(old_entry.circuit_id)
 
-        if newEntry:
-          oldEntry.update(newEntry[0], newEntry[2])
-          newEntries.append(oldEntry)
-          del newCircuits[oldEntry.circuitID]
-      elif isinstance(oldEntry, connEntry.ConnectionEntry):
-        connLine = oldEntry.getLines()[0]
-        connAttr = (connLine.local.getIpAddr(), connLine.local.getPort(),
-                    connLine.foreign.getIpAddr(), connLine.foreign.getPort())
+        if new_entry:
+          old_entry.update(new_entry[0], new_entry[2])
+          new_entries.append(old_entry)
+          del new_circuits[old_entry.circuit_id]
+      elif isinstance(old_entry, connEntry.ConnectionEntry):
+        connection_line = old_entry.getLines()[0]
+        conn_attr = (connection_line.local.get_address(), connection_line.local.get_port(),
+                     connection_line.foreign.get_address(), connection_line.foreign.get_port())
 
-        if connAttr in newConnections:
-          newEntries.append(oldEntry)
-          newConnections.remove(connAttr)
+        if conn_attr in new_connections:
+          new_entries.append(old_entry)
+          new_connections.remove(conn_attr)
 
     # Reset any display attributes for the entries we're keeping
-    for entry in newEntries: entry.resetDisplay()
+
+    for entry in new_entries:
+      entry.reset_display()
 
     # Adds any new connection and circuit entries.
-    for lIp, lPort, fIp, fPort in newConnections:
-      newConnEntry = connEntry.ConnectionEntry(lIp, lPort, fIp, fPort)
-      newConnLine = newConnEntry.getLines()[0]
 
-      if newConnLine.getType() != connEntry.Category.CIRCUIT:
-        newEntries.append(newConnEntry)
+    for local_address, local_port, remote_address, remote_port in new_connections:
+      new_conn_entry = connEntry.ConnectionEntry(local_address, local_port, remote_address, remote_port)
+      new_conn_line = new_conn_entry.getLines()[0]
+
+      if new_conn_line.get_type() != connEntry.Category.CIRCUIT:
+        new_entries.append(new_conn_entry)
 
         # updates exit port and client locale usage information
-        if newConnLine.isPrivate():
-          if newConnLine.getType() == connEntry.Category.INBOUND:
+        if new_conn_line.is_private():
+          if new_conn_line.get_type() == connEntry.Category.INBOUND:
             # client connection, update locale information
-            clientLocale = newConnLine.foreign.getLocale()
 
-            if clientLocale:
-              self._clientLocaleUsage[clientLocale] = self._clientLocaleUsage.get(clientLocale, 0) + 1
-          elif newConnLine.getType() == connEntry.Category.EXIT:
-            exitPort = newConnLine.foreign.getPort()
-            self._exitPortUsage[exitPort] = self._exitPortUsage.get(exitPort, 0) + 1
+            client_locale = new_conn_line.foreign.get_locale()
 
-    for circuitID in newCircuits:
-      status, purpose, path = newCircuits[circuitID]
-      newEntries.append(circEntry.CircEntry(circuitID, status, purpose, path))
+            if client_locale:
+              self._client_locale_usage[client_locale] = self._client_locale_usage.get(client_locale, 0) + 1
+          elif new_conn_line.get_type() == connEntry.Category.EXIT:
+            exit_port = new_conn_line.foreign.get_port()
+            self._exit_port_usage[exit_port] = self._exit_port_usage.get(exit_port, 0) + 1
+
+    for circuit_id in new_circuits:
+      status, purpose, path = new_circuits[circuit_id]
+      new_entries.append(circEntry.CircEntry(circuit_id, status, purpose, path))
 
     # Counts the relays in each of the categories. This also flushes the
     # type cache for all of the connections (in case its changed since last
     # fetched).
 
-    categoryTypes = list(connEntry.Category)
-    typeCounts = dict((type, 0) for type in categoryTypes)
-    for entry in newEntries:
+    category_types = list(connEntry.Category)
+    type_counts = dict((type, 0) for type in category_types)
+
+    for entry in new_entries:
       if isinstance(entry, connEntry.ConnectionEntry):
-        typeCounts[entry.getLines()[0].getType()] += 1
+        type_counts[entry.getLines()[0].get_type()] += 1
       elif isinstance(entry, circEntry.CircEntry):
-        typeCounts[connEntry.Category.CIRCUIT] += 1
+        type_counts[connEntry.Category.CIRCUIT] += 1
 
     # makes labels for all the categories with connections (ie,
     # "21 outbound", "1 control", etc)
-    countLabels = []
 
-    for category in categoryTypes:
-      if typeCounts[category] > 0:
-        countLabels.append("%i %s" % (typeCounts[category], category.lower()))
+    count_labels = []
 
-    if countLabels: self._title = "Connections (%s):" % ", ".join(countLabels)
-    else: self._title = "Connections:"
+    for category in category_types:
+      if type_counts[category] > 0:
+        count_labels.append("%i %s" % (type_counts[category], category.lower()))
 
-    self._entries = newEntries
+    if count_labels:
+      self._title = "Connections (%s):" % ", ".join(count_labels)
+    else:
+      self._title = "Connections:"
+
+    self._entries = new_entries
+
+    self._entry_lines = []
 
-    self._entryLines = []
     for entry in self._entries:
-      self._entryLines += entry.getLines()
+      self._entry_lines += entry.getLines()
 
-    self.setSortOrder()
-    self._lastResourceFetch = currentResolutionCount
-    self.valsLock.release()
+    self.set_sort_order()
+    self._last_resource_fetch = current_resolution_count
+    self.vals_lock.release()
 
-  def _resolveApps(self, flagQuery = True):
+  def _resolve_apps(self, flag_query = True):
     """
     Triggers an asynchronous query for all unresolved SOCKS, HIDDEN, and
     CONTROL entries.
 
     Arguments:
-      flagQuery - sets a flag to prevent further call from being respected
+      flag_query - sets a flag to prevent further call from being respected
                   until the next update if true
     """
 
-    if self.appResolveSinceUpdate or not CONFIG["features.connection.resolveApps"]: return
-    unresolvedLines = [l for l in self._entryLines if isinstance(l, connEntry.ConnectionLine) and l.isUnresolvedApp()]
+    if self.app_resolve_since_update or not CONFIG["features.connection.resolveApps"]:
+      return
+
+    unresolved_lines = [l for l in self._entry_lines if isinstance(l, connEntry.ConnectionLine) and l.is_unresolved_application()]
 
     # get the ports used for unresolved applications
-    appPorts = []
 
-    for line in unresolvedLines:
-      appConn = line.local if line.getType() == connEntry.Category.HIDDEN else line.foreign
-      appPorts.append(appConn.getPort())
+    app_ports = []
+
+    for line in unresolved_lines:
+      app_conn = line.local if line.get_type() == connEntry.Category.HIDDEN else line.foreign
+      app_ports.append(app_conn.get_port())
 
     # Queue up resolution for the unresolved ports (skips if it's still working
     # on the last query).
-    if appPorts and not self._appResolver.is_alive():
-      self._appResolver.get_processes_using_ports(appPorts)
+
+    if app_ports and not self._app_resolver.is_alive():
+      self._app_resolver.get_processes_using_ports(app_ports)
 
     # Fetches results. If the query finishes quickly then this is what we just
     # asked for, otherwise these belong to an earlier resolution.
     #
     # The application resolver might have given up querying (for instance, if
     # the lsof lookups aren't working on this platform or lacks permissions).
-    # The isAppResolving flag lets the unresolved entries indicate if there's
+    # The is_application_resolving flag lets the unresolved entries indicate if there's
     # a lookup in progress for them or not.
 
     time.sleep(0.2)  # TODO: previous resolver only blocked while awaiting a lookup
-    appResults = self._appResolver.get_processes_using_ports(appPorts)
+    app_results = self._app_resolver.get_processes_using_ports(app_ports)
 
-    for line in unresolvedLines:
-      isLocal = line.getType() == connEntry.Category.HIDDEN
-      linePort = line.local.getPort() if isLocal else line.foreign.getPort()
+    for line in unresolved_lines:
+      is_local = line.get_type() == connEntry.Category.HIDDEN
+      line_port = line.local.get_port() if is_local else line.foreign.get_port()
 
-      if linePort in appResults:
+      if line_port in app_results:
         # sets application attributes if there's a result with this as the
         # inbound port
-        for inboundPort, outboundPort, cmd, pid in appResults[linePort]:
-          appPort = outboundPort if isLocal else inboundPort
 
-          if linePort == appPort:
-            line.appName = cmd
-            line.appPid = pid
-            line.isAppResolving = False
-      else:
-        line.isAppResolving = self._appResolver.is_alive
+        for inbound_port, outbound_port, cmd, pid in app_results[line_port]:
+          app_port = outbound_port if is_local else inbound_port
 
-    if flagQuery:
-      self.appResolveSinceUpdate = True
+          if line_port == app_port:
+            line.application_name = cmd
+            line.application_pid = pid
+            line.is_application_resolving = False
+      else:
+        line.is_application_resolving = self._app_resolver.is_alive
 
+    if flag_query:
+      self.app_resolve_since_update = True
diff --git a/arm/connections/countPopup.py b/arm/connections/countPopup.py
index 5db8362..6f561fd 100644
--- a/arm/connections/countPopup.py
+++ b/arm/connections/countPopup.py
@@ -15,88 +15,99 @@ from stem.util import connection, enum, log
 CountType = enum.Enum("CLIENT_LOCALE", "EXIT_PORT")
 EXIT_USAGE_WIDTH = 15
 
-def showCountDialog(countType, counts):
+
+def showCountDialog(count_type, counts):
   """
   Provides a dialog with bar graphs and percentages for the given set of
   counts. Pressing any key closes the dialog.
 
   Arguments:
-    countType - type of counts being presented
+    count_type - type of counts being presented
     counts    - mapping of labels to counts
   """
 
-  isNoStats = not counts
-  noStatsMsg = "Usage stats aren't available yet, press any key..."
+  is_no_stats = not counts
+  no_stats_msg = "Usage stats aren't available yet, press any key..."
 
-  if isNoStats:
-    popup, width, height = arm.popups.init(3, len(noStatsMsg) + 4)
+  if is_no_stats:
+    popup, width, height = arm.popups.init(3, len(no_stats_msg) + 4)
   else:
     popup, width, height = arm.popups.init(4 + max(1, len(counts)), 80)
-  if not popup: return
+
+  if not popup:
+    return
 
   try:
-    control = arm.controller.getController()
+    control = arm.controller.get_controller()
 
     popup.win.box()
 
     # dialog title
-    if countType == CountType.CLIENT_LOCALE:
+
+    if count_type == CountType.CLIENT_LOCALE:
       title = "Client Locales"
-    elif countType == CountType.EXIT_PORT:
+    elif count_type == CountType.EXIT_PORT:
       title = "Exiting Port Usage"
     else:
       title = ""
-      log.warn("Unrecognized count type: %s" % countType)
+      log.warn("Unrecognized count type: %s" % count_type)
 
     popup.addstr(0, 0, title, curses.A_STANDOUT)
 
-    if isNoStats:
-      popup.addstr(1, 2, noStatsMsg, curses.A_BOLD | uiTools.getColor("cyan"))
+    if is_no_stats:
+      popup.addstr(1, 2, no_stats_msg, curses.A_BOLD | uiTools.get_color("cyan"))
     else:
-      sortedCounts = sorted(counts.iteritems(), key=operator.itemgetter(1))
-      sortedCounts.reverse()
+      sorted_counts = sorted(counts.iteritems(), key=operator.itemgetter(1))
+      sorted_counts.reverse()
 
       # constructs string formatting for the max key and value display width
-      keyWidth, valWidth, valueTotal = 3, 1, 0
-      for k, v in sortedCounts:
-        keyWidth = max(keyWidth, len(k))
-        valWidth = max(valWidth, len(str(v)))
-        valueTotal += v
+
+      key_width, val_width, value_total = 3, 1, 0
+
+      for k, v in sorted_counts:
+        key_width = max(key_width, len(k))
+        val_width = max(val_width, len(str(v)))
+        value_total += v
 
       # extra space since we're adding usage informaion
-      if countType == CountType.EXIT_PORT:
-        keyWidth += EXIT_USAGE_WIDTH
 
-      labelFormat = "%%-%is %%%ii (%%%%%%-2i)" % (keyWidth, valWidth)
+      if count_type == CountType.EXIT_PORT:
+        key_width += EXIT_USAGE_WIDTH
+
+      label_format = "%%-%is %%%ii (%%%%%%-2i)" % (key_width, val_width)
 
       for i in range(height - 4):
-        k, v = sortedCounts[i]
+        k, v = sorted_counts[i]
 
         # includes a port usage column
-        if countType == CountType.EXIT_PORT:
+
+        if count_type == CountType.EXIT_PORT:
           usage = connection.port_usage(k)
 
           if usage:
-            keyFormat = "%%-%is   %%s" % (keyWidth - EXIT_USAGE_WIDTH)
-            k = keyFormat % (k, usage[:EXIT_USAGE_WIDTH - 3])
+            key_format = "%%-%is   %%s" % (key_width - EXIT_USAGE_WIDTH)
+            k = key_format % (k, usage[:EXIT_USAGE_WIDTH - 3])
 
-        label = labelFormat % (k, v, v * 100 / valueTotal)
-        popup.addstr(i + 1, 2, label, curses.A_BOLD | uiTools.getColor("green"))
+        label = label_format % (k, v, v * 100 / value_total)
+        popup.addstr(i + 1, 2, label, curses.A_BOLD | uiTools.get_color("green"))
 
         # All labels have the same size since they're based on the max widths.
         # If this changes then this'll need to be the max label width.
-        labelWidth = len(label)
+
+        label_width = len(label)
 
         # draws simple bar graph for percentages
-        fillWidth = v * (width - 4 - labelWidth) / valueTotal
-        for j in range(fillWidth):
-          popup.addstr(i + 1, 3 + labelWidth + j, " ", curses.A_STANDOUT | uiTools.getColor("red"))
+
+        fill_width = v * (width - 4 - label_width) / value_total
+
+        for j in range(fill_width):
+          popup.addstr(i + 1, 3 + label_width + j, " ", curses.A_STANDOUT | uiTools.get_color("red"))
 
       popup.addstr(height - 2, 2, "Press any key...")
 
     popup.win.refresh()
 
     curses.cbreak()
-    control.getScreen().getch()
-  finally: arm.popups.finalize()
-
+    control.get_screen().getch()
+  finally:
+    arm.popups.finalize()
diff --git a/arm/connections/descriptorPopup.py b/arm/connections/descriptorPopup.py
index d4ab918..3404c92 100644
--- a/arm/connections/descriptorPopup.py
+++ b/arm/connections/descriptorPopup.py
@@ -11,6 +11,7 @@ import arm.connections.connEntry
 from arm.util import panel, torTools, uiTools
 
 # field keywords used to identify areas for coloring
+
 LINE_NUM_COLOR = "yellow"
 HEADER_COLOR = "cyan"
 HEADER_PREFIX = ["ns/id/", "desc/id/"]
@@ -22,7 +23,8 @@ SIG_END_KEYS = ["-----END RSA PUBLIC KEY-----", "-----END SIGNATURE-----"]
 UNRESOLVED_MSG = "No consensus data available"
 ERROR_MSG = "Unable to retrieve data"
 
-def showDescriptorPopup(connPanel):
+
+def show_descriptor_popup(conn_panel):
   """
   Presents consensus descriptor in popup window with the following controls:
   Up, Down, Page Up, Page Down - scroll descriptor
@@ -30,46 +32,55 @@ def showDescriptorPopup(connPanel):
   Enter, Space, d, D - close popup
 
   Arguments:
-    connPanel - connection panel providing the dialog
+    conn_panel - connection panel providing the dialog
   """
 
   # hides the title of the connection panel
-  connPanel.setTitleVisible(False)
-  connPanel.redraw(True)
 
-  control = arm.controller.getController()
+  conn_panel.set_title_visible(False)
+  conn_panel.redraw(True)
+
+  control = arm.controller.get_controller()
   panel.CURSES_LOCK.acquire()
-  isDone = False
+  is_done = False
 
   try:
-    while not isDone:
-      selection = connPanel.getSelection()
-      if not selection: break
+    while not is_done:
+      selection = conn_panel.get_selection()
+
+      if not selection:
+        break
+
+      fingerprint = selection.foreign.get_fingerprint()
+
+      if fingerprint == "UNKNOWN":
+        fingerprint = None
+
+      display_text = get_display_text(fingerprint)
+      display_color = arm.connections.connEntry.CATEGORY_COLOR[selection.get_type()]
+      show_line_number = fingerprint is not None
 
-      fingerprint = selection.foreign.getFingerprint()
-      if fingerprint == "UNKNOWN": fingerprint = None
+      # determines the maximum popup size the display_text can fill
 
-      displayText = getDisplayText(fingerprint)
-      displayColor = arm.connections.connEntry.CATEGORY_COLOR[selection.getType()]
-      showLineNumber = fingerprint != None
+      popup_height, popup_width = get_preferred_size(display_text, conn_panel.max_x, show_line_number)
 
-      # determines the maximum popup size the displayText can fill
-      pHeight, pWidth = getPreferredSize(displayText, connPanel.maxX, showLineNumber)
+      popup, _, height = arm.popups.init(popup_height, popup_width)
 
-      popup, _, height = arm.popups.init(pHeight, pWidth)
-      if not popup: break
-      scroll, isChanged = 0, True
+      if not popup:
+        break
+
+      scroll, is_changed = 0, True
 
       try:
-        while not isDone:
-          if isChanged:
-            draw(popup, fingerprint, displayText, displayColor, scroll, showLineNumber)
-            isChanged = False
+        while not is_done:
+          if is_changed:
+            draw(popup, fingerprint, display_text, display_color, scroll, show_line_number)
+            is_changed = False
 
-          key = control.getScreen().getch()
+          key = control.get_screen().getch()
 
-          if uiTools.isScrollKey(key):
-            # TODO: This is a bit buggy in that scrolling is by displayText
+          if uiTools.is_scroll_key(key):
+            # TODO: This is a bit buggy in that scrolling is by display_text
             # lines rather than the displayed lines, causing issues when
             # content wraps. The result is that we can't have a scrollbar and
             # can't scroll to the bottom if there's a multi-line being
@@ -77,153 +88,185 @@ def showDescriptorPopup(connPanel):
             # of worms and after hours decided that this isn't worth the
             # effort...
 
-            newScroll = uiTools.getScrollPosition(key, scroll, height - 2, len(displayText))
+            new_scroll = uiTools.get_scroll_position(key, scroll, height - 2, len(display_text))
 
-            if scroll != newScroll:
-              scroll, isChanged = newScroll, True
-          elif uiTools.isSelectionKey(key) or key in (ord('d'), ord('D')):
-            isDone = True # closes popup
+            if scroll != new_scroll:
+              scroll, is_changed = new_scroll, True
+          elif uiTools.is_selection_key(key) or key in (ord('d'), ord('D')):
+            is_done = True  # closes popup
           elif key in (curses.KEY_LEFT, curses.KEY_RIGHT):
-            # navigation - pass on to connPanel and recreate popup
-            connPanel.handleKey(curses.KEY_UP if key == curses.KEY_LEFT else curses.KEY_DOWN)
+            # navigation - pass on to conn_panel and recreate popup
+
+            conn_panel.handle_key(curses.KEY_UP if key == curses.KEY_LEFT else curses.KEY_DOWN)
             break
-      finally: arm.popups.finalize()
+      finally:
+        arm.popups.finalize()
   finally:
-    connPanel.setTitleVisible(True)
-    connPanel.redraw(True)
+    conn_panel.set_title_visible(True)
+    conn_panel.redraw(True)
     panel.CURSES_LOCK.release()
 
-def getDisplayText(fingerprint):
+
+def get_display_text(fingerprint):
   """
   Provides the descriptor and consensus entry for a relay. This is a list of
   lines to be displayed by the dialog.
   """
 
-  if not fingerprint: return [UNRESOLVED_MSG]
-  conn, description = torTools.getConn(), []
+  if not fingerprint:
+    return [UNRESOLVED_MSG]
+
+  conn, description = torTools.get_conn(), []
 
   description.append("ns/id/%s" % fingerprint)
-  consensusEntry = conn.getConsensusEntry(fingerprint)
+  consensus_entry = conn.get_consensus_entry(fingerprint)
 
-  if consensusEntry: description += consensusEntry.split("\n")
-  else: description += [ERROR_MSG, ""]
+  if consensus_entry:
+    description += consensus_entry.split("\n")
+  else:
+    description += [ERROR_MSG, ""]
 
   description.append("desc/id/%s" % fingerprint)
-  descriptorEntry = conn.getDescriptorEntry(fingerprint)
+  descriptor_entry = conn.get_descriptor_entry(fingerprint)
 
-  if descriptorEntry: description += descriptorEntry.split("\n")
-  else: description += [ERROR_MSG]
+  if descriptor_entry:
+    description += descriptor_entry.split("\n")
+  else:
+    description += [ERROR_MSG]
 
   return description
 
-def getPreferredSize(text, maxWidth, showLineNumber):
+
+def get_preferred_size(text, max_width, show_line_number):
   """
   Provides the (height, width) tuple for the preferred size of the given text.
   """
 
   width, height = 0, len(text) + 2
-  lineNumWidth = int(math.log10(len(text))) + 1
+  line_number_width = int(math.log10(len(text))) + 1
+
   for line in text:
     # width includes content, line number field, and border
-    lineWidth = len(line) + 5
-    if showLineNumber: lineWidth += lineNumWidth
-    width = max(width, lineWidth)
+
+    line_width = len(line) + 5
+
+    if show_line_number:
+      line_width += line_number_width
+
+    width = max(width, line_width)
 
     # tracks number of extra lines that will be taken due to text wrap
-    height += (lineWidth - 2) / maxWidth
+    height += (line_width - 2) / max_width
 
   return (height, width)
 
-def draw(popup, fingerprint, displayText, displayColor, scroll, showLineNumber):
+
+def draw(popup, fingerprint, display_text, display_color, scroll, show_line_number):
   popup.win.erase()
   popup.win.box()
-  xOffset = 2
+  x_offset = 2
+
+  if fingerprint:
+    title = "Consensus Descriptor (%s):" % fingerprint
+  else:
+    title = "Consensus Descriptor:"
 
-  if fingerprint: title = "Consensus Descriptor (%s):" % fingerprint
-  else: title = "Consensus Descriptor:"
   popup.addstr(0, 0, title, curses.A_STANDOUT)
 
-  lineNumWidth = int(math.log10(len(displayText))) + 1
-  isEncryptionBlock = False   # flag indicating if we're currently displaying a key
+  line_number_width = int(math.log10(len(display_text))) + 1
+  is_encryption_block = False   # flag indicating if we're currently displaying a key
 
   # checks if first line is in an encryption block
+
   for i in range(0, scroll):
-    lineText = displayText[i].strip()
-    if lineText in SIG_START_KEYS: isEncryptionBlock = True
-    elif lineText in SIG_END_KEYS: isEncryptionBlock = False
+    line_text = display_text[i].strip()
 
-  drawLine, pageHeight = 1, popup.maxY - 2
-  for i in range(scroll, scroll + pageHeight):
-    lineText = displayText[i].strip()
-    xOffset = 2
+    if line_text in SIG_START_KEYS:
+      is_encryption_block = True
+    elif line_text in SIG_END_KEYS:
+      is_encryption_block = False
 
-    if showLineNumber:
-      lineNumLabel = ("%%%ii" % lineNumWidth) % (i + 1)
-      lineNumFormat = curses.A_BOLD | uiTools.getColor(LINE_NUM_COLOR)
+  draw_line, page_height = 1, popup.max_y - 2
 
-      popup.addstr(drawLine, xOffset, lineNumLabel, lineNumFormat)
-      xOffset += lineNumWidth + 1
+  for i in range(scroll, scroll + page_height):
+    line_text = display_text[i].strip()
+    x_offset = 2
+
+    if show_line_number:
+      line_number_label = ("%%%ii" % line_number_width) % (i + 1)
+      line_number_format = curses.A_BOLD | uiTools.get_color(LINE_NUM_COLOR)
+
+      popup.addstr(draw_line, x_offset, line_number_label, line_number_format)
+      x_offset += line_number_width + 1
 
     # Most consensus and descriptor lines are keyword/value pairs. Both are
     # shown with the same color, but the keyword is bolded.
 
-    keyword, value = lineText, ""
-    drawFormat = uiTools.getColor(displayColor)
-
-    if lineText.startswith(HEADER_PREFIX[0]) or lineText.startswith(HEADER_PREFIX[1]):
-      keyword, value = lineText, ""
-      drawFormat = uiTools.getColor(HEADER_COLOR)
-    elif lineText == UNRESOLVED_MSG or lineText == ERROR_MSG:
-      keyword, value = lineText, ""
-    elif lineText in SIG_START_KEYS:
-      keyword, value = lineText, ""
-      isEncryptionBlock = True
-      drawFormat = uiTools.getColor(SIG_COLOR)
-    elif lineText in SIG_END_KEYS:
-      keyword, value = lineText, ""
-      isEncryptionBlock = False
-      drawFormat = uiTools.getColor(SIG_COLOR)
-    elif isEncryptionBlock:
-      keyword, value = "", lineText
-      drawFormat = uiTools.getColor(SIG_COLOR)
-    elif " " in lineText:
-      divIndex = lineText.find(" ")
-      keyword, value = lineText[:divIndex], lineText[divIndex:]
-
-    displayQueue = [(keyword, drawFormat | curses.A_BOLD), (value, drawFormat)]
-    cursorLoc = xOffset
-
-    while displayQueue:
-      msg, format = displayQueue.pop(0)
-      if not msg: continue
-
-      maxMsgSize = popup.maxX - 1 - cursorLoc
-      if len(msg) >= maxMsgSize:
+    keyword, value = line_text, ""
+    draw_format = uiTools.get_color(display_color)
+
+    if line_text.startswith(HEADER_PREFIX[0]) or line_text.startswith(HEADER_PREFIX[1]):
+      keyword, value = line_text, ""
+      draw_format = uiTools.get_color(HEADER_COLOR)
+    elif line_text == UNRESOLVED_MSG or line_text == ERROR_MSG:
+      keyword, value = line_text, ""
+    elif line_text in SIG_START_KEYS:
+      keyword, value = line_text, ""
+      is_encryption_block = True
+      draw_format = uiTools.get_color(SIG_COLOR)
+    elif line_text in SIG_END_KEYS:
+      keyword, value = line_text, ""
+      is_encryption_block = False
+      draw_format = uiTools.get_color(SIG_COLOR)
+    elif is_encryption_block:
+      keyword, value = "", line_text
+      draw_format = uiTools.get_color(SIG_COLOR)
+    elif " " in line_text:
+      div_index = line_text.find(" ")
+      keyword, value = line_text[:div_index], line_text[div_index:]
+
+    display_queue = [(keyword, draw_format | curses.A_BOLD), (value, draw_format)]
+    cursor_location = x_offset
+
+    while display_queue:
+      msg, msg_format = display_queue.pop(0)
+
+      if not msg:
+        continue
+
+      max_msg_size = popup.max_x - 1 - cursor_location
+
+      if len(msg) >= max_msg_size:
         # needs to split up the line
-        msg, remainder = uiTools.cropStr(msg, maxMsgSize, None, endType = None, getRemainder = True)
 
-        if xOffset == cursorLoc and msg == "":
+        msg, remainder = uiTools.crop_str(msg, max_msg_size, None, end_type = None, get_remainder = True)
+
+        if x_offset == cursor_location and msg == "":
           # first word is longer than the line
-          msg = uiTools.cropStr(remainder, maxMsgSize)
+
+          msg = uiTools.crop_str(remainder, max_msg_size)
 
           if " " in remainder:
             remainder = remainder.split(" ", 1)[1]
-          else: remainder = ""
+          else:
+            remainder = ""
 
-        popup.addstr(drawLine, cursorLoc, msg, format)
-        cursorLoc = xOffset
+        popup.addstr(draw_line, cursor_location, msg, msg_format)
+        cursor_location = x_offset
 
         if remainder:
-          displayQueue.insert(0, (remainder.strip(), format))
-          drawLine += 1
+          display_queue.insert(0, (remainder.strip(), msg_format))
+          draw_line += 1
       else:
-        popup.addstr(drawLine, cursorLoc, msg, format)
-        cursorLoc += len(msg)
+        popup.addstr(draw_line, cursor_location, msg, msg_format)
+        cursor_location += len(msg)
 
-      if drawLine > pageHeight: break
+      if draw_line > page_height:
+        break
 
-    drawLine += 1
-    if drawLine > pageHeight: break
+    draw_line += 1
 
-  popup.win.refresh()
+    if draw_line > page_height:
+      break
 
+  popup.win.refresh()
diff --git a/arm/connections/entries.py b/arm/connections/entries.py
index bf319d8..85bce32 100644
--- a/arm/connections/entries.py
+++ b/arm/connections/entries.py
@@ -7,20 +7,28 @@ consists of in the listing.
 from stem.util import enum
 
 # attributes we can list entries by
+
 ListingType = enum.Enum(("IP_ADDRESS", "IP Address"), "HOSTNAME", "FINGERPRINT", "NICKNAME")
 
-SortAttr = enum.Enum("CATEGORY", "UPTIME", "LISTING", "IP_ADDRESS", "PORT",
-                     "HOSTNAME", "FINGERPRINT", "NICKNAME", "COUNTRY")
+SortAttr = enum.Enum("CATEGORY", "UPTIME", "LISTING", "IP_ADDRESS", "PORT", "HOSTNAME", "FINGERPRINT", "NICKNAME", "COUNTRY")
 
-SORT_COLORS = {SortAttr.CATEGORY: "red",      SortAttr.UPTIME: "yellow",
-               SortAttr.LISTING: "green",     SortAttr.IP_ADDRESS: "blue",
-               SortAttr.PORT: "blue",         SortAttr.HOSTNAME: "magenta",
-               SortAttr.FINGERPRINT: "cyan",  SortAttr.NICKNAME: "cyan",
-               SortAttr.COUNTRY: "blue"}
+SORT_COLORS = {
+  SortAttr.CATEGORY: "red",
+  SortAttr.UPTIME: "yellow",
+  SortAttr.LISTING: "green",
+  SortAttr.IP_ADDRESS: "blue",
+  SortAttr.PORT: "blue",
+  SortAttr.HOSTNAME: "magenta",
+  SortAttr.FINGERPRINT: "cyan",
+  SortAttr.NICKNAME: "cyan",
+  SortAttr.COUNTRY: "blue",
+}
 
 # maximum number of ports a system can have
+
 PORT_COUNT = 65536
 
+
 class ConnectionPanelEntry:
   """
   Common parent for connection panel entries. This consists of a list of lines
@@ -30,71 +38,72 @@ class ConnectionPanelEntry:
 
   def __init__(self):
     self.lines = []
-    self.flushCache = True
+    self.flush_cache = True
 
   def getLines(self):
     """
     Provides the individual lines in the connection listing.
     """
 
-    if self.flushCache:
-      self.lines = self._getLines(self.lines)
-      self.flushCache = False
+    if self.flush_cache:
+      self.lines = self._get_lines(self.lines)
+      self.flush_cache = False
 
     return self.lines
 
-  def _getLines(self, oldResults):
+  def _get_lines(self, old_results):
     # implementation of getLines
 
-    for line in oldResults:
-      line.resetDisplay()
+    for line in old_results:
+      line.reset_display()
 
-    return oldResults
+    return old_results
 
-  def getSortValues(self, sortAttrs, listingType):
+  def get_sort_values(self, sort_attrs, listing_type):
     """
     Provides the value used in comparisons to sort based on the given
     attribute.
 
     Arguments:
-      sortAttrs   - list of SortAttr values for the field being sorted on
-      listingType - ListingType enumeration for the attribute we're listing
+      sort_attrs   - list of SortAttr values for the field being sorted on
+      listing_type - ListingType enumeration for the attribute we're listing
                     entries by
     """
 
-    return [self.getSortValue(attr, listingType) for attr in sortAttrs]
+    return [self.get_sort_value(attr, listing_type) for attr in sort_attrs]
 
-  def getSortValue(self, attr, listingType):
+  def get_sort_value(self, attr, listing_type):
     """
     Provides the value of a single attribute used for sorting purposes.
 
     Arguments:
       attr        - list of SortAttr values for the field being sorted on
-      listingType - ListingType enumeration for the attribute we're listing
+      listing_type - ListingType enumeration for the attribute we're listing
                     entries by
     """
 
     if attr == SortAttr.LISTING:
-      if listingType == ListingType.IP_ADDRESS:
+      if listing_type == ListingType.IP_ADDRESS:
         # uses the IP address as the primary value, and port as secondary
-        sortValue = self.getSortValue(SortAttr.IP_ADDRESS, listingType) * PORT_COUNT
-        sortValue += self.getSortValue(SortAttr.PORT, listingType)
-        return sortValue
-      elif listingType == ListingType.HOSTNAME:
-        return self.getSortValue(SortAttr.HOSTNAME, listingType)
-      elif listingType == ListingType.FINGERPRINT:
-        return self.getSortValue(SortAttr.FINGERPRINT, listingType)
-      elif listingType == ListingType.NICKNAME:
-        return self.getSortValue(SortAttr.NICKNAME, listingType)
+        sort_value = self.get_sort_value(SortAttr.IP_ADDRESS, listing_type) * PORT_COUNT
+        sort_value += self.get_sort_value(SortAttr.PORT, listing_type)
+        return sort_value
+      elif listing_type == ListingType.HOSTNAME:
+        return self.get_sort_value(SortAttr.HOSTNAME, listing_type)
+      elif listing_type == ListingType.FINGERPRINT:
+        return self.get_sort_value(SortAttr.FINGERPRINT, listing_type)
+      elif listing_type == ListingType.NICKNAME:
+        return self.get_sort_value(SortAttr.NICKNAME, listing_type)
 
     return ""
 
-  def resetDisplay(self):
+  def reset_display(self):
     """
     Flushes cached display results.
     """
 
-    self.flushCache = True
+    self.flush_cache = True
+
 
 class ConnectionPanelLine:
   """
@@ -103,46 +112,46 @@ class ConnectionPanelLine:
 
   def __init__(self):
     # cache for displayed information
-    self._listingCache = None
-    self._listingCacheArgs = (None, None)
+    self._listing_cache = None
+    self._listing_cache_args = (None, None)
 
-    self._detailsCache = None
-    self._detailsCacheArgs = None
+    self._details_cache = None
+    self._details_cache_args = None
 
-    self._descriptorCache = None
-    self._descriptorCacheArgs = None
+    self._descriptor_cache = None
+    self._descriptor_cache_args = None
 
-  def getListingPrefix(self):
+  def get_listing_prefix(self):
     """
     Provides a list of characters to be appended before the listing entry.
     """
 
     return ()
 
-  def getListingEntry(self, width, currentTime, listingType):
+  def get_listing_entry(self, width, current_time, listing_type):
     """
     Provides a [(msg, attr)...] tuple list for contents to be displayed in the
     connection panel listing.
 
     Arguments:
       width       - available space to display in
-      currentTime - unix timestamp for what the results should consider to be
+      current_time - unix timestamp for what the results should consider to be
                     the current time (this may be ignored due to caching)
-      listingType - ListingType enumeration for the highest priority content
+      listing_type - ListingType enumeration for the highest priority content
                     to be displayed
     """
 
-    if self._listingCacheArgs != (width, listingType):
-      self._listingCache = self._getListingEntry(width, currentTime, listingType)
-      self._listingCacheArgs = (width, listingType)
+    if self._listing_cache_args != (width, listing_type):
+      self._listing_cache = self._get_listing_entry(width, current_time, listing_type)
+      self._listing_cache_args = (width, listing_type)
 
-    return self._listingCache
+    return self._listing_cache
 
-  def _getListingEntry(self, width, currentTime, listingType):
-    # implementation of getListingEntry
+  def _get_listing_entry(self, width, current_time, listing_type):
+    # implementation of get_listing_entry
     return None
 
-  def getDetails(self, width):
+  def get_details(self, width):
     """
     Provides a list of [(msg, attr)...] tuple listings with detailed
     information for this connection.
@@ -151,21 +160,20 @@ class ConnectionPanelLine:
       width - available space to display in
     """
 
-    if self._detailsCacheArgs != width:
-      self._detailsCache = self._getDetails(width)
-      self._detailsCacheArgs = width
+    if self._details_cache_args != width:
+      self._details_cache = self._get_details(width)
+      self._details_cache_args = width
 
-    return self._detailsCache
+    return self._details_cache
 
-  def _getDetails(self, width):
-    # implementation of getDetails
+  def _get_details(self, width):
+    # implementation of get_details
     return []
 
-  def resetDisplay(self):
+  def reset_display(self):
     """
     Flushes cached display results.
     """
 
-    self._listingCacheArgs = (None, None)
-    self._detailsCacheArgs = None
-
+    self._listing_cache_args = (None, None)
+    self._details_cache_args = None
diff --git a/arm/controller.py b/arm/controller.py
index d907b40..52a3c7c 100644
--- a/arm/controller.py
+++ b/arm/controller.py
@@ -30,15 +30,17 @@ from stem.util import conf, enum, log, system
 
 ARM_CONTROLLER = None
 
+
 def conf_handler(key, value):
   if key == "features.redrawRate":
     return max(1, value)
   elif key == "features.refreshRate":
     return max(0, value)
 
+
 CONFIG = conf.config_dict("arm", {
   "startup.events": "N3",
-  "startup.dataDirectory": "~/.arm",
+  "startup.data_directory": "~/.arm",
   "features.panels.show.graph": True,
   "features.panels.show.log": True,
   "features.panels.show.connection": True,
@@ -55,35 +57,39 @@ CONFIG = conf.config_dict("arm", {
 GraphStat = enum.Enum("BANDWIDTH", "CONNECTIONS", "SYSTEM_RESOURCES")
 
 # maps 'features.graph.type' config values to the initial types
+
 GRAPH_INIT_STATS = {1: GraphStat.BANDWIDTH, 2: GraphStat.CONNECTIONS, 3: GraphStat.SYSTEM_RESOURCES}
 
-def getController():
+
+def get_controller():
   """
   Provides the arm controller instance.
   """
 
   return ARM_CONTROLLER
 
+
 def stop_controller():
   """
   Halts our Controller, providing back the thread doing so.
   """
 
   def halt_controller():
-    control = getController()
+    control = get_controller()
 
     if control:
-      for panel_impl in control.getDaemonPanels():
+      for panel_impl in control.get_daemon_panels():
         panel_impl.stop()
 
-      for panel_impl in control.getDaemonPanels():
+      for panel_impl in control.get_daemon_panels():
         panel_impl.join()
 
   halt_thread = threading.Thread(target = halt_controller)
   halt_thread.start()
   return halt_thread
 
-def initController(stdscr, startTime):
+
+def init_controller(stdscr, start_time):
   """
   Spawns the controller, and related panels for it.
 
@@ -94,29 +100,34 @@ def initController(stdscr, startTime):
   global ARM_CONTROLLER
 
   # initializes the panels
-  stickyPanels = [arm.headerPanel.HeaderPanel(stdscr, startTime),
-                  LabelPanel(stdscr)]
-  pagePanels, firstPagePanels = [], []
+
+  sticky_panels = [
+    arm.headerPanel.HeaderPanel(stdscr, start_time),
+    LabelPanel(stdscr),
+  ]
+
+  page_panels, first_page_panels = [], []
 
   # first page: graph and log
   if CONFIG["features.panels.show.graph"]:
-    firstPagePanels.append(arm.graphing.graphPanel.GraphPanel(stdscr))
+    first_page_panels.append(arm.graphing.graphPanel.GraphPanel(stdscr))
 
   if CONFIG["features.panels.show.log"]:
-    expandedEvents = arm.arguments.expand_events(CONFIG["startup.events"])
-    firstPagePanels.append(arm.logPanel.LogPanel(stdscr, expandedEvents))
+    expanded_events = arm.arguments.expand_events(CONFIG["startup.events"])
+    first_page_panels.append(arm.logPanel.LogPanel(stdscr, expanded_events))
 
-  if firstPagePanels: pagePanels.append(firstPagePanels)
+  if first_page_panels:
+    page_panels.append(first_page_panels)
 
   # second page: connections
   if CONFIG["features.panels.show.connection"]:
-    pagePanels.append([arm.connections.connPanel.ConnectionPanel(stdscr)])
+    page_panels.append([arm.connections.connPanel.ConnectionPanel(stdscr)])
 
     # The DisableDebuggerAttachment will prevent our connection panel from really
     # functioning. It'll have circuits, but little else. If this is the case then
     # notify the user and tell them what they can do to fix it.
 
-    controller = torTools.getConn().controller
+    controller = torTools.get_conn().controller
 
     if controller.get_conf("DisableDebuggerAttachment", None) == "1":
       log.notice("Tor is preventing system utilities like netstat and lsof from working. This means that arm can't provide you with connection information. You can change this by adding 'DisableDebuggerAttachment 0' to your torrc and restarting tor. For more information see...\nhttps://trac.torproject.org/3313")
@@ -125,7 +136,7 @@ def initController(stdscr, startTime):
       # Configures connection resoultions. This is paused/unpaused according to
       # if Tor's connected or not.
 
-      controller.add_status_listener(connResetListener)
+      controller.add_status_listener(conn_reset_listener)
 
       tor_pid = controller.get_pid(None)
 
@@ -142,41 +153,53 @@ def initController(stdscr, startTime):
       else:
         # constructs singleton resolver and, if tor isn't connected, initizes
         # it to be paused
+
         arm.util.tracker.get_connection_tracker().set_paused(not controller.is_alive())
 
   # third page: config
+
   if CONFIG["features.panels.show.config"]:
-    pagePanels.append([arm.configPanel.ConfigPanel(stdscr, arm.configPanel.State.TOR)])
+    page_panels.append([arm.configPanel.ConfigPanel(stdscr, arm.configPanel.State.TOR)])
 
   # fourth page: torrc
+
   if CONFIG["features.panels.show.torrc"]:
-    pagePanels.append([arm.torrcPanel.TorrcPanel(stdscr, arm.torrcPanel.Config.TORRC)])
+    page_panels.append([arm.torrcPanel.TorrcPanel(stdscr, arm.torrcPanel.Config.TORRC)])
 
   # initializes the controller
-  ARM_CONTROLLER = Controller(stdscr, stickyPanels, pagePanels)
+
+  ARM_CONTROLLER = Controller(stdscr, sticky_panels, page_panels)
 
   # additional configuration for the graph panel
-  graphPanel = ARM_CONTROLLER.getPanel("graph")
 
-  if graphPanel:
+  graph_panel = ARM_CONTROLLER.get_panel("graph")
+
+  if graph_panel:
     # statistical monitors for graph
-    bwStats = arm.graphing.bandwidthStats.BandwidthStats()
-    graphPanel.addStats(GraphStat.BANDWIDTH, bwStats)
-    graphPanel.addStats(GraphStat.SYSTEM_RESOURCES, arm.graphing.resourceStats.ResourceStats())
+
+    bw_stats = arm.graphing.bandwidthStats.BandwidthStats()
+    graph_panel.add_stats(GraphStat.BANDWIDTH, bw_stats)
+    graph_panel.add_stats(GraphStat.SYSTEM_RESOURCES, arm.graphing.resourceStats.ResourceStats())
 
     if CONFIG["features.panels.show.connection"]:
-      graphPanel.addStats(GraphStat.CONNECTIONS, arm.graphing.connStats.ConnStats())
+      graph_panel.add_stats(GraphStat.CONNECTIONS, arm.graphing.connStats.ConnStats())
 
     # sets graph based on config parameter
+
     try:
-      initialStats = GRAPH_INIT_STATS.get(CONFIG["features.graph.type"])
-      graphPanel.setStats(initialStats)
-    except ValueError: pass # invalid stats, maybe connections when lookups are disabled
+      initial_stats = GRAPH_INIT_STATS.get(CONFIG["features.graph.type"])
+      graph_panel.set_stats(initial_stats)
+    except ValueError:
+      pass  # invalid stats, maybe connections when lookups are disabled
 
     # prepopulates bandwidth values from state file
-    if CONFIG["features.graph.bw.prepopulate"] and torTools.getConn().isAlive():
-      isSuccessful = bwStats.prepopulateFromState()
-      if isSuccessful: graphPanel.updateInterval = 4
+
+    if CONFIG["features.graph.bw.prepopulate"] and torTools.get_conn().is_alive():
+      is_successful = bw_stats.prepopulate_from_state()
+
+      if is_successful:
+        graph_panel.update_interval = 4
+
 
 class LabelPanel(panel.Panel):
   """
@@ -185,10 +208,10 @@ class LabelPanel(panel.Panel):
 
   def __init__(self, stdscr):
     panel.Panel.__init__(self, stdscr, "msg", 0, height=1)
-    self.msgText = ""
-    self.msgAttr = curses.A_NORMAL
+    self.msg_text = ""
+    self.msg_attr = curses.A_NORMAL
 
-  def setMessage(self, msg, attr = None):
+  def set_message(self, msg, attr = None):
     """
     Sets the message being displayed by the panel.
 
@@ -197,112 +220,115 @@ class LabelPanel(panel.Panel):
       attr - attribute for the label, normal text if undefined
     """
 
-    if attr == None: attr = curses.A_NORMAL
-    self.msgText = msg
-    self.msgAttr = attr
+    if attr is None:
+      attr = curses.A_NORMAL
+
+    self.msg_text = msg
+    self.msg_attr = attr
 
   def draw(self, width, height):
-    self.addstr(0, 0, self.msgText, self.msgAttr)
+    self.addstr(0, 0, self.msg_text, self.msg_attr)
+
 
 class Controller:
   """
   Tracks the global state of the interface
   """
 
-  def __init__(self, stdscr, stickyPanels, pagePanels):
+  def __init__(self, stdscr, sticky_panels, page_panels):
     """
     Creates a new controller instance. Panel lists are ordered as they appear,
     top to bottom on the page.
 
     Arguments:
       stdscr       - curses window
-      stickyPanels - panels shown at the top of each page
-      pagePanels   - list of pages, each being a list of the panels on it
+      sticky_panels - panels shown at the top of each page
+      page_panels   - list of pages, each being a list of the panels on it
     """
 
     self._screen = stdscr
-    self._stickyPanels = stickyPanels
-    self._pagePanels = pagePanels
+    self._sticky_panels = sticky_panels
+    self._page_panels = page_panels
     self._page = 0
-    self._isPaused = False
-    self._forceRedraw = False
-    self._isDone = False
-    self._lastDrawn = 0
-    self.setMsg() # initializes our control message
+    self._is_paused = False
+    self._force_redraw = False
+    self._is_done = False
+    self._last_drawn = 0
+    self.set_msg()  # initializes our control message
 
-  def getScreen(self):
+  def get_screen(self):
     """
     Provides our curses window.
     """
 
     return self._screen
 
-  def getPageCount(self):
+  def get_page_count(self):
     """
     Provides the number of pages the interface has. This may be zero if all
     page panels have been disabled.
     """
 
-    return len(self._pagePanels)
+    return len(self._page_panels)
 
-  def getPage(self):
+  def get_page(self):
     """
     Provides the number belonging to this page. Page numbers start at zero.
     """
 
     return self._page
 
-  def setPage(self, pageNumber):
+  def set_page(self, page_number):
     """
     Sets the selected page, raising a ValueError if the page number is invalid.
 
     Arguments:
-      pageNumber - page number to be selected
+      page_number - page number to be selected
     """
 
-    if pageNumber < 0 or pageNumber >= self.getPageCount():
-      raise ValueError("Invalid page number: %i" % pageNumber)
+    if page_number < 0 or page_number >= self.get_page_count():
+      raise ValueError("Invalid page number: %i" % page_number)
 
-    if pageNumber != self._page:
-      self._page = pageNumber
-      self._forceRedraw = True
-      self.setMsg()
+    if page_number != self._page:
+      self._page = page_number
+      self._force_redraw = True
+      self.set_msg()
 
-  def nextPage(self):
+  def next_page(self):
     """
     Increments the page number.
     """
 
-    self.setPage((self._page + 1) % len(self._pagePanels))
+    self.set_page((self._page + 1) % len(self._page_panels))
 
-  def prevPage(self):
+  def prev_page(self):
     """
     Decrements the page number.
     """
 
-    self.setPage((self._page - 1) % len(self._pagePanels))
+    self.set_page((self._page - 1) % len(self._page_panels))
 
-  def isPaused(self):
+  def is_paused(self):
     """
     True if the interface is paused, false otherwise.
     """
 
-    return self._isPaused
+    return self._is_paused
 
-  def setPaused(self, isPause):
+  def set_paused(self, is_pause):
     """
     Sets the interface to be paused or unpaused.
     """
 
-    if isPause != self._isPaused:
-      self._isPaused = isPause
-      self._forceRedraw = True
-      self.setMsg()
+    if is_pause != self._is_paused:
+      self._is_paused = is_pause
+      self._force_redraw = True
+      self.set_msg()
 
-      for panelImpl in self.getAllPanels():
-        panelImpl.setPaused(isPause)
+      for panel_impl in self.get_all_panels():
+        panel_impl.set_paused(is_pause)
 
-  def getPanel(self, name):
+  def get_panel(self, name):
     """
     Provides the panel with the given identifier. This returns None if no such
     panel exists.
@@ -311,61 +337,64 @@ class Controller:
       name - name of the panel to be fetched
     """
 
-    for panelImpl in self.getAllPanels():
-      if panelImpl.getName() == name:
-        return panelImpl
+    for panel_impl in self.get_all_panels():
+      if panel_impl.get_name() == name:
+        return panel_impl
 
     return None
 
-  def getStickyPanels(self):
+  def get_sticky_panels(self):
     """
     Provides the panels visibile at the top of every page.
     """
 
-    return list(self._stickyPanels)
+    return list(self._sticky_panels)
 
-  def getDisplayPanels(self, pageNumber = None, includeSticky = True):
+  def get_display_panels(self, page_number = None, include_sticky = True):
     """
     Provides all panels belonging to a page and sticky content above it. This
     is ordered they way they are presented (top to bottom) on the page.
 
     Arguments:
-      pageNumber    - page number of the panels to be returned, the current
+      page_number    - page number of the panels to be returned, the current
                       page if None
-      includeSticky - includes sticky panels in the results if true
+      include_sticky - includes sticky panels in the results if true
     """
 
-    returnPage = self._page if pageNumber == None else pageNumber
+    return_page = self._page if page_number is None else page_number
 
-    if self._pagePanels:
-      if includeSticky:
-        return self._stickyPanels + self._pagePanels[returnPage]
-      else: return list(self._pagePanels[returnPage])
-    else: return self._stickyPanels if includeSticky else []
+    if self._page_panels:
+      if include_sticky:
+        return self._sticky_panels + self._page_panels[return_page]
+      else:
+        return list(self._page_panels[return_page])
+    else:
+      return self._sticky_panels if include_sticky else []
 
-  def getDaemonPanels(self):
+  def get_daemon_panels(self):
     """
     Provides thread panels.
     """
 
-    threadPanels = []
-    for panelImpl in self.getAllPanels():
-      if isinstance(panelImpl, threading.Thread):
-        threadPanels.append(panelImpl)
+    thread_panels = []
+
+    for panel_impl in self.get_all_panels():
+      if isinstance(panel_impl, threading.Thread):
+        thread_panels.append(panel_impl)
 
-    return threadPanels
+    return thread_panels
 
-  def getAllPanels(self):
+  def get_all_panels(self):
     """
     Provides all panels in the interface.
     """
 
-    allPanels = list(self._stickyPanels)
+    all_panels = list(self._sticky_panels)
 
-    for page in self._pagePanels:
-      allPanels += list(page)
+    for page in self._page_panels:
+      all_panels += list(page)
 
-    return allPanels
+    return all_panels
 
   def redraw(self, force = True):
     """
@@ -376,47 +405,52 @@ class Controller:
               the request when there arne't changes to be displayed
     """
 
-    force |= self._forceRedraw
-    self._forceRedraw = False
+    force |= self._force_redraw
+    self._force_redraw = False
+
+    current_time = time.time()
 
-    currentTime = time.time()
     if CONFIG["features.refreshRate"] != 0:
-      if self._lastDrawn + CONFIG["features.refreshRate"] <= currentTime:
+      if self._last_drawn + CONFIG["features.refreshRate"] <= current_time:
         force = True
 
-    displayPanels = self.getDisplayPanels()
+    display_panels = self.get_display_panels()
 
-    occupiedContent = 0
-    for panelImpl in displayPanels:
-      panelImpl.setTop(occupiedContent)
-      occupiedContent += panelImpl.getHeight()
+    occupied_content = 0
+
+    for panel_impl in display_panels:
+      panel_impl.set_top(occupied_content)
+      occupied_content += panel_impl.get_height()
 
     # apparently curses may cache display contents unless we explicitely
     # request a redraw here...
     # https://trac.torproject.org/projects/tor/ticket/2830#comment:9
-    if force: self._screen.clear()
 
-    for panelImpl in displayPanels:
-      panelImpl.redraw(force)
+    if force:
+      self._screen.clear()
+
+    for panel_impl in display_panels:
+      panel_impl.redraw(force)
 
-    if force: self._lastDrawn = currentTime
+    if force:
+      self._last_drawn = current_time
 
-  def requestRedraw(self):
+  def request_redraw(self):
     """
     Requests that all content is redrawn when the interface is next rendered.
     """
 
-    self._forceRedraw = True
+    self._force_redraw = True
 
-  def getLastRedrawTime(self):
+  def get_last_redraw_time(self):
     """
     Provides the time when the content was last redrawn, zero if the content
     has never been drawn.
     """
 
-    return self._lastDrawn
+    return self._last_drawn
 
-  def setMsg(self, msg = None, attr = None, redraw = False):
+  def set_msg(self, msg = None, attr = None, redraw = False):
     """
     Sets the message displayed in the interfaces control panel. This uses our
     default prompt if no arguments are provided.
@@ -428,40 +462,47 @@ class Controller:
                content is next normally drawn
     """
 
-    if msg == None:
+    if msg is None:
       msg = ""
 
-      if attr == None:
-        if not self._isPaused:
-          msg = "page %i / %i - m: menu, p: pause, h: page help, q: quit" % (self._page + 1, len(self._pagePanels))
+      if attr is None:
+        if not self._is_paused:
+          msg = "page %i / %i - m: menu, p: pause, h: page help, q: quit" % (self._page + 1, len(self._page_panels))
           attr = curses.A_NORMAL
         else:
           msg = "Paused"
           attr = curses.A_STANDOUT
 
-    controlPanel = self.getPanel("msg")
-    controlPanel.setMessage(msg, attr)
+    control_panel = self.get_panel("msg")
+    control_panel.set_message(msg, attr)
 
-    if redraw: controlPanel.redraw(True)
-    else: self._forceRedraw = True
+    if redraw:
+      control_panel.redraw(True)
+    else:
+      self._force_redraw = True
 
-  def getDataDirectory(self):
+  def get_data_directory(self):
     """
     Provides the path where arm's resources are being placed. The path ends
     with a slash and is created if it doesn't already exist.
     """
 
-    dataDir = os.path.expanduser(CONFIG["startup.dataDirectory"])
-    if not dataDir.endswith("/"): dataDir += "/"
-    if not os.path.exists(dataDir): os.makedirs(dataDir)
-    return dataDir
+    data_dir = os.path.expanduser(CONFIG["startup.data_directory"])
+
+    if not data_dir.endswith("/"):
+      data_dir += "/"
+
+    if not os.path.exists(data_dir):
+      os.makedirs(data_dir)
+
+    return data_dir
 
-  def isDone(self):
+  def is_done(self):
     """
     True if arm should be terminated, false otherwise.
     """
 
-    return self._isDone
+    return self._is_done
 
   def quit(self):
     """
@@ -470,46 +511,51 @@ class Controller:
     down too.
     """
 
-    self._isDone = True
+    self._is_done = True
 
     # check if the torrc has a "ARM_SHUTDOWN" comment flag, if so then shut
     # down the instance
 
-    isShutdownFlagPresent = False
-    torrcContents = torConfig.getTorrc().getContents()
+    is_shutdown_flag_present = False
+    torrc_contents = torConfig.get_torrc().get_contents()
 
-    if torrcContents:
-      for line in torrcContents:
+    if torrc_contents:
+      for line in torrc_contents:
         if "# ARM_SHUTDOWN" in line:
-          isShutdownFlagPresent = True
+          is_shutdown_flag_present = True
           break
 
-    if isShutdownFlagPresent:
-      try: torTools.getConn().shutdown()
-      except IOError, exc: arm.popups.showMsg(str(exc), 3, curses.A_BOLD)
+    if is_shutdown_flag_present:
+      try:
+        torTools.get_conn().shutdown()
+      except IOError as exc:
+        arm.popups.show_msg(str(exc), 3, curses.A_BOLD)
 
-def heartbeatCheck(isUnresponsive):
+
+def heartbeat_check(is_unresponsive):
   """
   Logs if its been ten seconds since the last BW event.
 
   Arguments:
-    isUnresponsive - flag for if we've indicated to be responsive or not
+    is_unresponsive - flag for if we've indicated to be responsive or not
   """
 
-  conn = torTools.getConn()
-  lastHeartbeat = conn.controller.get_latest_heartbeat()
-  if conn.isAlive():
-    if not isUnresponsive and (time.time() - lastHeartbeat) >= 10:
-      isUnresponsive = True
-      log.notice("Relay unresponsive (last heartbeat: %s)" % time.ctime(lastHeartbeat))
-    elif isUnresponsive and (time.time() - lastHeartbeat) < 10:
+  conn = torTools.get_conn()
+  last_heartbeat = conn.controller.get_latest_heartbeat()
+
+  if conn.is_alive():
+    if not is_unresponsive and (time.time() - last_heartbeat) >= 10:
+      is_unresponsive = True
+      log.notice("Relay unresponsive (last heartbeat: %s)" % time.ctime(last_heartbeat))
+    elif is_unresponsive and (time.time() - last_heartbeat) < 10:
       # really shouldn't happen (meant Tor froze for a bit)
-      isUnresponsive = False
+      is_unresponsive = False
       log.notice("Relay resumed")
 
-  return isUnresponsive
+  return is_unresponsive
+
 
-def connResetListener(controller, eventType, _):
+def conn_reset_listener(controller, event_type, _):
   """
   Pauses connection resolution when tor's shut down, and resumes with the new
   pid if started again.
@@ -518,15 +564,16 @@ def connResetListener(controller, eventType, _):
   resolver = arm.util.tracker.get_connection_tracker()
 
   if resolver.is_alive():
-    resolver.set_paused(eventType == State.CLOSED)
+    resolver.set_paused(event_type == State.CLOSED)
 
-    if eventType in (State.INIT, State.RESET):
+    if event_type in (State.INIT, State.RESET):
       # Reload the torrc contents. If the torrc panel is present then it will
       # do this instead since it wants to do validation and redraw _after_ the
       # new contents are loaded.
 
-      if getController().getPanel("torrc") == None:
-        torConfig.getTorrc().load(True)
+      if get_controller().get_panel("torrc") is None:
+        torConfig.get_torrc().load(True)
+
 
 def start_arm(stdscr):
   """
@@ -536,84 +583,104 @@ def start_arm(stdscr):
     stdscr    - curses window
   """
 
-  startTime = CONFIG['start_time']
-  initController(stdscr, startTime)
-  control = getController()
+  start_time = CONFIG['start_time']
+  init_controller(stdscr, start_time)
+  control = get_controller()
 
   # provides notice about any unused config keys
+
   for key in conf.get_config("arm").unused_keys():
     log.notice("Unused configuration entry: %s" % key)
 
   # tells daemon panels to start
-  for panelImpl in control.getDaemonPanels(): panelImpl.start()
+
+  for panel_impl in control.get_daemon_panels():
+    panel_impl.start()
 
   # allows for background transparency
-  try: curses.use_default_colors()
-  except curses.error: pass
+
+  try:
+    curses.use_default_colors()
+  except curses.error:
+    pass
 
   # makes the cursor invisible
-  try: curses.curs_set(0)
-  except curses.error: pass
+
+  try:
+    curses.curs_set(0)
+  except curses.error:
+    pass
 
   # logs the initialization time
-  log.info("arm started (initialization took %0.3f seconds)" % (time.time() - startTime))
+
+  log.info("arm started (initialization took %0.3f seconds)" % (time.time() - start_time))
 
   # main draw loop
-  overrideKey = None     # uses this rather than waiting on user input
-  isUnresponsive = False # flag for heartbeat responsiveness check
 
-  while not control.isDone():
-    displayPanels = control.getDisplayPanels()
-    isUnresponsive = heartbeatCheck(isUnresponsive)
+  override_key = None      # uses this rather than waiting on user input
+  is_unresponsive = False  # flag for heartbeat responsiveness check
+
+  while not control.is_done():
+    display_panels = control.get_display_panels()
+    is_unresponsive = heartbeat_check(is_unresponsive)
 
     # sets panel visability
-    for panelImpl in control.getAllPanels():
-      panelImpl.setVisible(panelImpl in displayPanels)
+
+    for panel_impl in control.get_all_panels():
+      panel_impl.set_visible(panel_impl in display_panels)
 
     # redraws the interface if it's needed
+
     control.redraw(False)
     stdscr.refresh()
 
     # wait for user keyboard input until timeout, unless an override was set
-    if overrideKey:
-      key, overrideKey = overrideKey, None
+
+    if override_key:
+      key, override_key = override_key, None
     else:
       curses.halfdelay(CONFIG["features.redrawRate"] * 10)
       key = stdscr.getch()
 
     if key == curses.KEY_RIGHT:
-      control.nextPage()
+      control.next_page()
     elif key == curses.KEY_LEFT:
-      control.prevPage()
+      control.prev_page()
     elif key == ord('p') or key == ord('P'):
-      control.setPaused(not control.isPaused())
+      control.set_paused(not control.is_paused())
     elif key == ord('m') or key == ord('M'):
-      arm.menu.menu.showMenu()
+      arm.menu.menu.show_menu()
     elif key == ord('q') or key == ord('Q'):
       # provides prompt to confirm that arm should exit
+
       if CONFIG["features.confirmQuit"]:
         msg = "Are you sure (q again to confirm)?"
-        confirmationKey = arm.popups.showMsg(msg, attr = curses.A_BOLD)
-        quitConfirmed = confirmationKey in (ord('q'), ord('Q'))
-      else: quitConfirmed = True
+        confirmation_key = arm.popups.show_msg(msg, attr = curses.A_BOLD)
+        quit_confirmed = confirmation_key in (ord('q'), ord('Q'))
+      else:
+        quit_confirmed = True
 
-      if quitConfirmed: control.quit()
+      if quit_confirmed:
+        control.quit()
     elif key == ord('x') or key == ord('X'):
       # provides prompt to confirm that arm should issue a sighup
+
       msg = "This will reset Tor's internal state. Are you sure (x again to confirm)?"
-      confirmationKey = arm.popups.showMsg(msg, attr = curses.A_BOLD)
+      confirmation_key = arm.popups.show_msg(msg, attr = curses.A_BOLD)
 
-      if confirmationKey in (ord('x'), ord('X')):
-        try: torTools.getConn().reload()
-        except IOError, exc:
+      if confirmation_key in (ord('x'), ord('X')):
+        try:
+          torTools.get_conn().reload()
+        except IOError as exc:
           log.error("Error detected when reloading tor: %s" % exc.strerror)
     elif key == ord('h') or key == ord('H'):
-      overrideKey = arm.popups.showHelpPopup()
+      override_key = arm.popups.show_help_popup()
     elif key == ord('l') - 96:
       # force redraw when ctrl+l is pressed
       control.redraw(True)
     else:
-      for panelImpl in displayPanels:
-        isKeystrokeConsumed = panelImpl.handleKey(key)
-        if isKeystrokeConsumed: break
+      for panel_impl in display_panels:
+        is_keystroke_consumed = panel_impl.handle_key(key)
 
+        if is_keystroke_consumed:
+          break
diff --git a/arm/graphing/__init__.py b/arm/graphing/__init__.py
index 2dddaa3..d93512d 100644
--- a/arm/graphing/__init__.py
+++ b/arm/graphing/__init__.py
@@ -2,5 +2,4 @@
 Graphing panel resources.
 """
 
-__all__ = ["graphPanel", "bandwidthStats", "connStats", "resourceStats"]
-
+__all__ = ["graph_panel", "bandwidthStats", "connStats", "resourceStats"]
diff --git a/arm/graphing/bandwidthStats.py b/arm/graphing/bandwidthStats.py
index 2bf417e..e42a902 100644
--- a/arm/graphing/bandwidthStats.py
+++ b/arm/graphing/bandwidthStats.py
@@ -14,10 +14,12 @@ from arm.util import torTools, uiTools
 from stem.control import State
 from stem.util import conf, log, str_tools, system
 
+
 def conf_handler(key, value):
   if key == "features.graph.bw.accounting.rate":
     return max(1, value)
 
+
 CONFIG = conf.config_dict("arm", {
   "features.graph.bw.transferInBytes": False,
   "features.graph.bw.accounting.show": True,
@@ -30,37 +32,46 @@ DL_COLOR, UL_COLOR = "green", "cyan"
 
 # width at which panel abandons placing optional stats (avg and total) with
 # header in favor of replacing the x-axis label
+
 COLLAPSE_WIDTH = 135
 
-# valid keys for the accountingInfo mapping
-ACCOUNTING_ARGS = ("status", "resetTime", "read", "written", "readLimit", "writtenLimit")
+# valid keys for the accounting_info mapping
+
+ACCOUNTING_ARGS = ("status", "reset_time", "read", "written", "read_limit", "writtenLimit")
 
 PREPOPULATE_SUCCESS_MSG = "Read the last day of bandwidth history from the state file"
 PREPOPULATE_FAILURE_MSG = "Unable to prepopulate bandwidth information (%s)"
 
+
 class BandwidthStats(graphPanel.GraphStats):
   """
   Uses tor BW events to generate bandwidth usage graph.
   """
 
-  def __init__(self, isPauseBuffer=False):
+  def __init__(self, is_pause_buffer = False):
     graphPanel.GraphStats.__init__(self)
 
     # stats prepopulated from tor's state file
-    self.prepopulatePrimaryTotal = 0
-    self.prepopulateSecondaryTotal = 0
-    self.prepopulateTicks = 0
 
-    # accounting data (set by _updateAccountingInfo method)
-    self.accountingLastUpdated = 0
-    self.accountingInfo = dict([(arg, "") for arg in ACCOUNTING_ARGS])
+    self.prepopulate_primary_total = 0
+    self.prepopulate_secondary_total = 0
+    self.prepopulate_ticks = 0
+
+    # accounting data (set by _update_accounting_info method)
+
+    self.accounting_last_updated = 0
+    self.accounting_info = dict([(arg, "") for arg in ACCOUNTING_ARGS])
 
     # listens for tor reload (sighup) events which can reset the bandwidth
     # rate/burst and if tor's using accounting
-    conn = torTools.getConn()
-    self._titleStats, self.isAccounting = [], False
-    if not isPauseBuffer: self.resetListener(conn.getController(), State.INIT, None) # initializes values
-    conn.addStatusListener(self.resetListener)
+
+    conn = torTools.get_conn()
+    self._title_stats, self.is_accounting = [], False
+
+    if not is_pause_buffer:
+      self.reset_listener(conn.get_controller(), State.INIT, None)  # initializes values
+
+    conn.add_status_listener(self.reset_listener)
 
     # Initialized the bandwidth totals to the values reported by Tor. This
     # uses a controller options introduced in ticket 2345:
@@ -69,47 +80,56 @@ class BandwidthStats(graphPanel.GraphStats):
     # further updates are still handled via BW events to avoid unnecessary
     # GETINFO requests.
 
-    self.initialPrimaryTotal = 0
-    self.initialSecondaryTotal = 0
+    self.initial_primary_total = 0
+    self.initial_secondary_total = 0
+
+    read_total = conn.get_info("traffic/read", None)
+
+    if read_total and read_total.isdigit():
+      self.initial_primary_total = int(read_total) / 1024  # Bytes -> KB
 
-    readTotal = conn.getInfo("traffic/read", None)
-    if readTotal and readTotal.isdigit():
-      self.initialPrimaryTotal = int(readTotal) / 1024 # Bytes -> KB
+    write_total = conn.get_info("traffic/written", None)
 
-    writeTotal = conn.getInfo("traffic/written", None)
-    if writeTotal and writeTotal.isdigit():
-      self.initialSecondaryTotal = int(writeTotal) / 1024 # Bytes -> KB
+    if write_total and write_total.isdigit():
+      self.initial_secondary_total = int(write_total) / 1024  # Bytes -> KB
 
-  def clone(self, newCopy=None):
-    if not newCopy: newCopy = BandwidthStats(True)
-    newCopy.accountingLastUpdated = self.accountingLastUpdated
-    newCopy.accountingInfo = self.accountingInfo
+  def clone(self, new_copy = None):
+    if not new_copy:
+      new_copy = BandwidthStats(True)
 
-    # attributes that would have been initialized from calling the resetListener
-    newCopy.isAccounting = self.isAccounting
-    newCopy._titleStats = self._titleStats
+    new_copy.accounting_last_updated = self.accounting_last_updated
+    new_copy.accounting_info = self.accounting_info
 
-    return graphPanel.GraphStats.clone(self, newCopy)
+    # attributes that would have been initialized from calling the reset_listener
 
-  def resetListener(self, controller, eventType, _):
+    new_copy.is_accounting = self.is_accounting
+    new_copy._title_stats = self._title_stats
+
+    return graphPanel.GraphStats.clone(self, new_copy)
+
+  def reset_listener(self, controller, event_type, _):
     # updates title parameters and accounting status if they changed
-    self._titleStats = []     # force reset of title
-    self.new_desc_event(None) # updates title params
 
-    if eventType in (State.INIT, State.RESET) and CONFIG["features.graph.bw.accounting.show"]:
-      isAccountingEnabled = controller.get_info('accounting/enabled', None) == '1'
+    self._title_stats = []     # force reset of title
+    self.new_desc_event(None)  # updates title params
 
-      if isAccountingEnabled != self.isAccounting:
-        self.isAccounting = isAccountingEnabled
+    if event_type in (State.INIT, State.RESET) and CONFIG["features.graph.bw.accounting.show"]:
+      is_accounting_enabled = controller.get_info('accounting/enabled', None) == '1'
+
+      if is_accounting_enabled != self.is_accounting:
+        self.is_accounting = is_accounting_enabled
 
         # redraws the whole screen since our height changed
-        arm.controller.getController().redraw()
+
+        arm.controller.get_controller().redraw()
 
     # redraws to reflect changes (this especially noticeable when we have
     # accounting and shut down since it then gives notice of the shutdown)
-    if self._graphPanel and self.isSelected: self._graphPanel.redraw(True)
 
-  def prepopulateFromState(self):
+    if self._graph_panel and self.is_selected:
+      self._graph_panel.redraw(True)
+
+  def prepopulate_from_state(self):
     """
     Attempts to use tor's state file to prepopulate values for the 15 minute
     interval via the BWHistoryReadValues/BWHistoryWriteValues values. This
@@ -117,43 +137,54 @@ class BandwidthStats(graphPanel.GraphStats):
     """
 
     # checks that this is a relay (if ORPort is unset, then skip)
-    conn = torTools.getConn()
-    orPort = conn.getOption("ORPort", None)
-    if orPort == "0": return
+
+    conn = torTools.get_conn()
+    or_port = conn.get_option("ORPort", None)
+
+    if or_port == "0":
+      return
 
     # gets the uptime (using the same parameters as the header panel to take
     # advantage of caching)
     # TODO: stem dropped system caching support so we'll need to think of
     # something else
+
     uptime = None
-    queryPid = conn.controller.get_pid(None)
-    if queryPid:
-      queryParam = ["%cpu", "rss", "%mem", "etime"]
-      queryCmd = "ps -p %s -o %s" % (queryPid, ",".join(queryParam))
-      psCall = system.call(queryCmd, None)
+    query_pid = conn.controller.get_pid(None)
 
-      if psCall and len(psCall) == 2:
-        stats = psCall[1].strip().split()
-        if len(stats) == 4: uptime = stats[3]
+    if query_pid:
+      query_param = ["%cpu", "rss", "%mem", "etime"]
+      query_cmd = "ps -p %s -o %s" % (query_pid, ",".join(query_param))
+      ps_call = system.call(query_cmd, None)
+
+      if ps_call and len(ps_call) == 2:
+        stats = ps_call[1].strip().split()
+
+        if len(stats) == 4:
+          uptime = stats[3]
 
     # checks if tor has been running for at least a day, the reason being that
     # the state tracks a day's worth of data and this should only prepopulate
     # results associated with this tor instance
+
     if not uptime or not "-" in uptime:
       msg = PREPOPULATE_FAILURE_MSG % "insufficient uptime"
       log.notice(msg)
       return False
 
     # get the user's data directory (usually '~/.tor')
-    dataDir = conn.getOption("DataDirectory", None)
-    if not dataDir:
+
+    data_dir = conn.get_option("DataDirectory", None)
+
+    if not data_dir:
       msg = PREPOPULATE_FAILURE_MSG % "data directory not found"
       log.notice(msg)
       return False
 
     # attempt to open the state file
+
     try:
-      stateFile = open("%s%s/state" % (CONFIG['tor.chroot'], dataDir), "r")
+      state_file = open("%s%s/state" % (CONFIG['tor.chroot'], data_dir), "r")
     except IOError:
       msg = PREPOPULATE_FAILURE_MSG % "unable to read the state file"
       log.notice(msg)
@@ -161,13 +192,15 @@ class BandwidthStats(graphPanel.GraphStats):
 
     # get the BWHistory entries (ordered oldest to newest) and number of
     # intervals since last recorded
-    bwReadEntries, bwWriteEntries = None, None
-    missingReadEntries, missingWriteEntries = None, None
+
+    bw_read_entries, bw_write_entries = None, None
+    missing_read_entries, missing_write_entries = None, None
 
     # converts from gmt to local with respect to DST
+
     tz_offset = time.altzone if time.localtime()[8] else time.timezone
 
-    for line in stateFile:
+    for line in state_file:
       line = line.strip()
 
       # According to the rep_hist_update_state() function the BWHistory*Ends
@@ -177,233 +210,276 @@ class BandwidthStats(graphPanel.GraphStats):
       # account for both.
 
       if line.startswith("BWHistoryReadValues"):
-        bwReadEntries = line[20:].split(",")
-        bwReadEntries = [int(entry) / 1024.0 / 900 for entry in bwReadEntries]
-        bwReadEntries.pop()
+        bw_read_entries = line[20:].split(",")
+        bw_read_entries = [int(entry) / 1024.0 / 900 for entry in bw_read_entries]
+        bw_read_entries.pop()
       elif line.startswith("BWHistoryWriteValues"):
-        bwWriteEntries = line[21:].split(",")
-        bwWriteEntries = [int(entry) / 1024.0 / 900 for entry in bwWriteEntries]
-        bwWriteEntries.pop()
+        bw_write_entries = line[21:].split(",")
+        bw_write_entries = [int(entry) / 1024.0 / 900 for entry in bw_write_entries]
+        bw_write_entries.pop()
       elif line.startswith("BWHistoryReadEnds"):
-        lastReadTime = time.mktime(time.strptime(line[18:], "%Y-%m-%d %H:%M:%S")) - tz_offset
-        lastReadTime -= 900
-        missingReadEntries = int((time.time() - lastReadTime) / 900)
+        last_read_time = time.mktime(time.strptime(line[18:], "%Y-%m-%d %H:%M:%S")) - tz_offset
+        last_read_time -= 900
+        missing_read_entries = int((time.time() - last_read_time) / 900)
       elif line.startswith("BWHistoryWriteEnds"):
-        lastWriteTime = time.mktime(time.strptime(line[19:], "%Y-%m-%d %H:%M:%S")) - tz_offset
-        lastWriteTime -= 900
-        missingWriteEntries = int((time.time() - lastWriteTime) / 900)
+        last_write_time = time.mktime(time.strptime(line[19:], "%Y-%m-%d %H:%M:%S")) - tz_offset
+        last_write_time -= 900
+        missing_write_entries = int((time.time() - last_write_time) / 900)
 
-    if not bwReadEntries or not bwWriteEntries or not lastReadTime or not lastWriteTime:
+    if not bw_read_entries or not bw_write_entries or not last_read_time or not last_write_time:
       msg = PREPOPULATE_FAILURE_MSG % "bandwidth stats missing from state file"
       log.notice(msg)
       return False
 
     # fills missing entries with the last value
-    bwReadEntries += [bwReadEntries[-1]] * missingReadEntries
-    bwWriteEntries += [bwWriteEntries[-1]] * missingWriteEntries
+
+    bw_read_entries += [bw_read_entries[-1]] * missing_read_entries
+    bw_write_entries += [bw_write_entries[-1]] * missing_write_entries
 
     # crops starting entries so they're the same size
-    entryCount = min(len(bwReadEntries), len(bwWriteEntries), self.maxCol)
-    bwReadEntries = bwReadEntries[len(bwReadEntries) - entryCount:]
-    bwWriteEntries = bwWriteEntries[len(bwWriteEntries) - entryCount:]
+
+    entry_count = min(len(bw_read_entries), len(bw_write_entries), self.max_column)
+    bw_read_entries = bw_read_entries[len(bw_read_entries) - entry_count:]
+    bw_write_entries = bw_write_entries[len(bw_write_entries) - entry_count:]
 
     # gets index for 15-minute interval
-    intervalIndex = 0
-    for indexEntry in graphPanel.UPDATE_INTERVALS:
-      if indexEntry[1] == 900: break
-      else: intervalIndex += 1
+
+    interval_index = 0
+
+    for index_entry in graphPanel.UPDATE_INTERVALS:
+      if index_entry[1] == 900:
+        break
+      else:
+        interval_index += 1
 
     # fills the graphing parameters with state information
-    for i in range(entryCount):
-      readVal, writeVal = bwReadEntries[i], bwWriteEntries[i]
 
-      self.lastPrimary, self.lastSecondary = readVal, writeVal
+    for i in range(entry_count):
+      read_value, write_value = bw_read_entries[i], bw_write_entries[i]
+
+      self.last_primary, self.last_secondary = read_value, write_value
+
+      self.prepopulate_primary_total += read_value * 900
+      self.prepopulate_secondary_total += write_value * 900
+      self.prepopulate_ticks += 900
 
-      self.prepopulatePrimaryTotal += readVal * 900
-      self.prepopulateSecondaryTotal += writeVal * 900
-      self.prepopulateTicks += 900
+      self.primary_counts[interval_index].insert(0, read_value)
+      self.secondary_counts[interval_index].insert(0, write_value)
 
-      self.primaryCounts[intervalIndex].insert(0, readVal)
-      self.secondaryCounts[intervalIndex].insert(0, writeVal)
+    self.max_primary[interval_index] = max(self.primary_counts)
+    self.max_secondary[interval_index] = max(self.secondary_counts)
 
-    self.maxPrimary[intervalIndex] = max(self.primaryCounts)
-    self.maxSecondary[intervalIndex] = max(self.secondaryCounts)
-    del self.primaryCounts[intervalIndex][self.maxCol + 1:]
-    del self.secondaryCounts[intervalIndex][self.maxCol + 1:]
+    del self.primary_counts[interval_index][self.max_column + 1:]
+    del self.secondary_counts[interval_index][self.max_column + 1:]
 
     msg = PREPOPULATE_SUCCESS_MSG
-    missingSec = time.time() - min(lastReadTime, lastWriteTime)
-    if missingSec: msg += " (%s is missing)" % str_tools.get_time_label(missingSec, 0, True)
+    missing_sec = time.time() - min(last_read_time, last_write_time)
+
+    if missing_sec:
+      msg += " (%s is missing)" % str_tools.get_time_label(missing_sec, 0, True)
+
     log.notice(msg)
 
     return True
 
   def bandwidth_event(self, event):
-    if self.isAccounting and self.isNextTickRedraw():
-      if time.time() - self.accountingLastUpdated >= CONFIG["features.graph.bw.accounting.rate"]:
-        self._updateAccountingInfo()
+    if self.is_accounting and self.is_next_tick_redraw():
+      if time.time() - self.accounting_last_updated >= CONFIG["features.graph.bw.accounting.rate"]:
+        self._update_accounting_info()
 
     # scales units from B to KB for graphing
-    self._processEvent(event.read / 1024.0, event.written / 1024.0)
+
+    self._process_event(event.read / 1024.0, event.written / 1024.0)
 
   def draw(self, panel, width, height):
     # line of the graph's x-axis labeling
-    labelingLine = graphPanel.GraphStats.getContentHeight(self) + panel.graphHeight - 2
+
+    labeling_line = graphPanel.GraphStats.get_content_height(self) + panel.graph_height - 2
 
     # if display is narrow, overwrites x-axis labels with avg / total stats
+
     if width <= COLLAPSE_WIDTH:
       # clears line
-      panel.addstr(labelingLine, 0, " " * width)
-      graphCol = min((width - 10) / 2, self.maxCol)
 
-      primaryFooter = "%s, %s" % (self._getAvgLabel(True), self._getTotalLabel(True))
-      secondaryFooter = "%s, %s" % (self._getAvgLabel(False), self._getTotalLabel(False))
+      panel.addstr(labeling_line, 0, " " * width)
+      graph_column = min((width - 10) / 2, self.max_column)
+
+      primary_footer = "%s, %s" % (self._get_avg_label(True), self._get_total_label(True))
+      secondary_footer = "%s, %s" % (self._get_avg_label(False), self._get_total_label(False))
 
-      panel.addstr(labelingLine, 1, primaryFooter, uiTools.getColor(self.getColor(True)))
-      panel.addstr(labelingLine, graphCol + 6, secondaryFooter, uiTools.getColor(self.getColor(False)))
+      panel.addstr(labeling_line, 1, primary_footer, uiTools.get_color(self.get_color(True)))
+      panel.addstr(labeling_line, graph_column + 6, secondary_footer, uiTools.get_color(self.get_color(False)))
 
     # provides accounting stats if enabled
-    if self.isAccounting:
-      if torTools.getConn().isAlive():
-        status = self.accountingInfo["status"]
 
-        hibernateColor = "green"
-        if status == "soft": hibernateColor = "yellow"
-        elif status == "hard": hibernateColor = "red"
+    if self.is_accounting:
+      if torTools.get_conn().is_alive():
+        status = self.accounting_info["status"]
+
+        hibernate_color = "green"
+
+        if status == "soft":
+          hibernate_color = "yellow"
+        elif status == "hard":
+          hibernate_color = "red"
         elif status == "":
           # failed to be queried
-          status, hibernateColor = "unknown", "red"
+          status, hibernate_color = "unknown", "red"
 
-        panel.addstr(labelingLine + 2, 0, "Accounting (", curses.A_BOLD)
-        panel.addstr(labelingLine + 2, 12, status, curses.A_BOLD | uiTools.getColor(hibernateColor))
-        panel.addstr(labelingLine + 2, 12 + len(status), ")", curses.A_BOLD)
+        panel.addstr(labeling_line + 2, 0, "Accounting (", curses.A_BOLD)
+        panel.addstr(labeling_line + 2, 12, status, curses.A_BOLD | uiTools.get_color(hibernate_color))
+        panel.addstr(labeling_line + 2, 12 + len(status), ")", curses.A_BOLD)
 
-        resetTime = self.accountingInfo["resetTime"]
-        if not resetTime: resetTime = "unknown"
-        panel.addstr(labelingLine + 2, 35, "Time to reset: %s" % resetTime)
+        reset_time = self.accounting_info["reset_time"]
+
+        if not reset_time:
+          reset_time = "unknown"
+
+        panel.addstr(labeling_line + 2, 35, "Time to reset: %s" % reset_time)
+
+        used, total = self.accounting_info["read"], self.accounting_info["read_limit"]
 
-        used, total = self.accountingInfo["read"], self.accountingInfo["readLimit"]
         if used and total:
-          panel.addstr(labelingLine + 3, 2, "%s / %s" % (used, total), uiTools.getColor(self.getColor(True)))
+          panel.addstr(labeling_line + 3, 2, "%s / %s" % (used, total), uiTools.get_color(self.get_color(True)))
+
+        used, total = self.accounting_info["written"], self.accounting_info["writtenLimit"]
 
-        used, total = self.accountingInfo["written"], self.accountingInfo["writtenLimit"]
         if used and total:
-          panel.addstr(labelingLine + 3, 37, "%s / %s" % (used, total), uiTools.getColor(self.getColor(False)))
+          panel.addstr(labeling_line + 3, 37, "%s / %s" % (used, total), uiTools.get_color(self.get_color(False)))
       else:
-        panel.addstr(labelingLine + 2, 0, "Accounting:", curses.A_BOLD)
-        panel.addstr(labelingLine + 2, 12, "Connection Closed...")
+        panel.addstr(labeling_line + 2, 0, "Accounting:", curses.A_BOLD)
+        panel.addstr(labeling_line + 2, 12, "Connection Closed...")
 
-  def getTitle(self, width):
-    stats = list(self._titleStats)
+  def get_title(self, width):
+    stats = list(self._title_stats)
 
     while True:
-      if not stats: return "Bandwidth:"
+      if not stats:
+        return "Bandwidth:"
       else:
         label = "Bandwidth (%s):" % ", ".join(stats)
 
-        if len(label) > width: del stats[-1]
-        else: return label
+        if len(label) > width:
+          del stats[-1]
+        else:
+          return label
 
-  def getHeaderLabel(self, width, isPrimary):
-    graphType = "Download" if isPrimary else "Upload"
+  def get_header_label(self, width, is_primary):
+    graph_type = "Download" if is_primary else "Upload"
     stats = [""]
 
     # if wide then avg and total are part of the header, otherwise they're on
     # the x-axis
+
     if width * 2 > COLLAPSE_WIDTH:
       stats = [""] * 3
-      stats[1] = "- %s" % self._getAvgLabel(isPrimary)
-      stats[2] = ", %s" % self._getTotalLabel(isPrimary)
+      stats[1] = "- %s" % self._get_avg_label(is_primary)
+      stats[2] = ", %s" % self._get_total_label(is_primary)
 
-    stats[0] = "%-14s" % ("%s/sec" % str_tools.get_size_label((self.lastPrimary if isPrimary else self.lastSecondary) * 1024, 1, False, CONFIG["features.graph.bw.transferInBytes"]))
+    stats[0] = "%-14s" % ("%s/sec" % str_tools.get_size_label((self.last_primary if is_primary else self.last_secondary) * 1024, 1, False, CONFIG["features.graph.bw.transferInBytes"]))
 
     # drops label's components if there's not enough space
-    labeling = graphType + " (" + "".join(stats).strip() + "):"
+
+    labeling = graph_type + " (" + "".join(stats).strip() + "):"
+
     while len(labeling) >= width:
       if len(stats) > 1:
         del stats[-1]
-        labeling = graphType + " (" + "".join(stats).strip() + "):"
+        labeling = graph_type + " (" + "".join(stats).strip() + "):"
       else:
-        labeling = graphType + ":"
+        labeling = graph_type + ":"
         break
 
     return labeling
 
-  def getColor(self, isPrimary):
-    return DL_COLOR if isPrimary else UL_COLOR
+  def get_color(self, is_primary):
+    return DL_COLOR if is_primary else UL_COLOR
 
-  def getContentHeight(self):
-    baseHeight = graphPanel.GraphStats.getContentHeight(self)
-    return baseHeight + 3 if self.isAccounting else baseHeight
+  def get_content_height(self):
+    base_height = graphPanel.GraphStats.get_content_height(self)
+    return base_height + 3 if self.is_accounting else base_height
 
   def new_desc_event(self, event):
-    # updates self._titleStats with updated values
-    conn = torTools.getConn()
-    if not conn.isAlive(): return # keep old values
+    # updates self._title_stats with updated values
+
+    conn = torTools.get_conn()
 
-    myFingerprint = conn.getInfo("fingerprint", None)
-    if not self._titleStats or not myFingerprint or (event and myFingerprint in event.idlist):
+    if not conn.is_alive():
+      return  # keep old values
+
+    my_fingerprint = conn.get_info("fingerprint", None)
+
+    if not self._title_stats or not my_fingerprint or (event and my_fingerprint in event.idlist):
       stats = []
-      bwRate = conn.getMyBandwidthRate()
-      bwBurst = conn.getMyBandwidthBurst()
-      bwObserved = conn.getMyBandwidthObserved()
-      bwMeasured = conn.getMyBandwidthMeasured()
-      labelInBytes = CONFIG["features.graph.bw.transferInBytes"]
+      bw_rate = conn.get_my_bandwidth_rate()
+      bw_burst = conn.get_my_bandwidth_burst()
+      bw_observed = conn.get_my_bandwidth_observed()
+      bw_measured = conn.get_my_bandwidth_measured()
+      label_in_bytes = CONFIG["features.graph.bw.transferInBytes"]
 
-      if bwRate and bwBurst:
-        bwRateLabel = str_tools.get_size_label(bwRate, 1, False, labelInBytes)
-        bwBurstLabel = str_tools.get_size_label(bwBurst, 1, False, labelInBytes)
+      if bw_rate and bw_burst:
+        bw_rate_label = str_tools.get_size_label(bw_rate, 1, False, label_in_bytes)
+        bw_burst_label = str_tools.get_size_label(bw_burst, 1, False, label_in_bytes)
 
         # if both are using rounded values then strip off the ".0" decimal
-        if ".0" in bwRateLabel and ".0" in bwBurstLabel:
-          bwRateLabel = bwRateLabel.replace(".0", "")
-          bwBurstLabel = bwBurstLabel.replace(".0", "")
 
-        stats.append("limit: %s/s" % bwRateLabel)
-        stats.append("burst: %s/s" % bwBurstLabel)
+        if ".0" in bw_rate_label and ".0" in bw_burst_label:
+          bw_rate_label = bw_rate_label.replace(".0", "")
+          bw_burst_label = bw_burst_label.replace(".0", "")
+
+        stats.append("limit: %s/s" % bw_rate_label)
+        stats.append("burst: %s/s" % bw_burst_label)
 
       # Provide the observed bandwidth either if the measured bandwidth isn't
       # available or if the measured bandwidth is the observed (this happens
       # if there isn't yet enough bandwidth measurements).
-      if bwObserved and (not bwMeasured or bwMeasured == bwObserved):
-        stats.append("observed: %s/s" % str_tools.get_size_label(bwObserved, 1, False, labelInBytes))
-      elif bwMeasured:
-        stats.append("measured: %s/s" % str_tools.get_size_label(bwMeasured, 1, False, labelInBytes))
 
-      self._titleStats = stats
+      if bw_observed and (not bw_measured or bw_measured == bw_observed):
+        stats.append("observed: %s/s" % str_tools.get_size_label(bw_observed, 1, False, label_in_bytes))
+      elif bw_measured:
+        stats.append("measured: %s/s" % str_tools.get_size_label(bw_measured, 1, False, label_in_bytes))
+
+      self._title_stats = stats
 
-  def _getAvgLabel(self, isPrimary):
-    total = self.primaryTotal if isPrimary else self.secondaryTotal
-    total += self.prepopulatePrimaryTotal if isPrimary else self.prepopulateSecondaryTotal
-    return "avg: %s/sec" % str_tools.get_size_label((total / max(1, self.tick + self.prepopulateTicks)) * 1024, 1, False, CONFIG["features.graph.bw.transferInBytes"])
+  def _get_avg_label(self, is_primary):
+    total = self.primary_total if is_primary else self.secondary_total
+    total += self.prepopulate_primary_total if is_primary else self.prepopulate_secondary_total
 
-  def _getTotalLabel(self, isPrimary):
-    total = self.primaryTotal if isPrimary else self.secondaryTotal
-    total += self.initialPrimaryTotal if isPrimary else self.initialSecondaryTotal
+    return "avg: %s/sec" % str_tools.get_size_label((total / max(1, self.tick + self.prepopulate_ticks)) * 1024, 1, False, CONFIG["features.graph.bw.transferInBytes"])
+
+  def _get_total_label(self, is_primary):
+    total = self.primary_total if is_primary else self.secondary_total
+    total += self.initial_primary_total if is_primary else self.initial_secondary_total
     return "total: %s" % str_tools.get_size_label(total * 1024, 1)
 
-  def _updateAccountingInfo(self):
+  def _update_accounting_info(self):
     """
     Updates mapping used for accounting info. This includes the following keys:
-    status, resetTime, read, written, readLimit, writtenLimit
+    status, reset_time, read, written, read_limit, writtenLimit
 
     Any failed lookups result in a mapping to an empty string.
     """
 
-    conn = torTools.getConn()
+    conn = torTools.get_conn()
     queried = dict([(arg, "") for arg in ACCOUNTING_ARGS])
-    queried["status"] = conn.getInfo("accounting/hibernating", None)
+    queried["status"] = conn.get_info("accounting/hibernating", None)
 
     # provides a nicely formatted reset time
-    endInterval = conn.getInfo("accounting/interval-end", None)
-    if endInterval:
+
+    end_interval = conn.get_info("accounting/interval-end", None)
+
+    if end_interval:
       # converts from gmt to local with respect to DST
-      if time.localtime()[8]: tz_offset = time.altzone
-      else: tz_offset = time.timezone
 
-      sec = time.mktime(time.strptime(endInterval, "%Y-%m-%d %H:%M:%S")) - time.time() - tz_offset
+      if time.localtime()[8]:
+        tz_offset = time.altzone
+      else:
+        tz_offset = time.timezone
+
+      sec = time.mktime(time.strptime(end_interval, "%Y-%m-%d %H:%M:%S")) - time.time() - tz_offset
+
       if CONFIG["features.graph.bw.accounting.isTimeLong"]:
-        queried["resetTime"] = ", ".join(str_tools.get_time_labels(sec, True))
+        queried["reset_time"] = ", ".join(str_tools.get_time_labels(sec, True))
       else:
         days = sec / 86400
         sec %= 86400
@@ -411,22 +487,22 @@ class BandwidthStats(graphPanel.GraphStats):
         sec %= 3600
         minutes = sec / 60
         sec %= 60
-        queried["resetTime"] = "%i:%02i:%02i:%02i" % (days, hours, minutes, sec)
+        queried["reset_time"] = "%i:%02i:%02i:%02i" % (days, hours, minutes, sec)
 
     # number of bytes used and in total for the accounting period
-    used = conn.getInfo("accounting/bytes", None)
-    left = conn.getInfo("accounting/bytes-left", None)
+
+    used = conn.get_info("accounting/bytes", None)
+    left = conn.get_info("accounting/bytes-left", None)
 
     if used and left:
-      usedComp, leftComp = used.split(" "), left.split(" ")
-      read, written = int(usedComp[0]), int(usedComp[1])
-      readLeft, writtenLeft = int(leftComp[0]), int(leftComp[1])
+      used_comp, left_comp = used.split(" "), left.split(" ")
+      read, written = int(used_comp[0]), int(used_comp[1])
+      read_left, written_left = int(left_comp[0]), int(left_comp[1])
 
       queried["read"] = str_tools.get_size_label(read)
       queried["written"] = str_tools.get_size_label(written)
-      queried["readLimit"] = str_tools.get_size_label(read + readLeft)
-      queried["writtenLimit"] = str_tools.get_size_label(written + writtenLeft)
-
-    self.accountingInfo = queried
-    self.accountingLastUpdated = time.time()
+      queried["read_limit"] = str_tools.get_size_label(read + read_left)
+      queried["writtenLimit"] = str_tools.get_size_label(written + written_left)
 
+    self.accounting_info = queried
+    self.accounting_last_updated = time.time()
diff --git a/arm/graphing/connStats.py b/arm/graphing/connStats.py
index 3f23b33..068fd0a 100644
--- a/arm/graphing/connStats.py
+++ b/arm/graphing/connStats.py
@@ -9,6 +9,7 @@ from arm.util import torTools
 
 from stem.control import State
 
+
 class ConnStats(graphPanel.GraphStats):
   """
   Tracks number of connections, counting client and directory connections as
@@ -19,44 +20,53 @@ class ConnStats(graphPanel.GraphStats):
     graphPanel.GraphStats.__init__(self)
 
     # listens for tor reload (sighup) events which can reset the ports tor uses
-    conn = torTools.getConn()
-    self.orPort, self.dirPort, self.controlPort = "0", "0", "0"
-    self.resetListener(conn.getController(), State.INIT, None) # initialize port values
-    conn.addStatusListener(self.resetListener)
-
-  def clone(self, newCopy=None):
-    if not newCopy: newCopy = ConnStats()
-    return graphPanel.GraphStats.clone(self, newCopy)
-
-  def resetListener(self, controller, eventType, _):
-    if eventType in (State.INIT, State.RESET):
-      self.orPort = controller.get_conf("ORPort", "0")
-      self.dirPort = controller.get_conf("DirPort", "0")
-      self.controlPort = controller.get_conf("ControlPort", "0")
-
-  def eventTick(self):
+
+    conn = torTools.get_conn()
+    self.or_port, self.dir_port, self.control_port = "0", "0", "0"
+    self.reset_listener(conn.get_controller(), State.INIT, None)  # initialize port values
+    conn.add_status_listener(self.reset_listener)
+
+  def clone(self, new_copy=None):
+    if not new_copy:
+      new_copy = ConnStats()
+
+    return graphPanel.GraphStats.clone(self, new_copy)
+
+  def reset_listener(self, controller, event_type, _):
+    if event_type in (State.INIT, State.RESET):
+      self.or_port = controller.get_conf("ORPort", "0")
+      self.dir_port = controller.get_conf("DirPort", "0")
+      self.control_port = controller.get_conf("ControlPort", "0")
+
+  def event_tick(self):
     """
     Fetches connection stats from cached information.
     """
 
-    inboundCount, outboundCount = 0, 0
+    inbound_count, outbound_count = 0, 0
 
     for entry in arm.util.tracker.get_connection_tracker().get_connections():
-      localPort = entry.local_port
-      if localPort in (self.orPort, self.dirPort): inboundCount += 1
-      elif localPort == self.controlPort: pass # control connection
-      else: outboundCount += 1
+      local_port = entry.local_port
+
+      if local_port in (self.or_port, self.dir_port):
+        inbound_count += 1
+      elif local_port == self.control_port:
+        pass  # control connection
+      else:
+        outbound_count += 1
 
-    self._processEvent(inboundCount, outboundCount)
+    self._process_event(inbound_count, outbound_count)
 
-  def getTitle(self, width):
+  def get_title(self, width):
     return "Connection Count:"
 
-  def getHeaderLabel(self, width, isPrimary):
-    avg = (self.primaryTotal if isPrimary else self.secondaryTotal) / max(1, self.tick)
-    if isPrimary: return "Inbound (%s, avg: %s):" % (self.lastPrimary, avg)
-    else: return "Outbound (%s, avg: %s):" % (self.lastSecondary, avg)
+  def get_header_label(self, width, is_primary):
+    avg = (self.primary_total if is_primary else self.secondary_total) / max(1, self.tick)
 
-  def getRefreshRate(self):
-    return 5
+    if is_primary:
+      return "Inbound (%s, avg: %s):" % (self.last_primary, avg)
+    else:
+      return "Outbound (%s, avg: %s):" % (self.last_secondary, avg)
 
+  def get_refresh_rate(self):
+    return 5
diff --git a/arm/graphing/graphPanel.py b/arm/graphing/graphPanel.py
index 50b755d..aeb4cff 100644
--- a/arm/graphing/graphPanel.py
+++ b/arm/graphing/graphPanel.py
@@ -29,11 +29,19 @@ from arm.util import panel, torTools, uiTools
 from stem.util import conf, enum, str_tools
 
 # time intervals at which graphs can be updated
-UPDATE_INTERVALS = [("each second", 1), ("5 seconds", 5),   ("30 seconds", 30),
-                    ("minutely", 60),   ("15 minute", 900), ("30 minute", 1800),
-                    ("hourly", 3600),   ("daily", 86400)]
 
-DEFAULT_CONTENT_HEIGHT = 4 # space needed for labeling above and below the graph
+UPDATE_INTERVALS = [
+  ("each second", 1),
+  ("5 seconds", 5),
+  ("30 seconds", 30),
+  ("minutely", 60),
+  ("15 minute", 900),
+  ("30 minute", 1800),
+  ("hourly", 3600),
+  ("daily", 86400),
+]
+
+DEFAULT_CONTENT_HEIGHT = 4  # space needed for labeling above and below the graph
 DEFAULT_COLOR_PRIMARY, DEFAULT_COLOR_SECONDARY = "green", "cyan"
 MIN_GRAPH_HEIGHT = 1
 
@@ -41,29 +49,34 @@ MIN_GRAPH_HEIGHT = 1
 #   Bounds.GLOBAL_MAX - global maximum (highest value ever seen)
 #   Bounds.LOCAL_MAX - local maximum (highest value currently on the graph)
 #   Bounds.TIGHT - local maximum and minimum
+
 Bounds = enum.Enum("GLOBAL_MAX", "LOCAL_MAX", "TIGHT")
 
 WIDE_LABELING_GRAPH_COL = 50  # minimum graph columns to use wide spacing for x-axis labels
 
+
 def conf_handler(key, value):
   if key == "features.graph.height":
     return max(MIN_GRAPH_HEIGHT, value)
-  elif key == "features.graph.maxWidth":
+  elif key == "features.graph.max_width":
     return max(1, value)
   elif key == "features.graph.interval":
     return max(0, min(len(UPDATE_INTERVALS) - 1, value))
   elif key == "features.graph.bound":
     return max(0, min(2, value))
 
+
 # used for setting defaults when initializing GraphStats and GraphPanel instances
+
 CONFIG = conf.config_dict("arm", {
   "features.graph.height": 7,
   "features.graph.interval": 0,
   "features.graph.bound": 1,
-  "features.graph.maxWidth": 150,
+  "features.graph.max_width": 150,
   "features.graph.showIntermediateBounds": True,
 }, conf_handler)
 
+
 class GraphStats:
   """
   Module that's expected to update dynamically and provide attributes to be
@@ -77,55 +90,63 @@ class GraphStats:
     """
 
     # panel to be redrawn when updated (set when added to GraphPanel)
-    self._graphPanel = None
-    self.isSelected = False
-    self.isPauseBuffer = False
+
+    self._graph_panel = None
+    self.is_selected = False
+    self.is_pause_buffer = False
 
     # tracked stats
-    self.tick = 0                                 # number of processed events
-    self.lastPrimary, self.lastSecondary = 0, 0   # most recent registered stats
-    self.primaryTotal, self.secondaryTotal = 0, 0 # sum of all stats seen
+
+    self.tick = 0                                    # number of processed events
+    self.last_primary, self.last_secondary = 0, 0    # most recent registered stats
+    self.primary_total, self.secondary_total = 0, 0  # sum of all stats seen
 
     # timescale dependent stats
-    self.maxCol = CONFIG["features.graph.maxWidth"]
-    self.maxPrimary, self.maxSecondary = {}, {}
-    self.primaryCounts, self.secondaryCounts = {}, {}
+
+    self.max_column = CONFIG["features.graph.max_width"]
+    self.max_primary, self.max_secondary = {}, {}
+    self.primary_counts, self.secondary_counts = {}, {}
 
     for i in range(len(UPDATE_INTERVALS)):
       # recent rates for graph
-      self.maxPrimary[i] = 0
-      self.maxSecondary[i] = 0
+
+      self.max_primary[i] = 0
+      self.max_secondary[i] = 0
 
       # historic stats for graph, first is accumulator
       # iterative insert needed to avoid making shallow copies (nasty, nasty gotcha)
-      self.primaryCounts[i] = (self.maxCol + 1) * [0]
-      self.secondaryCounts[i] = (self.maxCol + 1) * [0]
+
+      self.primary_counts[i] = (self.max_column + 1) * [0]
+      self.secondary_counts[i] = (self.max_column + 1) * [0]
 
     # tracks BW events
-    torTools.getConn().addEventListener(self.bandwidth_event, stem.control.EventType.BW)
 
-  def clone(self, newCopy=None):
+    torTools.get_conn().add_event_listener(self.bandwidth_event, stem.control.EventType.BW)
+
+  def clone(self, new_copy=None):
     """
     Provides a deep copy of this instance.
 
     Arguments:
-      newCopy - base instance to build copy off of
+      new_copy - base instance to build copy off of
     """
 
-    if not newCopy: newCopy = GraphStats()
-    newCopy.tick = self.tick
-    newCopy.lastPrimary = self.lastPrimary
-    newCopy.lastSecondary = self.lastSecondary
-    newCopy.primaryTotal = self.primaryTotal
-    newCopy.secondaryTotal = self.secondaryTotal
-    newCopy.maxPrimary = dict(self.maxPrimary)
-    newCopy.maxSecondary = dict(self.maxSecondary)
-    newCopy.primaryCounts = copy.deepcopy(self.primaryCounts)
-    newCopy.secondaryCounts = copy.deepcopy(self.secondaryCounts)
-    newCopy.isPauseBuffer = True
-    return newCopy
+    if not new_copy:
+      new_copy = GraphStats()
+
+    new_copy.tick = self.tick
+    new_copy.last_primary = self.last_primary
+    new_copy.last_secondary = self.last_secondary
+    new_copy.primary_total = self.primary_total
+    new_copy.secondary_total = self.secondary_total
+    new_copy.max_primary = dict(self.max_primary)
+    new_copy.max_secondary = dict(self.max_secondary)
+    new_copy.primary_counts = copy.deepcopy(self.primary_counts)
+    new_copy.secondary_counts = copy.deepcopy(self.secondary_counts)
+    new_copy.is_pause_buffer = True
+    return new_copy
 
-  def eventTick(self):
+  def event_tick(self):
     """
     Called when it's time to process another event. All graphs use tor BW
     events to keep in sync with each other (this happens once a second).
@@ -133,47 +154,48 @@ class GraphStats:
 
     pass
 
-  def isNextTickRedraw(self):
+  def is_next_tick_redraw(self):
     """
-    Provides true if the following tick (call to _processEvent) will result in
+    Provides true if the following tick (call to _process_event) will result in
     being redrawn.
     """
 
-    if self._graphPanel and self.isSelected and not self._graphPanel.isPaused():
+    if self._graph_panel and self.is_selected and not self._graph_panel.is_paused():
       # use the minimum of the current refresh rate and the panel's
-      updateRate = UPDATE_INTERVALS[self._graphPanel.updateInterval][1]
-      return (self.tick + 1) % min(updateRate, self.getRefreshRate()) == 0
-    else: return False
+      update_rate = UPDATE_INTERVALS[self._graph_panel.update_interval][1]
+      return (self.tick + 1) % min(update_rate, self.get_refresh_rate()) == 0
+    else:
+      return False
 
-  def getTitle(self, width):
+  def get_title(self, width):
     """
     Provides top label.
     """
 
     return ""
 
-  def getHeaderLabel(self, width, isPrimary):
+  def get_header_label(self, width, is_primary):
     """
     Provides labeling presented at the top of the graph.
     """
 
     return ""
 
-  def getColor(self, isPrimary):
+  def get_color(self, is_primary):
     """
     Provides the color to be used for the graph and stats.
     """
 
-    return DEFAULT_COLOR_PRIMARY if isPrimary else DEFAULT_COLOR_SECONDARY
+    return DEFAULT_COLOR_PRIMARY if is_primary else DEFAULT_COLOR_SECONDARY
 
-  def getContentHeight(self):
+  def get_content_height(self):
     """
     Provides the height content should take up (not including the graph).
     """
 
     return DEFAULT_CONTENT_HEIGHT
 
-  def getRefreshRate(self):
+  def get_refresh_rate(self):
     """
     Provides the number of ticks between when the stats have new values to be
     redrawn.
@@ -181,7 +203,7 @@ class GraphStats:
 
     return 1
 
-  def isVisible(self):
+  def is_visible(self):
     """
     True if the stat has content to present, false if it should be hidden.
     """
@@ -196,39 +218,44 @@ class GraphStats:
     pass
 
   def bandwidth_event(self, event):
-    if not self.isPauseBuffer: self.eventTick()
+    if not self.is_pause_buffer:
+      self.event_tick()
 
-  def _processEvent(self, primary, secondary):
+  def _process_event(self, primary, secondary):
     """
     Includes new stats in graphs and notifies associated GraphPanel of changes.
     """
 
-    isRedraw = self.isNextTickRedraw()
+    is_redraw = self.is_next_tick_redraw()
 
-    self.lastPrimary, self.lastSecondary = primary, secondary
-    self.primaryTotal += primary
-    self.secondaryTotal += secondary
+    self.last_primary, self.last_secondary = primary, secondary
+    self.primary_total += primary
+    self.secondary_total += secondary
 
     # updates for all time intervals
+
     self.tick += 1
+
     for i in range(len(UPDATE_INTERVALS)):
       lable, timescale = UPDATE_INTERVALS[i]
 
-      self.primaryCounts[i][0] += primary
-      self.secondaryCounts[i][0] += secondary
+      self.primary_counts[i][0] += primary
+      self.secondary_counts[i][0] += secondary
 
       if self.tick % timescale == 0:
-        self.maxPrimary[i] = max(self.maxPrimary[i], self.primaryCounts[i][0] / timescale)
-        self.primaryCounts[i][0] /= timescale
-        self.primaryCounts[i].insert(0, 0)
-        del self.primaryCounts[i][self.maxCol + 1:]
+        self.max_primary[i] = max(self.max_primary[i], self.primary_counts[i][0] / timescale)
+        self.primary_counts[i][0] /= timescale
+        self.primary_counts[i].insert(0, 0)
+        del self.primary_counts[i][self.max_column + 1:]
+
+        self.max_secondary[i] = max(self.max_secondary[i], self.secondary_counts[i][0] / timescale)
+        self.secondary_counts[i][0] /= timescale
+        self.secondary_counts[i].insert(0, 0)
+        del self.secondary_counts[i][self.max_column + 1:]
 
-        self.maxSecondary[i] = max(self.maxSecondary[i], self.secondaryCounts[i][0] / timescale)
-        self.secondaryCounts[i][0] /= timescale
-        self.secondaryCounts[i].insert(0, 0)
-        del self.secondaryCounts[i][self.maxCol + 1:]
+    if is_redraw and self._graph_panel:
+      self._graph_panel.redraw(True)
 
-    if isRedraw and self._graphPanel: self._graphPanel.redraw(True)
 
 class GraphPanel(panel.Panel):
   """
@@ -238,69 +265,70 @@ class GraphPanel(panel.Panel):
 
   def __init__(self, stdscr):
     panel.Panel.__init__(self, stdscr, "graph", 0)
-    self.updateInterval = CONFIG["features.graph.interval"]
+    self.update_interval = CONFIG["features.graph.interval"]
     self.bounds = list(Bounds)[CONFIG["features.graph.bound"]]
-    self.graphHeight = CONFIG["features.graph.height"]
-    self.currentDisplay = None    # label of the stats currently being displayed
-    self.stats = {}               # available stats (mappings of label -> instance)
-    self.setPauseAttr("stats")
+    self.graph_height = CONFIG["features.graph.height"]
+    self.current_display = None    # label of the stats currently being displayed
+    self.stats = {}                # available stats (mappings of label -> instance)
+    self.set_pause_attr("stats")
 
-  def getUpdateInterval(self):
+  def get_update_interval(self):
     """
     Provides the rate that we update the graph at.
     """
 
-    return self.updateInterval
+    return self.update_interval
 
-  def setUpdateInterval(self, updateInterval):
+  def set_update_interval(self, update_interval):
     """
     Sets the rate that we update the graph at.
 
     Arguments:
-      updateInterval - update time enum
+      update_interval - update time enum
     """
 
-    self.updateInterval = updateInterval
+    self.update_interval = update_interval
 
-  def getBoundsType(self):
+  def get_bounds_type(self):
     """
     Provides the type of graph bounds used.
     """
 
     return self.bounds
 
-  def setBoundsType(self, boundsType):
+  def set_bounds_type(self, bounds_type):
     """
     Sets the type of graph boundaries we use.
 
     Arguments:
-      boundsType - graph bounds enum
+      bounds_type - graph bounds enum
     """
 
-    self.bounds = boundsType
+    self.bounds = bounds_type
 
-  def getHeight(self):
+  def get_height(self):
     """
     Provides the height requested by the currently displayed GraphStats (zero
     if hidden).
     """
 
-    if self.currentDisplay and self.stats[self.currentDisplay].isVisible():
-      return self.stats[self.currentDisplay].getContentHeight() + self.graphHeight
-    else: return 0
+    if self.current_display and self.stats[self.current_display].is_visible():
+      return self.stats[self.current_display].get_content_height() + self.graph_height
+    else:
+      return 0
 
-  def setGraphHeight(self, newGraphHeight):
+  def set_graph_height(self, new_graph_height):
     """
     Sets the preferred height used for the graph (restricted to the
     MIN_GRAPH_HEIGHT minimum).
 
     Arguments:
-      newGraphHeight - new height for the graph
+      new_graph_height - new height for the graph
     """
 
-    self.graphHeight = max(MIN_GRAPH_HEIGHT, newGraphHeight)
+    self.graph_height = max(MIN_GRAPH_HEIGHT, new_graph_height)
 
-  def resizeGraph(self):
+  def resize_graph(self):
     """
     Prompts for user input to resize the graph panel. Options include...
       down arrow - grow graph
@@ -308,211 +336,261 @@ class GraphPanel(panel.Panel):
       enter / space - set size
     """
 
-    control = arm.controller.getController()
+    control = arm.controller.get_controller()
 
     panel.CURSES_LOCK.acquire()
+
     try:
       while True:
         msg = "press the down/up to resize the graph, and enter when done"
-        control.setMsg(msg, curses.A_BOLD, True)
+        control.set_msg(msg, curses.A_BOLD, True)
         curses.cbreak()
-        key = control.getScreen().getch()
+        key = control.get_screen().getch()
 
         if key == curses.KEY_DOWN:
           # don't grow the graph if it's already consuming the whole display
           # (plus an extra line for the graph/log gap)
-          maxHeight = self.parent.getmaxyx()[0] - self.top
-          currentHeight = self.getHeight()
 
-          if currentHeight < maxHeight + 1:
-            self.setGraphHeight(self.graphHeight + 1)
+          max_height = self.parent.getmaxyx()[0] - self.top
+          current_height = self.get_height()
+
+          if current_height < max_height + 1:
+            self.set_graph_height(self.graph_height + 1)
         elif key == curses.KEY_UP:
-          self.setGraphHeight(self.graphHeight - 1)
-        elif uiTools.isSelectionKey(key): break
+          self.set_graph_height(self.graph_height - 1)
+        elif uiTools.is_selection_key(key):
+          break
 
         control.redraw()
     finally:
-      control.setMsg()
+      control.set_msg()
       panel.CURSES_LOCK.release()
 
-  def handleKey(self, key):
-    isKeystrokeConsumed = True
+  def handle_key(self, key):
+    is_keystroke_consumed = True
+
     if key == ord('r') or key == ord('R'):
-      self.resizeGraph()
+      self.resize_graph()
     elif key == ord('b') or key == ord('B'):
       # uses the next boundary type
       self.bounds = Bounds.next(self.bounds)
       self.redraw(True)
     elif key == ord('s') or key == ord('S'):
       # provides a menu to pick the graphed stats
-      availableStats = self.stats.keys()
-      availableStats.sort()
+
+      available_stats = self.stats.keys()
+      available_stats.sort()
 
       # uses sorted, camel cased labels for the options
+
       options = ["None"]
-      for label in availableStats:
+
+      for label in available_stats:
         words = label.split()
         options.append(" ".join(word[0].upper() + word[1:] for word in words))
 
-      if self.currentDisplay:
-        initialSelection = availableStats.index(self.currentDisplay) + 1
-      else: initialSelection = 0
+      if self.current_display:
+        initial_selection = available_stats.index(self.current_display) + 1
+      else:
+        initial_selection = 0
 
-      selection = arm.popups.showMenu("Graphed Stats:", options, initialSelection)
+      selection = arm.popups.show_menu("Graphed Stats:", options, initial_selection)
 
       # applies new setting
-      if selection == 0: self.setStats(None)
-      elif selection != -1: self.setStats(availableStats[selection - 1])
+
+      if selection == 0:
+        self.set_stats(None)
+      elif selection != -1:
+        self.set_stats(available_stats[selection - 1])
     elif key == ord('i') or key == ord('I'):
       # provides menu to pick graph panel update interval
+
       options = [label for (label, _) in UPDATE_INTERVALS]
-      selection = arm.popups.showMenu("Update Interval:", options, self.updateInterval)
-      if selection != -1: self.updateInterval = selection
-    else: isKeystrokeConsumed = False
+      selection = arm.popups.show_menu("Update Interval:", options, self.update_interval)
+
+      if selection != -1:
+        self.update_interval = selection
+    else:
+      is_keystroke_consumed = False
 
-    return isKeystrokeConsumed
+    return is_keystroke_consumed
 
-  def getHelp(self):
-    if self.currentDisplay: graphedStats = self.currentDisplay
-    else: graphedStats = "none"
+  def get_help(self):
+    if self.current_display:
+      graphed_stats = self.current_display
+    else:
+      graphed_stats = "none"
 
     options = []
     options.append(("r", "resize graph", None))
-    options.append(("s", "graphed stats", graphedStats))
+    options.append(("s", "graphed stats", graphed_stats))
     options.append(("b", "graph bounds", self.bounds.lower()))
-    options.append(("i", "graph update interval", UPDATE_INTERVALS[self.updateInterval][0]))
+    options.append(("i", "graph update interval", UPDATE_INTERVALS[self.update_interval][0]))
     return options
 
   def draw(self, width, height):
     """ Redraws graph panel """
 
-    if self.currentDisplay:
-      param = self.getAttr("stats")[self.currentDisplay]
-      graphCol = min((width - 10) / 2, param.maxCol)
+    if self.current_display:
+      param = self.get_attr("stats")[self.current_display]
+      graph_column = min((width - 10) / 2, param.max_column)
 
-      primaryColor = uiTools.getColor(param.getColor(True))
-      secondaryColor = uiTools.getColor(param.getColor(False))
+      primary_color = uiTools.get_color(param.get_color(True))
+      secondary_color = uiTools.get_color(param.get_color(False))
 
-      if self.isTitleVisible(): self.addstr(0, 0, param.getTitle(width), curses.A_STANDOUT)
+      if self.is_title_visible():
+        self.addstr(0, 0, param.get_title(width), curses.A_STANDOUT)
 
       # top labels
-      left, right = param.getHeaderLabel(width / 2, True), param.getHeaderLabel(width / 2, False)
-      if left: self.addstr(1, 0, left, curses.A_BOLD | primaryColor)
-      if right: self.addstr(1, graphCol + 5, right, curses.A_BOLD | secondaryColor)
+
+      left, right = param.get_header_label(width / 2, True), param.get_header_label(width / 2, False)
+
+      if left:
+        self.addstr(1, 0, left, curses.A_BOLD | primary_color)
+
+      if right:
+        self.addstr(1, graph_column + 5, right, curses.A_BOLD | secondary_color)
 
       # determines max/min value on the graph
+
       if self.bounds == Bounds.GLOBAL_MAX:
-        primaryMaxBound = int(param.maxPrimary[self.updateInterval])
-        secondaryMaxBound = int(param.maxSecondary[self.updateInterval])
+        primary_max_bound = int(param.max_primary[self.update_interval])
+        secondary_max_bound = int(param.max_secondary[self.update_interval])
       else:
         # both Bounds.LOCAL_MAX and Bounds.TIGHT use local maxima
-        if graphCol < 2:
+        if graph_column < 2:
           # nothing being displayed
-          primaryMaxBound, secondaryMaxBound = 0, 0
+          primary_max_bound, secondary_max_bound = 0, 0
         else:
-          primaryMaxBound = int(max(param.primaryCounts[self.updateInterval][1:graphCol + 1]))
-          secondaryMaxBound = int(max(param.secondaryCounts[self.updateInterval][1:graphCol + 1]))
+          primary_max_bound = int(max(param.primary_counts[self.update_interval][1:graph_column + 1]))
+          secondary_max_bound = int(max(param.secondary_counts[self.update_interval][1:graph_column + 1]))
+
+      primary_min_bound = secondary_min_bound = 0
 
-      primaryMinBound = secondaryMinBound = 0
       if self.bounds == Bounds.TIGHT:
-        primaryMinBound = int(min(param.primaryCounts[self.updateInterval][1:graphCol + 1]))
-        secondaryMinBound = int(min(param.secondaryCounts[self.updateInterval][1:graphCol + 1]))
+        primary_min_bound = int(min(param.primary_counts[self.update_interval][1:graph_column + 1]))
+        secondary_min_bound = int(min(param.secondary_counts[self.update_interval][1:graph_column + 1]))
 
         # if the max = min (ie, all values are the same) then use zero lower
         # bound so a graph is still displayed
-        if primaryMinBound == primaryMaxBound: primaryMinBound = 0
-        if secondaryMinBound == secondaryMaxBound: secondaryMinBound = 0
+
+        if primary_min_bound == primary_max_bound:
+          primary_min_bound = 0
+
+        if secondary_min_bound == secondary_max_bound:
+          secondary_min_bound = 0
 
       # displays upper and lower bounds
-      self.addstr(2, 0, "%4i" % primaryMaxBound, primaryColor)
-      self.addstr(self.graphHeight + 1, 0, "%4i" % primaryMinBound, primaryColor)
 
-      self.addstr(2, graphCol + 5, "%4i" % secondaryMaxBound, secondaryColor)
-      self.addstr(self.graphHeight + 1, graphCol + 5, "%4i" % secondaryMinBound, secondaryColor)
+      self.addstr(2, 0, "%4i" % primary_max_bound, primary_color)
+      self.addstr(self.graph_height + 1, 0, "%4i" % primary_min_bound, primary_color)
+
+      self.addstr(2, graph_column + 5, "%4i" % secondary_max_bound, secondary_color)
+      self.addstr(self.graph_height + 1, graph_column + 5, "%4i" % secondary_min_bound, secondary_color)
 
       # displays intermediate bounds on every other row
+
       if CONFIG["features.graph.showIntermediateBounds"]:
-        ticks = (self.graphHeight - 3) / 2
+        ticks = (self.graph_height - 3) / 2
+
         for i in range(ticks):
-          row = self.graphHeight - (2 * i) - 3
-          if self.graphHeight % 2 == 0 and i >= (ticks / 2): row -= 1
+          row = self.graph_height - (2 * i) - 3
 
-          if primaryMinBound != primaryMaxBound:
-            primaryVal = (primaryMaxBound - primaryMinBound) * (self.graphHeight - row - 1) / (self.graphHeight - 1)
-            if not primaryVal in (primaryMinBound, primaryMaxBound): self.addstr(row + 2, 0, "%4i" % primaryVal, primaryColor)
+          if self.graph_height % 2 == 0 and i >= (ticks / 2):
+            row -= 1
 
-          if secondaryMinBound != secondaryMaxBound:
-            secondaryVal = (secondaryMaxBound - secondaryMinBound) * (self.graphHeight - row - 1) / (self.graphHeight - 1)
-            if not secondaryVal in (secondaryMinBound, secondaryMaxBound): self.addstr(row + 2, graphCol + 5, "%4i" % secondaryVal, secondaryColor)
+          if primary_min_bound != primary_max_bound:
+            primary_val = (primary_max_bound - primary_min_bound) * (self.graph_height - row - 1) / (self.graph_height - 1)
+
+            if not primary_val in (primary_min_bound, primary_max_bound):
+              self.addstr(row + 2, 0, "%4i" % primary_val, primary_color)
+
+          if secondary_min_bound != secondary_max_bound:
+            secondary_val = (secondary_max_bound - secondary_min_bound) * (self.graph_height - row - 1) / (self.graph_height - 1)
+
+            if not secondary_val in (secondary_min_bound, secondary_max_bound):
+              self.addstr(row + 2, graph_column + 5, "%4i" % secondary_val, secondary_color)
 
       # creates bar graph (both primary and secondary)
-      for col in range(graphCol):
-        colCount = int(param.primaryCounts[self.updateInterval][col + 1]) - primaryMinBound
-        colHeight = min(self.graphHeight, self.graphHeight * colCount / (max(1, primaryMaxBound) - primaryMinBound))
-        for row in range(colHeight): self.addstr(self.graphHeight + 1 - row, col + 5, " ", curses.A_STANDOUT | primaryColor)
 
-        colCount = int(param.secondaryCounts[self.updateInterval][col + 1]) - secondaryMinBound
-        colHeight = min(self.graphHeight, self.graphHeight * colCount / (max(1, secondaryMaxBound) - secondaryMinBound))
-        for row in range(colHeight): self.addstr(self.graphHeight + 1 - row, col + graphCol + 10, " ", curses.A_STANDOUT | secondaryColor)
+      for col in range(graph_column):
+        column_count = int(param.primary_counts[self.update_interval][col + 1]) - primary_min_bound
+        column_height = min(self.graph_height, self.graph_height * column_count / (max(1, primary_max_bound) - primary_min_bound))
+
+        for row in range(column_height):
+          self.addstr(self.graph_height + 1 - row, col + 5, " ", curses.A_STANDOUT | primary_color)
+
+        column_count = int(param.secondary_counts[self.update_interval][col + 1]) - secondary_min_bound
+        column_height = min(self.graph_height, self.graph_height * column_count / (max(1, secondary_max_bound) - secondary_min_bound))
+
+        for row in range(column_height):
+          self.addstr(self.graph_height + 1 - row, col + graph_column + 10, " ", curses.A_STANDOUT | secondary_color)
 
       # bottom labeling of x-axis
-      intervalSec = 1 # seconds per labeling
+
+      interval_sec = 1  # seconds per labeling
+
       for i in range(len(UPDATE_INTERVALS)):
-        if i == self.updateInterval: intervalSec = UPDATE_INTERVALS[i][1]
+        if i == self.update_interval:
+          interval_sec = UPDATE_INTERVALS[i][1]
+
+      interval_spacing = 10 if graph_column >= WIDE_LABELING_GRAPH_COL else 5
+      units_label, decimal_precision = None, 0
 
-      intervalSpacing = 10 if graphCol >= WIDE_LABELING_GRAPH_COL else 5
-      unitsLabel, decimalPrecision = None, 0
-      for i in range((graphCol - 4) / intervalSpacing):
-        loc = (i + 1) * intervalSpacing
-        timeLabel = str_tools.get_time_label(loc * intervalSec, decimalPrecision)
+      for i in range((graph_column - 4) / interval_spacing):
+        loc = (i + 1) * interval_spacing
+        time_label = str_tools.get_time_label(loc * interval_sec, decimal_precision)
 
-        if not unitsLabel: unitsLabel = timeLabel[-1]
-        elif unitsLabel != timeLabel[-1]:
+        if not units_label:
+          units_label = time_label[-1]
+        elif units_label != time_label[-1]:
           # upped scale so also up precision of future measurements
-          unitsLabel = timeLabel[-1]
-          decimalPrecision += 1
+          units_label = time_label[-1]
+          decimal_precision += 1
         else:
           # if constrained on space then strips labeling since already provided
-          timeLabel = timeLabel[:-1]
+          time_label = time_label[:-1]
 
-        self.addstr(self.graphHeight + 2, 4 + loc, timeLabel, primaryColor)
-        self.addstr(self.graphHeight + 2, graphCol + 10 + loc, timeLabel, secondaryColor)
+        self.addstr(self.graph_height + 2, 4 + loc, time_label, primary_color)
+        self.addstr(self.graph_height + 2, graph_column + 10 + loc, time_label, secondary_color)
 
-      param.draw(self, width, height) # allows current stats to modify the display
+      param.draw(self, width, height)  # allows current stats to modify the display
 
-  def addStats(self, label, stats):
+  def add_stats(self, label, stats):
     """
     Makes GraphStats instance available in the panel.
     """
 
-    stats._graphPanel = self
+    stats._graph_panel = self
     self.stats[label] = stats
 
-  def getStats(self):
+  def get_stats(self):
     """
     Provides the currently selected stats label.
     """
 
-    return self.currentDisplay
+    return self.current_display
 
-  def setStats(self, label):
+  def set_stats(self, label):
     """
     Sets the currently displayed stats instance, hiding panel if None.
     """
 
-    if label != self.currentDisplay:
-      if self.currentDisplay: self.stats[self.currentDisplay].isSelected = False
+    if label != self.current_display:
+      if self.current_display:
+        self.stats[self.current_display].is_selected = False
 
       if not label:
-        self.currentDisplay = None
+        self.current_display = None
       elif label in self.stats.keys():
-        self.currentDisplay = label
-        self.stats[self.currentDisplay].isSelected = True
-      else: raise ValueError("Unrecognized stats label: %s" % label)
+        self.current_display = label
+        self.stats[self.current_display].is_selected = True
+      else:
+        raise ValueError("Unrecognized stats label: %s" % label)
 
-  def copyAttr(self, attr):
+  def copy_attr(self, attr):
     if attr == "stats":
       # uses custom clone method to copy GraphStats instances
       return dict([(key, self.stats[key].clone()) for key in self.stats])
-    else: return panel.Panel.copyAttr(self, attr)
-
+    else:
+      return panel.Panel.copy_attr(self, attr)
diff --git a/arm/graphing/resourceStats.py b/arm/graphing/resourceStats.py
index 352c8ec..dc3aaf9 100644
--- a/arm/graphing/resourceStats.py
+++ b/arm/graphing/resourceStats.py
@@ -9,6 +9,7 @@ from arm.util import torTools
 
 from stem.util import str_tools
 
+
 class ResourceStats(graphPanel.GraphStats):
   """
   System resource usage tracker.
@@ -16,43 +17,47 @@ class ResourceStats(graphPanel.GraphStats):
 
   def __init__(self):
     graphPanel.GraphStats.__init__(self)
-    self.queryPid = torTools.getConn().controller.get_pid(None)
-    self.lastCounter = None
+    self.query_pid = torTools.get_conn().controller.get_pid(None)
+    self.last_counter = None
+
+  def clone(self, new_copy=None):
+    if not new_copy:
+      new_copy = ResourceStats()
 
-  def clone(self, newCopy=None):
-    if not newCopy: newCopy = ResourceStats()
-    return graphPanel.GraphStats.clone(self, newCopy)
+    return graphPanel.GraphStats.clone(self, new_copy)
 
-  def getTitle(self, width):
+  def get_title(self, width):
     return "System Resources:"
 
-  def getHeaderLabel(self, width, isPrimary):
-    avg = (self.primaryTotal if isPrimary else self.secondaryTotal) / max(1, self.tick)
-    lastAmount = self.lastPrimary if isPrimary else self.lastSecondary
+  def get_header_label(self, width, is_primary):
+    avg = (self.primary_total if is_primary else self.secondary_total) / max(1, self.tick)
+    last_amount = self.last_primary if is_primary else self.last_secondary
 
-    if isPrimary:
-      return "CPU (%0.1f%%, avg: %0.1f%%):" % (lastAmount, avg)
+    if is_primary:
+      return "CPU (%0.1f%%, avg: %0.1f%%):" % (last_amount, avg)
     else:
       # memory sizes are converted from MB to B before generating labels
-      usageLabel = str_tools.get_size_label(lastAmount * 1048576, 1)
-      avgLabel = str_tools.get_size_label(avg * 1048576, 1)
-      return "Memory (%s, avg: %s):" % (usageLabel, avgLabel)
 
-  def eventTick(self):
+      usage_label = str_tools.get_size_label(last_amount * 1048576, 1)
+      avg_label = str_tools.get_size_label(avg * 1048576, 1)
+
+      return "Memory (%s, avg: %s):" % (usage_label, avg_label)
+
+  def event_tick(self):
     """
     Fetch the cached measurement of resource usage from the ResourceTracker.
     """
 
     primary, secondary = 0, 0
-    if self.queryPid:
-      resourceTracker = arm.util.tracker.get_resource_tracker()
 
-      if resourceTracker and resourceTracker.run_counter() != self.lastCounter:
-        resources = resourceTracker.get_resource_usage()
-        self.lastCounter = resourceTracker.run_counter()
+    if self.query_pid:
+      resource_tracker = arm.util.tracker.get_resource_tracker()
+
+      if resource_tracker and resource_tracker.run_counter() != self.last_counter:
+        resources = resource_tracker.get_resource_usage()
+        self.last_counter = resource_tracker.run_counter()
         primary = resources.cpu_sample * 100  # decimal percentage to whole numbers
         secondary = resources.memory_bytes / 1048576  # translate size to MB so axis labels are short
-        self.runCount = resourceTracker.run_counter()
-
-    self._processEvent(primary, secondary)
+        self.run_count = resource_tracker.run_counter()
 
+    self._process_event(primary, secondary)
diff --git a/arm/headerPanel.py b/arm/headerPanel.py
index 158b826..744079b 100644
--- a/arm/headerPanel.py
+++ b/arm/headerPanel.py
@@ -3,7 +3,7 @@ Top panel for every page, containing basic system and tor related information.
 If there's room available then this expands to present its information in two
 columns, otherwise it's laid out as follows:
   arm - <hostname> (<os> <sys/version>)         Tor <tor/version> (<new, old, recommended, etc>)
-  <nickname> - <address>:<orPort>, [Dir Port: <dirPort>, ]Control Port (<open, password, cookie>): <controlPort>
+  <nickname> - <address>:<or_port>, [Dir Port: <dir_port>, ]Control Port (<open, password, cookie>): <control_port>
   cpu: <cpu%> mem: <mem> (<mem%>) uid: <uid> uptime: <upmin>:<upsec>
   fingerprint: <fingerprint>
 
@@ -32,47 +32,69 @@ from util import panel, torTools, uiTools
 
 # minimum width for which panel attempts to double up contents (two columns to
 # better use screen real estate)
-MIN_DUAL_COL_WIDTH = 141
 
-FLAG_COLORS = {"Authority": "white",  "BadExit": "red",     "BadDirectory": "red",    "Exit": "cyan",
-               "Fast": "yellow",      "Guard": "green",     "HSDir": "magenta",       "Named": "blue",
-               "Stable": "blue",      "Running": "yellow",  "Unnamed": "magenta",     "Valid": "green",
-               "V2Dir": "cyan",       "V3Dir": "white"}
+MIN_DUAL_COL_WIDTH = 141
 
-VERSION_STATUS_COLORS = {"new": "blue", "new in series": "blue", "obsolete": "red", "recommended": "green",
-                         "old": "red",  "unrecommended": "red",  "unknown": "cyan"}
+FLAG_COLORS = {
+  "Authority": "white",
+  "BadExit": "red",
+  "BadDirectory": "red",
+  "Exit": "cyan",
+  "Fast": "yellow",
+  "Guard": "green",
+  "HSDir": "magenta",
+  "Named": "blue",
+  "Stable": "blue",
+  "Running": "yellow",
+  "Unnamed": "magenta",
+  "Valid": "green",
+  "V2Dir": "cyan",
+  "V3Dir": "white",
+}
+
+VERSION_STATUS_COLORS = {
+  "new": "blue",
+  "new in series": "blue",
+  "obsolete": "red",
+  "recommended": "green",
+  "old": "red",
+  "unrecommended": "red",
+  "unknown": "cyan",
+}
 
 CONFIG = conf.config_dict("arm", {
   "features.showFdUsage": False,
 })
 
+
 class HeaderPanel(panel.Panel, threading.Thread):
   """
   Top area contenting tor settings and system information. Stats are stored in
   the vals mapping, keys including:
-    tor/  version, versionStatus, nickname, orPort, dirPort, controlPort,
-          socketPath, exitPolicy, isAuthPassword (bool), isAuthCookie (bool),
-          orListenAddr, *address, *fingerprint, *flags, pid, startTime,
-          *fdUsed, fdLimit, isFdLimitEstimate
+    tor/  version, versionStatus, nickname, or_port, dir_port, control_port,
+          socketPath, exit_policy, isAuthPassword (bool), isAuthCookie (bool),
+          orListenAddr, *address, *fingerprint, *flags, pid, start_time,
+          *fd_used, fd_limit, isFdLimitEstimate
     sys/  hostname, os, version
     stat/ *%torCpu, *%armCpu, *rss, *%mem
 
   * volatile parameter that'll be reset on each update
   """
 
-  def __init__(self, stdscr, startTime):
+  def __init__(self, stdscr, start_time):
     panel.Panel.__init__(self, stdscr, "header", 0)
     threading.Thread.__init__(self)
     self.setDaemon(True)
 
-    self._isTorConnected = torTools.getConn().isAlive()
-    self._lastUpdate = -1       # time the content was last revised
-    self._halt = False          # terminates thread if true
+    self._is_tor_connected = torTools.get_conn().is_alive()
+    self._last_update = -1       # time the content was last revised
+    self._halt = False           # terminates thread if true
     self._cond = threading.Condition()  # used for pausing the thread
 
     # Time when the panel was paused or tor was stopped. This is used to
     # freeze the uptime statistic (uptime increments normally when None).
-    self._haltTime = None
+
+    self._halt_time = None
 
     # The last arm cpu usage sampling taken. This is a tuple of the form:
     # (total arm cpu time, sampling timestamp)
@@ -86,52 +108,61 @@ class HeaderPanel(panel.Panel, threading.Thread):
     # give smoother results (staying in the same ballpark as the second
     # sampling) so fudging the numbers this way for now.
 
-    self._armCpuSampling = (sum(os.times()[:3]), startTime)
+    self._arm_cpu_sampling = (sum(os.times()[:3]), start_time)
 
     # Last sampling received from the ResourceTracker, used to detect when it
     # changes.
-    self._lastResourceFetch = -1
+
+    self._last_resource_fetch = -1
 
     # flag to indicate if we've already given file descriptor warnings
-    self._isFdSixtyPercentWarned = False
-    self._isFdNinetyPercentWarned = False
+
+    self._is_fd_sixty_percent_warned = False
+    self._is_fd_ninety_percent_warned = False
 
     self.vals = {}
-    self.valsLock = threading.RLock()
+    self.vals_lock = threading.RLock()
     self._update(True)
 
     # listens for tor reload (sighup) events
-    torTools.getConn().addStatusListener(self.resetListener)
 
-  def getHeight(self):
+    torTools.get_conn().add_status_listener(self.reset_listener)
+
+  def get_height(self):
     """
     Provides the height of the content, which is dynamically determined by the
     panel's maximum width.
     """
 
-    isWide = self.getParent().getmaxyx()[1] >= MIN_DUAL_COL_WIDTH
-    if self.vals["tor/orPort"]: return 4 if isWide else 6
-    else: return 3 if isWide else 4
+    is_wide = self.get_parent().getmaxyx()[1] >= MIN_DUAL_COL_WIDTH
+
+    if self.vals["tor/or_port"]:
+      return 4 if is_wide else 6
+    else:
+      return 3 if is_wide else 4
 
-  def sendNewnym(self):
+  def send_newnym(self):
     """
     Requests a new identity and provides a visual queue.
     """
 
-    torTools.getConn().sendNewnym()
+    torTools.get_conn().send_newnym()
 
     # If we're wide then the newnym label in this panel will give an
     # indication that the signal was sent. Otherwise use a msg.
-    isWide = self.getParent().getmaxyx()[1] >= MIN_DUAL_COL_WIDTH
-    if not isWide: arm.popups.showMsg("Requesting a new identity", 1)
 
-  def handleKey(self, key):
-    isKeystrokeConsumed = True
+    is_wide = self.get_parent().getmaxyx()[1] >= MIN_DUAL_COL_WIDTH
 
-    if key in (ord('n'), ord('N')) and torTools.getConn().isNewnymAvailable():
-      self.sendNewnym()
-    elif key in (ord('r'), ord('R')) and not self._isTorConnected:
-      #oldSocket = torTools.getConn().getController().get_socket()
+    if not is_wide:
+      arm.popups.show_msg("Requesting a new identity", 1)
+
+  def handle_key(self, key):
+    is_keystroke_consumed = True
+
+    if key in (ord('n'), ord('N')) and torTools.get_conn().is_newnym_available():
+      self.send_newnym()
+    elif key in (ord('r'), ord('R')) and not self._is_tor_connected:
+      #oldSocket = torTools.get_conn().get_controller().get_socket()
       #
       #controller = None
       #allowPortConnection, allowSocketConnection, _ = starter.allowConnectionTypes()
@@ -145,9 +176,9 @@ class HeaderPanel(panel.Panel, threading.Thread):
       #    controller = None
       #
       #    if not allowPortConnection:
-      #      arm.popups.showMsg("Unable to reconnect (%s)" % exc, 3)
+      #      arm.popups.show_msg("Unable to reconnect (%s)" % exc, 3)
       #elif not allowPortConnection:
-      #  arm.popups.showMsg("Unable to reconnect (socket '%s' doesn't exist)" % CONFIG["startup.interface.socket"], 3)
+      #  arm.popups.show_msg("Unable to reconnect (socket '%s' doesn't exist)" % CONFIG["startup.interface.socket"], 3)
       #
       #if not controller and allowPortConnection:
       #  # TODO: This has diverged from starter.py's connection, for instance it
@@ -157,8 +188,8 @@ class HeaderPanel(panel.Panel, threading.Thread):
       #  # manageable.
       #
       #  try:
-      #    ctlAddr, ctlPort = CONFIG["startup.interface.ipAddress"], CONFIG["startup.interface.port"]
-      #    controller = Controller.from_port(ctlAddr, ctlPort)
+      #    ctlAddr, ctl_port = CONFIG["startup.interface.ip_address"], CONFIG["startup.interface.port"]
+      #    controller = Controller.from_port(ctlAddr, ctl_port)
       #
       #    try:
       #      controller.authenticate()
@@ -168,240 +199,287 @@ class HeaderPanel(panel.Panel, threading.Thread):
       #    controller = None
       #
       #if controller:
-      #  torTools.getConn().init(controller)
+      #  torTools.get_conn().init(controller)
       #  log.notice("Reconnected to Tor's control port")
-      #  arm.popups.showMsg("Tor reconnected", 1)
+      #  arm.popups.show_msg("Tor reconnected", 1)
 
       pass
-    else: isKeystrokeConsumed = False
+    else:
+      is_keystroke_consumed = False
 
-    return isKeystrokeConsumed
+    return is_keystroke_consumed
 
   def draw(self, width, height):
-    self.valsLock.acquire()
-    isWide = width + 1 >= MIN_DUAL_COL_WIDTH
+    self.vals_lock.acquire()
+    is_wide = width + 1 >= MIN_DUAL_COL_WIDTH
 
     # space available for content
-    if isWide:
-      leftWidth = max(width / 2, 77)
-      rightWidth = width - leftWidth
-    else: leftWidth = rightWidth = width
+
+    if is_wide:
+      left_width = max(width / 2, 77)
+      right_width = width - left_width
+    else:
+      left_width = right_width = width
 
     # Line 1 / Line 1 Left (system and tor version information)
-    sysNameLabel = "arm - %s" % self.vals["sys/hostname"]
-    contentSpace = min(leftWidth, 40)
 
-    if len(sysNameLabel) + 10 <= contentSpace:
-      sysTypeLabel = "%s %s" % (self.vals["sys/os"], self.vals["sys/version"])
-      sysTypeLabel = uiTools.cropStr(sysTypeLabel, contentSpace - len(sysNameLabel) - 3, 4)
-      self.addstr(0, 0, "%s (%s)" % (sysNameLabel, sysTypeLabel))
+    sys_name_label = "arm - %s" % self.vals["sys/hostname"]
+    content_space = min(left_width, 40)
+
+    if len(sys_name_label) + 10 <= content_space:
+      sys_type_label = "%s %s" % (self.vals["sys/os"], self.vals["sys/version"])
+      sys_type_label = uiTools.crop_str(sys_type_label, content_space - len(sys_name_label) - 3, 4)
+      self.addstr(0, 0, "%s (%s)" % (sys_name_label, sys_type_label))
     else:
-      self.addstr(0, 0, uiTools.cropStr(sysNameLabel, contentSpace))
+      self.addstr(0, 0, uiTools.crop_str(sys_name_label, content_space))
 
-    contentSpace = leftWidth - 43
-    if 7 + len(self.vals["tor/version"]) + len(self.vals["tor/versionStatus"]) <= contentSpace:
+    content_space = left_width - 43
+
+    if 7 + len(self.vals["tor/version"]) + len(self.vals["tor/versionStatus"]) <= content_space:
       if self.vals["tor/version"] != "Unknown":
-        versionColor = VERSION_STATUS_COLORS[self.vals["tor/versionStatus"]] if \
-            self.vals["tor/versionStatus"] in VERSION_STATUS_COLORS else "white"
-        labelPrefix = "Tor %s (" % self.vals["tor/version"]
-        self.addstr(0, 43, labelPrefix)
-        self.addstr(0, 43 + len(labelPrefix), self.vals["tor/versionStatus"], uiTools.getColor(versionColor))
-        self.addstr(0, 43 + len(labelPrefix) + len(self.vals["tor/versionStatus"]), ")")
-    elif 11 <= contentSpace:
-      self.addstr(0, 43, uiTools.cropStr("Tor %s" % self.vals["tor/version"], contentSpace, 4))
+        version_color = VERSION_STATUS_COLORS[self.vals["tor/versionStatus"]] if self.vals["tor/versionStatus"] in VERSION_STATUS_COLORS else "white"
+
+        label_prefix = "Tor %s (" % self.vals["tor/version"]
+        self.addstr(0, 43, label_prefix)
+        self.addstr(0, 43 + len(label_prefix), self.vals["tor/versionStatus"], uiTools.get_color(version_color))
+        self.addstr(0, 43 + len(label_prefix) + len(self.vals["tor/versionStatus"]), ")")
+    elif 11 <= content_space:
+      self.addstr(0, 43, uiTools.crop_str("Tor %s" % self.vals["tor/version"], content_space, 4))
 
     # Line 2 / Line 2 Left (tor ip/port information)
-    x, includeControlPort = 0, True
-    if self.vals["tor/orPort"]:
-      myAddress = "Unknown"
-      if self.vals["tor/orListenAddr"]: myAddress = self.vals["tor/orListenAddr"]
-      elif self.vals["tor/address"]: myAddress = self.vals["tor/address"]
+
+    x, include_control_port = 0, True
+
+    if self.vals["tor/or_port"]:
+      my_address = "Unknown"
+
+      if self.vals["tor/orListenAddr"]:
+        my_address = self.vals["tor/orListenAddr"]
+      elif self.vals["tor/address"]:
+        my_address = self.vals["tor/address"]
 
       # acting as a relay (we can assume certain parameters are set
-      dirPortLabel = ", Dir Port: %s" % self.vals["tor/dirPort"] if self.vals["tor/dirPort"] != "0" else ""
-      for label in (self.vals["tor/nickname"], " - " + myAddress, ":" + self.vals["tor/orPort"], dirPortLabel):
-        if x + len(label) <= leftWidth:
+
+      dir_port_label = ", Dir Port: %s" % self.vals["tor/dir_port"] if self.vals["tor/dir_port"] != "0" else ""
+
+      for label in (self.vals["tor/nickname"], " - " + my_address, ":" + self.vals["tor/or_port"], dir_port_label):
+        if x + len(label) <= left_width:
           self.addstr(1, x, label)
           x += len(label)
-        else: break
+        else:
+          break
     else:
       # non-relay (client only)
-      if self._isTorConnected:
-        self.addstr(1, x, "Relaying Disabled", uiTools.getColor("cyan"))
+
+      if self._is_tor_connected:
+        self.addstr(1, x, "Relaying Disabled", uiTools.get_color("cyan"))
         x += 17
       else:
-        statusTime = torTools.getConn().controller.get_latest_heartbeat()
+        status_time = torTools.get_conn().controller.get_latest_heartbeat()
 
-        if statusTime:
-          statusTimeLabel = time.strftime("%H:%M %m/%d/%Y, ", time.localtime(statusTime))
-        else: statusTimeLabel = "" # never connected to tor
+        if status_time:
+          status_time_label = time.strftime("%H:%M %m/%d/%Y, ", time.localtime(status_time))
+        else:
+          status_time_label = ""  # never connected to tor
 
-        self.addstr(1, x, "Tor Disconnected", curses.A_BOLD | uiTools.getColor("red"))
-        self.addstr(1, x + 16, " (%spress r to reconnect)" % statusTimeLabel)
-        x += 39 + len(statusTimeLabel)
-        includeControlPort = False
+        self.addstr(1, x, "Tor Disconnected", curses.A_BOLD | uiTools.get_color("red"))
+        self.addstr(1, x + 16, " (%spress r to reconnect)" % status_time_label)
+        x += 39 + len(status_time_label)
+        include_control_port = False
 
-    if includeControlPort:
-      if self.vals["tor/controlPort"] == "0":
+    if include_control_port:
+      if self.vals["tor/control_port"] == "0":
         # connected via a control socket
         self.addstr(1, x, ", Control Socket: %s" % self.vals["tor/socketPath"])
       else:
-        if self.vals["tor/isAuthPassword"]: authType = "password"
-        elif self.vals["tor/isAuthCookie"]: authType = "cookie"
-        else: authType = "open"
+        if self.vals["tor/isAuthPassword"]:
+          auth_type = "password"
+        elif self.vals["tor/isAuthCookie"]:
+          auth_type = "cookie"
+        else:
+          auth_type = "open"
 
-        if x + 19 + len(self.vals["tor/controlPort"]) + len(authType) <= leftWidth:
-          authColor = "red" if authType == "open" else "green"
+        if x + 19 + len(self.vals["tor/control_port"]) + len(auth_type) <= left_width:
+          auth_color = "red" if auth_type == "open" else "green"
           self.addstr(1, x, ", Control Port (")
-          self.addstr(1, x + 16, authType, uiTools.getColor(authColor))
-          self.addstr(1, x + 16 + len(authType), "): %s" % self.vals["tor/controlPort"])
-        elif x + 16 + len(self.vals["tor/controlPort"]) <= leftWidth:
-          self.addstr(1, 0, ", Control Port: %s" % self.vals["tor/controlPort"])
+          self.addstr(1, x + 16, auth_type, uiTools.get_color(auth_color))
+          self.addstr(1, x + 16 + len(auth_type), "): %s" % self.vals["tor/control_port"])
+        elif x + 16 + len(self.vals["tor/control_port"]) <= left_width:
+          self.addstr(1, 0, ", Control Port: %s" % self.vals["tor/control_port"])
 
     # Line 3 / Line 1 Right (system usage info)
-    y, x = (0, leftWidth) if isWide else (2, 0)
-    if self.vals["stat/rss"] != "0": memoryLabel = str_tools.get_size_label(int(self.vals["stat/rss"]))
-    else: memoryLabel = "0"
 
-    uptimeLabel = ""
-    if self.vals["tor/startTime"]:
-      if self.isPaused() or not self._isTorConnected:
+    y, x = (0, left_width) if is_wide else (2, 0)
+
+    if self.vals["stat/rss"] != "0":
+      memory_label = str_tools.get_size_label(int(self.vals["stat/rss"]))
+    else:
+      memory_label = "0"
+
+    uptime_label = ""
+
+    if self.vals["tor/start_time"]:
+      if self.is_paused() or not self._is_tor_connected:
         # freeze the uptime when paused or the tor process is stopped
-        uptimeLabel = str_tools.get_short_time_label(self.getPauseTime() - self.vals["tor/startTime"])
+        uptime_label = str_tools.get_short_time_label(self.get_pause_time() - self.vals["tor/start_time"])
       else:
-        uptimeLabel = str_tools.get_short_time_label(time.time() - self.vals["tor/startTime"])
+        uptime_label = str_tools.get_short_time_label(time.time() - self.vals["tor/start_time"])
 
-    sysFields = ((0, "cpu: %s%% tor, %s%% arm" % (self.vals["stat/%torCpu"], self.vals["stat/%armCpu"])),
-                 (27, "mem: %s (%s%%)" % (memoryLabel, self.vals["stat/%mem"])),
-                 (47, "pid: %s" % (self.vals["tor/pid"] if self._isTorConnected else "")),
-                 (59, "uptime: %s" % uptimeLabel))
+    sys_fields = ((0, "cpu: %s%% tor, %s%% arm" % (self.vals["stat/%torCpu"], self.vals["stat/%armCpu"])),
+                  (27, "mem: %s (%s%%)" % (memory_label, self.vals["stat/%mem"])),
+                  (47, "pid: %s" % (self.vals["tor/pid"] if self._is_tor_connected else "")),
+                  (59, "uptime: %s" % uptime_label))
 
-    for (start, label) in sysFields:
-      if start + len(label) <= rightWidth: self.addstr(y, x + start, label)
-      else: break
+    for (start, label) in sys_fields:
+      if start + len(label) <= right_width:
+        self.addstr(y, x + start, label)
+      else:
+        break
 
-    if self.vals["tor/orPort"]:
+    if self.vals["tor/or_port"]:
       # Line 4 / Line 2 Right (fingerprint, and possibly file descriptor usage)
-      y, x = (1, leftWidth) if isWide else (3, 0)
 
-      fingerprintLabel = uiTools.cropStr("fingerprint: %s" % self.vals["tor/fingerprint"], width)
-      self.addstr(y, x, fingerprintLabel)
+      y, x = (1, left_width) if is_wide else (3, 0)
+
+      fingerprint_label = uiTools.crop_str("fingerprint: %s" % self.vals["tor/fingerprint"], width)
+      self.addstr(y, x, fingerprint_label)
 
       # if there's room and we're able to retrieve both the file descriptor
       # usage and limit then it might be presented
-      if width - x - 59 >= 20 and self.vals["tor/fdUsed"] and self.vals["tor/fdLimit"]:
+
+      if width - x - 59 >= 20 and self.vals["tor/fd_used"] and self.vals["tor/fd_limit"]:
         # display file descriptor usage if we're either configured to do so or
         # running out
 
-        fdPercent = 100 * self.vals["tor/fdUsed"] / self.vals["tor/fdLimit"]
+        fd_percent = 100 * self.vals["tor/fd_used"] / self.vals["tor/fd_limit"]
 
-        if fdPercent >= 60 or CONFIG["features.showFdUsage"]:
-          fdPercentLabel, fdPercentFormat = "%i%%" % fdPercent, curses.A_NORMAL
-          if fdPercent >= 95:
-            fdPercentFormat = curses.A_BOLD | uiTools.getColor("red")
-          elif fdPercent >= 90:
-            fdPercentFormat = uiTools.getColor("red")
-          elif fdPercent >= 60:
-            fdPercentFormat = uiTools.getColor("yellow")
+        if fd_percent >= 60 or CONFIG["features.showFdUsage"]:
+          fd_percentLabel, fd_percent_format = "%i%%" % fd_percent, curses.A_NORMAL
 
-          estimateChar = "?" if self.vals["tor/isFdLimitEstimate"] else ""
-          baseLabel = "file desc: %i / %i%s (" % (self.vals["tor/fdUsed"], self.vals["tor/fdLimit"], estimateChar)
+          if fd_percent >= 95:
+            fd_percent_format = curses.A_BOLD | uiTools.get_color("red")
+          elif fd_percent >= 90:
+            fd_percent_format = uiTools.get_color("red")
+          elif fd_percent >= 60:
+            fd_percent_format = uiTools.get_color("yellow")
 
-          self.addstr(y, x + 59, baseLabel)
-          self.addstr(y, x + 59 + len(baseLabel), fdPercentLabel, fdPercentFormat)
-          self.addstr(y, x + 59 + len(baseLabel) + len(fdPercentLabel), ")")
+          estimate_char = "?" if self.vals["tor/isFdLimitEstimate"] else ""
+          base_label = "file desc: %i / %i%s (" % (self.vals["tor/fd_used"], self.vals["tor/fd_limit"], estimate_char)
+
+          self.addstr(y, x + 59, base_label)
+          self.addstr(y, x + 59 + len(base_label), fd_percentLabel, fd_percent_format)
+          self.addstr(y, x + 59 + len(base_label) + len(fd_percentLabel), ")")
 
       # Line 5 / Line 3 Left (flags)
-      if self._isTorConnected:
-        y, x = (2 if isWide else 4, 0)
+
+      if self._is_tor_connected:
+        y, x = (2 if is_wide else 4, 0)
         self.addstr(y, x, "flags: ")
         x += 7
 
         if len(self.vals["tor/flags"]) > 0:
           for i in range(len(self.vals["tor/flags"])):
             flag = self.vals["tor/flags"][i]
-            flagColor = FLAG_COLORS[flag] if flag in FLAG_COLORS.keys() else "white"
+            flag_color = FLAG_COLORS[flag] if flag in FLAG_COLORS.keys() else "white"
 
-            self.addstr(y, x, flag, curses.A_BOLD | uiTools.getColor(flagColor))
+            self.addstr(y, x, flag, curses.A_BOLD | uiTools.get_color(flag_color))
             x += len(flag)
 
             if i < len(self.vals["tor/flags"]) - 1:
               self.addstr(y, x, ", ")
               x += 2
         else:
-          self.addstr(y, x, "none", curses.A_BOLD | uiTools.getColor("cyan"))
+          self.addstr(y, x, "none", curses.A_BOLD | uiTools.get_color("cyan"))
       else:
-        y = 2 if isWide else 4
-        statusTime = torTools.getConn().controller.get_latest_heartbeat()
-        statusTimeLabel = time.strftime("%H:%M %m/%d/%Y", time.localtime(statusTime))
-        self.addstr(y, 0, "Tor Disconnected", curses.A_BOLD | uiTools.getColor("red"))
-        self.addstr(y, 16, " (%s) - press r to reconnect" % statusTimeLabel)
+        y = 2 if is_wide else 4
+        status_time = torTools.get_conn().controller.get_latest_heartbeat()
+        status_time_label = time.strftime("%H:%M %m/%d/%Y", time.localtime(status_time))
+        self.addstr(y, 0, "Tor Disconnected", curses.A_BOLD | uiTools.get_color("red"))
+        self.addstr(y, 16, " (%s) - press r to reconnect" % status_time_label)
 
       # Undisplayed / Line 3 Right (exit policy)
-      if isWide:
-        exitPolicy = self.vals["tor/exitPolicy"]
+
+      if is_wide:
+        exit_policy = self.vals["tor/exit_policy"]
 
         # adds note when default exit policy is appended
-        if exitPolicy == "": exitPolicy = "<default>"
-        elif not exitPolicy.endswith((" *:*", " *")): exitPolicy += ", <default>"
 
-        self.addstr(2, leftWidth, "exit policy: ")
-        x = leftWidth + 13
+        if exit_policy == "":
+          exit_policy = "<default>"
+        elif not exit_policy.endswith((" *:*", " *")):
+          exit_policy += ", <default>"
+
+        self.addstr(2, left_width, "exit policy: ")
+        x = left_width + 13
 
         # color codes accepts to be green, rejects to be red, and default marker to be cyan
-        isSimple = len(exitPolicy) > rightWidth - 13
-        policies = exitPolicy.split(", ")
+
+        is_simple = len(exit_policy) > right_width - 13
+        policies = exit_policy.split(", ")
+
         for i in range(len(policies)):
           policy = policies[i].strip()
-          policyLabel = policy.replace("accept", "").replace("reject", "").strip() if isSimple else policy
+          policy_label = policy.replace("accept", "").replace("reject", "").strip() if is_simple else policy
+
+          policy_color = "white"
 
-          policyColor = "white"
-          if policy.startswith("accept"): policyColor = "green"
-          elif policy.startswith("reject"): policyColor = "red"
-          elif policy.startswith("<default>"): policyColor = "cyan"
+          if policy.startswith("accept"):
+            policy_color = "green"
+          elif policy.startswith("reject"):
+            policy_color = "red"
+          elif policy.startswith("<default>"):
+            policy_color = "cyan"
 
-          self.addstr(2, x, policyLabel, curses.A_BOLD | uiTools.getColor(policyColor))
-          x += len(policyLabel)
+          self.addstr(2, x, policy_label, curses.A_BOLD | uiTools.get_color(policy_color))
+          x += len(policy_label)
 
           if i < len(policies) - 1:
             self.addstr(2, x, ", ")
             x += 2
     else:
       # (Client only) Undisplayed / Line 2 Right (new identity option)
-      if isWide:
-        conn = torTools.getConn()
-        newnymWait = conn.getNewnymWait()
+
+      if is_wide:
+        conn = torTools.get_conn()
+        newnym_wait = conn.get_newnym_wait()
 
         msg = "press 'n' for a new identity"
-        if newnymWait > 0:
-          pluralLabel = "s" if newnymWait > 1 else ""
-          msg = "building circuits, available again in %i second%s" % (newnymWait, pluralLabel)
 
-        self.addstr(1, leftWidth, msg)
+        if newnym_wait > 0:
+          plural_label = "s" if newnym_wait > 1 else ""
+          msg = "building circuits, available again in %i second%s" % (newnym_wait, plural_label)
+
+        self.addstr(1, left_width, msg)
 
-    self.valsLock.release()
+    self.vals_lock.release()
 
-  def getPauseTime(self):
+  def get_pause_time(self):
     """
     Provides the time Tor stopped if it isn't running. Otherwise this is the
     time we were last paused.
     """
 
-    if self._haltTime: return self._haltTime
-    else: return panel.Panel.getPauseTime(self)
+    if self._halt_time:
+      return self._halt_time
+    else:
+      return panel.Panel.get_pause_time(self)
 
   def run(self):
     """
     Keeps stats updated, checking for new information at a set rate.
     """
 
-    lastDraw = time.time() - 1
+    last_draw = time.time() - 1
+
     while not self._halt:
-      currentTime = time.time()
+      current_time = time.time()
 
-      if self.isPaused() or currentTime - lastDraw < 1 or not self._isTorConnected:
+      if self.is_paused() or current_time - last_draw < 1 or not self._is_tor_connected:
         self._cond.acquire()
-        if not self._halt: self._cond.wait(0.2)
+
+        if not self._halt:
+          self._cond.wait(0.2)
+
         self._cond.release()
       else:
         # Update the volatile attributes (cpu, memory, flags, etc) if we have
@@ -411,16 +489,17 @@ class HeaderPanel(panel.Panel, threading.Thread):
         #
         # Otherwise, just redraw the panel to change the uptime field.
 
-        isChanged = False
+        is_changed = False
+
         if self.vals["tor/pid"]:
-          resourceTracker = arm.util.tracker.get_resource_tracker()
-          isChanged = self._lastResourceFetch != resourceTracker.run_counter()
+          resource_tracker = arm.util.tracker.get_resource_tracker()
+          is_changed = self._last_resource_fetch != resource_tracker.run_counter()
 
-        if isChanged or currentTime - self._lastUpdate >= 20:
+        if is_changed or current_time - self._last_update >= 20:
           self._update()
 
         self.redraw(True)
-        lastDraw += 1
+        last_draw += 1
 
   def stop(self):
     """
@@ -432,97 +511,109 @@ class HeaderPanel(panel.Panel, threading.Thread):
     self._cond.notifyAll()
     self._cond.release()
 
-  def resetListener(self, controller, eventType, _):
+  def reset_listener(self, controller, event_type, _):
     """
     Updates static parameters on tor reload (sighup) events.
     """
 
-    if eventType in (State.INIT, State.RESET):
-      initialHeight = self.getHeight()
-      self._isTorConnected = True
-      self._haltTime = None
+    if event_type in (State.INIT, State.RESET):
+      initial_height = self.get_height()
+      self._is_tor_connected = True
+      self._halt_time = None
       self._update(True)
 
-      if self.getHeight() != initialHeight:
+      if self.get_height() != initial_height:
         # We're toggling between being a relay and client, causing the height
         # of this panel to change. Redraw all content so we don't get
         # overlapping content.
-        arm.controller.getController().redraw()
+
+        arm.controller.get_controller().redraw()
       else:
         # just need to redraw ourselves
         self.redraw(True)
-    elif eventType == State.CLOSED:
-      self._isTorConnected = False
-      self._haltTime = time.time()
+    elif event_type == State.CLOSED:
+      self._is_tor_connected = False
+      self._halt_time = time.time()
       self._update()
       self.redraw(True)
 
-  def _update(self, setStatic=False):
+  def _update(self, set_static=False):
     """
     Updates stats in the vals mapping. By default this just revises volatile
     attributes.
 
     Arguments:
-      setStatic - resets all parameters, including relatively static values
+      set_static - resets all parameters, including relatively static values
     """
 
-    self.valsLock.acquire()
-    conn = torTools.getConn()
+    self.vals_lock.acquire()
+    conn = torTools.get_conn()
 
-    if setStatic:
+    if set_static:
       # version is truncated to first part, for instance:
       # 0.2.2.13-alpha (git-feb8c1b5f67f2c6f) -> 0.2.2.13-alpha
-      self.vals["tor/version"] = conn.getInfo("version", "Unknown").split()[0]
-      self.vals["tor/versionStatus"] = conn.getInfo("status/version/current", "Unknown")
-      self.vals["tor/nickname"] = conn.getOption("Nickname", "")
-      self.vals["tor/orPort"] = conn.getOption("ORPort", "0")
-      self.vals["tor/dirPort"] = conn.getOption("DirPort", "0")
-      self.vals["tor/controlPort"] = conn.getOption("ControlPort", "0")
-      self.vals["tor/socketPath"] = conn.getOption("ControlSocket", "")
-      self.vals["tor/isAuthPassword"] = conn.getOption("HashedControlPassword", None) != None
-      self.vals["tor/isAuthCookie"] = conn.getOption("CookieAuthentication", None) == "1"
+
+      self.vals["tor/version"] = conn.get_info("version", "Unknown").split()[0]
+      self.vals["tor/versionStatus"] = conn.get_info("status/version/current", "Unknown")
+      self.vals["tor/nickname"] = conn.get_option("Nickname", "")
+      self.vals["tor/or_port"] = conn.get_option("ORPort", "0")
+      self.vals["tor/dir_port"] = conn.get_option("DirPort", "0")
+      self.vals["tor/control_port"] = conn.get_option("ControlPort", "0")
+      self.vals["tor/socketPath"] = conn.get_option("ControlSocket", "")
+      self.vals["tor/isAuthPassword"] = conn.get_option("HashedControlPassword", None) is not None
+      self.vals["tor/isAuthCookie"] = conn.get_option("CookieAuthentication", None) == "1"
 
       # orport is reported as zero if unset
-      if self.vals["tor/orPort"] == "0": self.vals["tor/orPort"] = ""
 
-      # overwrite address if ORListenAddress is set (and possibly orPort too)
+      if self.vals["tor/or_port"] == "0":
+        self.vals["tor/or_port"] = ""
+
+      # overwrite address if ORListenAddress is set (and possibly or_port too)
+
       self.vals["tor/orListenAddr"] = ""
-      listenAddr = conn.getOption("ORListenAddress", None)
-      if listenAddr:
-        if ":" in listenAddr:
+      listen_addr = conn.get_option("ORListenAddress", None)
+
+      if listen_addr:
+        if ":" in listen_addr:
           # both ip and port overwritten
-          self.vals["tor/orListenAddr"] = listenAddr[:listenAddr.find(":")]
-          self.vals["tor/orPort"] = listenAddr[listenAddr.find(":") + 1:]
+          self.vals["tor/orListenAddr"] = listen_addr[:listen_addr.find(":")]
+          self.vals["tor/or_port"] = listen_addr[listen_addr.find(":") + 1:]
         else:
-          self.vals["tor/orListenAddr"] = listenAddr
+          self.vals["tor/orListenAddr"] = listen_addr
 
       # fetch exit policy (might span over multiple lines)
-      policyEntries = []
-      for exitPolicy in conn.getOption("ExitPolicy", [], True):
-        policyEntries += [policy.strip() for policy in exitPolicy.split(",")]
-      self.vals["tor/exitPolicy"] = ", ".join(policyEntries)
+
+      policy_entries = []
+
+      for exit_policy in conn.get_option("ExitPolicy", [], True):
+        policy_entries += [policy.strip() for policy in exit_policy.split(",")]
+
+      self.vals["tor/exit_policy"] = ", ".join(policy_entries)
 
       # file descriptor limit for the process, if this can't be determined
       # then the limit is None
-      fdLimit, fdIsEstimate = conn.getMyFileDescriptorLimit()
-      self.vals["tor/fdLimit"] = fdLimit
-      self.vals["tor/isFdLimitEstimate"] = fdIsEstimate
+
+      fd_limit, fd_is_estimate = conn.get_my_file_descriptor_limit()
+      self.vals["tor/fd_limit"] = fd_limit
+      self.vals["tor/isFdLimitEstimate"] = fd_is_estimate
 
       # system information
-      unameVals = os.uname()
-      self.vals["sys/hostname"] = unameVals[1]
-      self.vals["sys/os"] = unameVals[0]
-      self.vals["sys/version"] = unameVals[2]
+
+      uname_vals = os.uname()
+      self.vals["sys/hostname"] = uname_vals[1]
+      self.vals["sys/os"] = uname_vals[0]
+      self.vals["sys/version"] = uname_vals[2]
 
       self.vals["tor/pid"] = conn.controller.get_pid("")
 
-      startTime = conn.getStartTime()
-      self.vals["tor/startTime"] = startTime if startTime else ""
+      start_time = conn.get_start_time()
+      self.vals["tor/start_time"] = start_time if start_time else ""
 
       # reverts volatile parameters to defaults
+
       self.vals["tor/fingerprint"] = "Unknown"
       self.vals["tor/flags"] = []
-      self.vals["tor/fdUsed"] = 0
+      self.vals["tor/fd_used"] = 0
       self.vals["stat/%torCpu"] = "0"
       self.vals["stat/%armCpu"] = "0"
       self.vals["stat/rss"] = "0"
@@ -531,38 +622,44 @@ class HeaderPanel(panel.Panel, threading.Thread):
     # sets volatile parameters
     # TODO: This can change, being reported by STATUS_SERVER -> EXTERNAL_ADDRESS
     # events. Introduce caching via torTools?
-    self.vals["tor/address"] = conn.getInfo("address", "")
 
-    self.vals["tor/fingerprint"] = conn.getInfo("fingerprint", self.vals["tor/fingerprint"])
-    self.vals["tor/flags"] = conn.getMyFlags(self.vals["tor/flags"])
+    self.vals["tor/address"] = conn.get_info("address", "")
+
+    self.vals["tor/fingerprint"] = conn.get_info("fingerprint", self.vals["tor/fingerprint"])
+    self.vals["tor/flags"] = conn.get_my_flags(self.vals["tor/flags"])
 
     # Updates file descriptor usage and logs if the usage is high. If we don't
     # have a known limit or it's obviously faulty (being lower than our
     # current usage) then omit file descriptor functionality.
-    if self.vals["tor/fdLimit"]:
-      fdUsed = conn.getMyFileDescriptorUsage()
-      if fdUsed and fdUsed <= self.vals["tor/fdLimit"]: self.vals["tor/fdUsed"] = fdUsed
-      else: self.vals["tor/fdUsed"] = 0
-
-    if self.vals["tor/fdUsed"] and self.vals["tor/fdLimit"]:
-      fdPercent = 100 * self.vals["tor/fdUsed"] / self.vals["tor/fdLimit"]
-      estimatedLabel = " estimated" if self.vals["tor/isFdLimitEstimate"] else ""
-      msg = "Tor's%s file descriptor usage is at %i%%." % (estimatedLabel, fdPercent)
-
-      if fdPercent >= 90 and not self._isFdNinetyPercentWarned:
-        self._isFdSixtyPercentWarned, self._isFdNinetyPercentWarned = True, True
+
+    if self.vals["tor/fd_limit"]:
+      fd_used = conn.get_my_file_descriptor_usage()
+
+      if fd_used and fd_used <= self.vals["tor/fd_limit"]:
+        self.vals["tor/fd_used"] = fd_used
+      else:
+        self.vals["tor/fd_used"] = 0
+
+    if self.vals["tor/fd_used"] and self.vals["tor/fd_limit"]:
+      fd_percent = 100 * self.vals["tor/fd_used"] / self.vals["tor/fd_limit"]
+      estimated_label = " estimated" if self.vals["tor/isFdLimitEstimate"] else ""
+      msg = "Tor's%s file descriptor usage is at %i%%." % (estimated_label, fd_percent)
+
+      if fd_percent >= 90 and not self._is_fd_ninety_percent_warned:
+        self._is_fd_sixty_percent_warned, self._is_fd_ninety_percent_warned = True, True
         msg += " If you run out Tor will be unable to continue functioning."
         log.warn(msg)
-      elif fdPercent >= 60 and not self._isFdSixtyPercentWarned:
-        self._isFdSixtyPercentWarned = True
+      elif fd_percent >= 60 and not self._is_fd_sixty_percent_warned:
+        self._is_fd_sixty_percent_warned = True
         log.notice(msg)
 
     # ps or proc derived resource usage stats
+
     if self.vals["tor/pid"]:
-      resourceTracker = arm.util.tracker.get_resource_tracker()
+      resource_tracker = arm.util.tracker.get_resource_tracker()
 
-      resources = resourceTracker.get_resource_usage()
-      self._lastResourceFetch = resourceTracker.run_counter()
+      resources = resource_tracker.get_resource_usage()
+      self._last_resource_fetch = resource_tracker.run_counter()
       self.vals["stat/%torCpu"] = "%0.1f" % (100 * resources.cpu_sample)
       self.vals["stat/rss"] = str(resources.memory_bytes)
       self.vals["stat/%mem"] = "%0.1f" % (100 * resources.memory_percent)
@@ -570,14 +667,13 @@ class HeaderPanel(panel.Panel, threading.Thread):
     # determines the cpu time for the arm process (including user and system
     # time of both the primary and child processes)
 
-    totalArmCpuTime, currentTime = sum(os.times()[:3]), time.time()
-    armCpuDelta = totalArmCpuTime - self._armCpuSampling[0]
-    armTimeDelta = currentTime - self._armCpuSampling[1]
-    pythonCpuTime = armCpuDelta / armTimeDelta
-    sysCallCpuTime = 0.0  # TODO: add a wrapper around call() to get this
-    self.vals["stat/%armCpu"] = "%0.1f" % (100 * (pythonCpuTime + sysCallCpuTime))
-    self._armCpuSampling = (totalArmCpuTime, currentTime)
-
-    self._lastUpdate = currentTime
-    self.valsLock.release()
+    total_arm_cpu_time, current_time = sum(os.times()[:3]), time.time()
+    arm_cpu_telta = total_arm_cpu_time - self._arm_cpu_sampling[0]
+    arm_time_delta = current_time - self._arm_cpu_sampling[1]
+    python_cpu_time = arm_cpu_telta / arm_time_delta
+    sys_call_cpu_time = 0.0  # TODO: add a wrapper around call() to get this
+    self.vals["stat/%armCpu"] = "%0.1f" % (100 * (python_cpu_time + sys_call_cpu_time))
+    self._arm_cpu_sampling = (total_arm_cpu_time, current_time)
 
+    self._last_update = current_time
+    self.vals_lock.release()
diff --git a/arm/logPanel.py b/arm/logPanel.py
index 16c1464..894322b 100644
--- a/arm/logPanel.py
+++ b/arm/logPanel.py
@@ -21,34 +21,42 @@ import arm.popups
 from arm import __version__
 from arm.util import panel, torTools, uiTools
 
-RUNLEVEL_EVENT_COLOR = {log.DEBUG: "magenta", log.INFO: "blue", log.NOTICE: "green",
-                        log.WARN: "yellow", log.ERR: "red"}
-DAYBREAK_EVENT = "DAYBREAK" # special event for marking when the date changes
+RUNLEVEL_EVENT_COLOR = {
+  log.DEBUG: "magenta",
+  log.INFO: "blue",
+  log.NOTICE: "green",
+  log.WARN: "yellow",
+  log.ERR: "red",
+}
+
+DAYBREAK_EVENT = "DAYBREAK"  # special event for marking when the date changes
 TIMEZONE_OFFSET = time.altzone if time.localtime()[8] else time.timezone
 
-ENTRY_INDENT = 2 # spaces an entry's message is indented after the first line
+ENTRY_INDENT = 2  # spaces an entry's message is indented after the first line
+
 
 def conf_handler(key, value):
-  if key == "features.log.maxLinesPerEntry":
+  if key == "features.log.max_lines_per_entry":
     return max(1, value)
   elif key == "features.log.prepopulateReadLimit":
     return max(0, value)
   elif key == "features.log.maxRefreshRate":
     return max(10, value)
-  elif key == "cache.logPanel.size":
+  elif key == "cache.log_panel.size":
     return max(1000, value)
 
+
 CONFIG = conf.config_dict("arm", {
-  "features.logFile": "",
+  "features.log_file": "",
   "features.log.showDateDividers": True,
   "features.log.showDuplicateEntries": False,
   "features.log.entryDuration": 7,
-  "features.log.maxLinesPerEntry": 6,
+  "features.log.max_lines_per_entry": 6,
   "features.log.prepopulate": True,
   "features.log.prepopulateReadLimit": 5000,
   "features.log.maxRefreshRate": 300,
   "features.log.regex": [],
-  "cache.logPanel.size": 1000,
+  "cache.log_panel.size": 1000,
   "msg.misc.event_types": '',
   "tor.chroot": '',
 }, conf_handler)
@@ -59,26 +67,32 @@ DUPLICATE_MSG = " [%i duplicate%s hidden]"
 # the panel. It's chiefly used for scrolling and the bar indicating its
 # position. Letting the estimate be too inaccurate results in a display bug, so
 # redraws the display if it's off by this threshold.
+
 CONTENT_HEIGHT_REDRAW_THRESHOLD = 3
 
 # static starting portion of common log entries, fetched from the config when
 # needed if None
+
 COMMON_LOG_MESSAGES = None
 
-# cached values and the arguments that generated it for the getDaybreaks and
-# getDuplicates functions
-CACHED_DAYBREAKS_ARGUMENTS = (None, None) # events, current day
+# cached values and the arguments that generated it for the get_daybreaks and
+# get_duplicates functions
+
+CACHED_DAYBREAKS_ARGUMENTS = (None, None)  # events, current day
 CACHED_DAYBREAKS_RESULT = None
-CACHED_DUPLICATES_ARGUMENTS = None # events
+CACHED_DUPLICATES_ARGUMENTS = None  # events
 CACHED_DUPLICATES_RESULT = None
 
 # duration we'll wait for the deduplication function before giving up (in ms)
+
 DEDUPLICATION_TIMEOUT = 100
 
 # maximum number of regex filters we'll remember
+
 MAX_REGEX_FILTERS = 5
 
-def daysSince(timestamp=None):
+
+def days_since(timestamp = None):
   """
   Provides the number of days since the epoch converted to local time (rounded
   down).
@@ -87,25 +101,30 @@ def daysSince(timestamp=None):
     timestamp - unix timestamp to convert, current time if undefined
   """
 
-  if timestamp == None: timestamp = time.time()
+  if timestamp is None:
+    timestamp = time.time()
+
   return int((timestamp - TIMEZONE_OFFSET) / 86400)
 
-def loadLogMessages():
+
+def load_log_messages():
   """
   Fetches a mapping of common log messages to their runlevels from the config.
   """
 
   global COMMON_LOG_MESSAGES
-  armConf = conf.get_config("arm")
+  arm_config = conf.get_config("arm")
 
   COMMON_LOG_MESSAGES = {}
-  for confKey in armConf.keys():
-    if confKey.startswith("dedup."):
-      eventType = confKey[4:].upper()
-      messages = armConf.get(confKey, [])
-      COMMON_LOG_MESSAGES[eventType] = messages
 
-def getLogFileEntries(runlevels, readLimit = None, addLimit = None):
+  for conf_key in arm_config.keys():
+    if conf_key.startswith("dedup."):
+      event_type = conf_key[4:].upper()
+      messages = arm_config.get(conf_key, [])
+      COMMON_LOG_MESSAGES[event_type] = messages
+
+
+def get_log_file_entries(runlevels, read_limit = None, add_limit = None):
   """
   Parses tor's log file for past events matching the given runlevels, providing
   a list of log entries (ordered newest to oldest). Limiting the number of read
@@ -114,89 +133,112 @@ def getLogFileEntries(runlevels, readLimit = None, addLimit = None):
 
   Arguments:
     runlevels - event types (DEBUG - ERR) to be returned
-    readLimit - max lines of the log file that'll be read (unlimited if None)
-    addLimit  - maximum entries to provide back (unlimited if None)
+    read_limit - max lines of the log file that'll be read (unlimited if None)
+    add_limit  - maximum entries to provide back (unlimited if None)
   """
 
-  startTime = time.time()
-  if not runlevels: return []
+  start_time = time.time()
+
+  if not runlevels:
+    return []
 
   # checks tor's configuration for the log file's location (if any exists)
-  loggingTypes, loggingLocation = None, None
-  for loggingEntry in torTools.getConn().getOption("Log", [], True):
+
+  logging_types, logging_location = None, None
+
+  for logging_entry in torTools.get_conn().get_option("Log", [], True):
     # looks for an entry like: notice file /var/log/tor/notices.log
-    entryComp = loggingEntry.split()
 
-    if entryComp[1] == "file":
-      loggingTypes, loggingLocation = entryComp[0], entryComp[2]
+    entry_comp = logging_entry.split()
+
+    if entry_comp[1] == "file":
+      logging_types, logging_location = entry_comp[0], entry_comp[2]
       break
 
-  if not loggingLocation: return []
+  if not logging_location:
+    return []
 
   # includes the prefix for tor paths
-  loggingLocation = CONFIG['tor.chroot'] + loggingLocation
+
+  logging_location = CONFIG['tor.chroot'] + logging_location
 
   # if the runlevels argument is a superset of the log file then we can
-  # limit the read contents to the addLimit
+  # limit the read contents to the add_limit
+
   runlevels = list(log.Runlevel)
-  loggingTypes = loggingTypes.upper()
-  if addLimit and (not readLimit or readLimit > addLimit):
-    if "-" in loggingTypes:
-      divIndex = loggingTypes.find("-")
-      sIndex = runlevels.index(loggingTypes[:divIndex])
-      eIndex = runlevels.index(loggingTypes[divIndex+1:])
-      logFileRunlevels = runlevels[sIndex:eIndex+1]
+  logging_types = logging_types.upper()
+
+  if add_limit and (not read_limit or read_limit > add_limit):
+    if "-" in logging_types:
+      div_index = logging_types.find("-")
+      start_index = runlevels.index(logging_types[:div_index])
+      end_index = runlevels.index(logging_types[div_index + 1:])
+      log_file_run_levels = runlevels[start_index:end_index + 1]
     else:
-      sIndex = runlevels.index(loggingTypes)
-      logFileRunlevels = runlevels[sIndex:]
+      start_index = runlevels.index(logging_types)
+      log_file_run_levels = runlevels[start_index:]
 
     # checks if runlevels we're reporting are a superset of the file's contents
-    isFileSubset = True
-    for runlevelType in logFileRunlevels:
-      if runlevelType not in runlevels:
-        isFileSubset = False
+
+    is_file_subset = True
+
+    for runlevel_type in log_file_run_levels:
+      if runlevel_type not in runlevels:
+        is_file_subset = False
         break
 
-    if isFileSubset: readLimit = addLimit
+    if is_file_subset:
+      read_limit = add_limit
 
   # tries opening the log file, cropping results to avoid choking on huge logs
+
   lines = []
+
   try:
-    if readLimit:
-      lines = system.call("tail -n %i %s" % (readLimit, loggingLocation))
-      if not lines: raise IOError()
+    if read_limit:
+      lines = system.call("tail -n %i %s" % (read_limit, logging_location))
+
+      if not lines:
+        raise IOError()
     else:
-      logFile = open(loggingLocation, "r")
-      lines = logFile.readlines()
-      logFile.close()
+      log_file = open(logging_location, "r")
+      lines = log_file.readlines()
+      log_file.close()
   except IOError:
-    log.warn("Unable to read tor's log file: %s" % loggingLocation)
+    log.warn("Unable to read tor's log file: %s" % logging_location)
+
+  if not lines:
+    return []
 
-  if not lines: return []
+  logged_events = []
+  current_unix_time, current_local_time = time.time(), time.localtime()
 
-  loggedEvents = []
-  currentUnixTime, currentLocalTime = time.time(), time.localtime()
   for i in range(len(lines) - 1, -1, -1):
     line = lines[i]
 
     # entries look like:
     # Jul 15 18:29:48.806 [notice] Parsing GEOIP file.
-    lineComp = line.split()
+
+    line_comp = line.split()
 
     # Checks that we have all the components we expect. This could happen if
     # we're either not parsing a tor log or in weird edge cases (like being
     # out of disk space)
 
-    if len(lineComp) < 4: continue
+    if len(line_comp) < 4:
+      continue
 
-    eventType = lineComp[3][1:-1].upper()
+    event_type = line_comp[3][1:-1].upper()
 
-    if eventType in runlevels:
+    if event_type in runlevels:
       # converts timestamp to unix time
-      timestamp = " ".join(lineComp[:3])
+
+      timestamp = " ".join(line_comp[:3])
 
       # strips the decimal seconds
-      if "." in timestamp: timestamp = timestamp[:timestamp.find(".")]
+
+      if "." in timestamp:
+        timestamp = timestamp[:timestamp.find(".")]
 
       # Ignoring wday and yday since they aren't used.
       #
@@ -208,27 +250,32 @@ def getLogFileEntries(runlevels, readLimit = None, addLimit = None):
       # https://trac.torproject.org/projects/tor/ticket/5265
 
       timestamp = "2012 " + timestamp
-      eventTimeComp = list(time.strptime(timestamp, "%Y %b %d %H:%M:%S"))
-      eventTimeComp[8] = currentLocalTime.tm_isdst
-      eventTime = time.mktime(eventTimeComp) # converts local to unix time
+      event_time_comp = list(time.strptime(timestamp, "%Y %b %d %H:%M:%S"))
+      event_time_comp[8] = current_local_time.tm_isdst
+      event_time = time.mktime(event_time_comp)  # converts local to unix time
 
       # The above is gonna be wrong if the logs are for the previous year. If
       # the event's in the future then correct for this.
-      if eventTime > currentUnixTime + 60:
-        eventTimeComp[0] -= 1
-        eventTime = time.mktime(eventTimeComp)
 
-      eventMsg = " ".join(lineComp[4:])
-      loggedEvents.append(LogEntry(eventTime, eventType, eventMsg, RUNLEVEL_EVENT_COLOR[eventType]))
+      if event_time > current_unix_time + 60:
+        event_time_comp[0] -= 1
+        event_time = time.mktime(event_time_comp)
+
+      event_msg = " ".join(line_comp[4:])
+      logged_events.append(LogEntry(event_time, event_type, event_msg, RUNLEVEL_EVENT_COLOR[event_type]))
 
     if "opening log file" in line:
-      break # this entry marks the start of this tor instance
+      break  # this entry marks the start of this tor instance
 
-  if addLimit: loggedEvents = loggedEvents[:addLimit]
-  log.info("Read %i entries from tor's log file: %s (read limit: %i, runtime: %0.3f)" % (len(loggedEvents), loggingLocation, readLimit, time.time() - startTime))
-  return loggedEvents
+  if add_limit:
+    logged_events = logged_events[:add_limit]
 
-def getDaybreaks(events, ignoreTimeForCache = False):
+  log.info("Read %i entries from tor's log file: %s (read limit: %i, runtime: %0.3f)" % (len(logged_events), logging_location, read_limit, time.time() - start_time))
+
+  return logged_events
+
+
+def get_daybreaks(events, ignore_time_for_cache = False):
   """
   Provides the input events back with special 'DAYBREAK_EVENT' markers inserted
   whenever the date changed between log entries (or since the most recent
@@ -237,36 +284,40 @@ def getDaybreaks(events, ignoreTimeForCache = False):
 
   Arguments:
     events             - chronologically ordered listing of events
-    ignoreTimeForCache - skips taking the day into consideration for providing
+    ignore_time_for_cache - skips taking the day into consideration for providing
                          cached results if true
   """
 
   global CACHED_DAYBREAKS_ARGUMENTS, CACHED_DAYBREAKS_RESULT
-  if not events: return []
 
-  newListing = []
-  currentDay = daysSince()
-  lastDay = currentDay
+  if not events:
+    return []
+
+  new_listing = []
+  current_day = days_since()
+  last_day = current_day
 
   if CACHED_DAYBREAKS_ARGUMENTS[0] == events and \
-    (ignoreTimeForCache or CACHED_DAYBREAKS_ARGUMENTS[1] == currentDay):
+    (ignore_time_for_cache or CACHED_DAYBREAKS_ARGUMENTS[1] == current_day):
     return list(CACHED_DAYBREAKS_RESULT)
 
   for entry in events:
-    eventDay = daysSince(entry.timestamp)
-    if eventDay != lastDay:
-      markerTimestamp = (eventDay * 86400) + TIMEZONE_OFFSET
-      newListing.append(LogEntry(markerTimestamp, DAYBREAK_EVENT, "", "white"))
+    event_day = days_since(entry.timestamp)
+
+    if event_day != last_day:
+      marker_timestamp = (event_day * 86400) + TIMEZONE_OFFSET
+      new_listing.append(LogEntry(marker_timestamp, DAYBREAK_EVENT, "", "white"))
 
-    newListing.append(entry)
-    lastDay = eventDay
+    new_listing.append(entry)
+    last_day = event_day
 
-  CACHED_DAYBREAKS_ARGUMENTS = (list(events), currentDay)
-  CACHED_DAYBREAKS_RESULT = list(newListing)
+  CACHED_DAYBREAKS_ARGUMENTS = (list(events), current_day)
+  CACHED_DAYBREAKS_RESULT = list(new_listing)
 
-  return newListing
+  return new_listing
 
-def getDuplicates(events):
+
+def get_duplicates(events):
   """
   Deduplicates a list of log entries, providing back a tuple listing with the
   log entry and count of duplicates following it. Entries in different days are
@@ -278,112 +329,133 @@ def getDuplicates(events):
   """
 
   global CACHED_DUPLICATES_ARGUMENTS, CACHED_DUPLICATES_RESULT
+
   if CACHED_DUPLICATES_ARGUMENTS == events:
     return list(CACHED_DUPLICATES_RESULT)
 
   # loads common log entries from the config if they haven't been
-  if COMMON_LOG_MESSAGES == None: loadLogMessages()
 
-  startTime = time.time()
-  eventsRemaining = list(events)
-  returnEvents = []
+  if COMMON_LOG_MESSAGES is None:
+    load_log_messages()
 
-  while eventsRemaining:
-    entry = eventsRemaining.pop(0)
-    duplicateIndices = isDuplicate(entry, eventsRemaining, True)
+  start_time = time.time()
+  events_remaining = list(events)
+  return_events = []
+
+  while events_remaining:
+    entry = events_remaining.pop(0)
+    duplicate_indices = is_duplicate(entry, events_remaining, True)
 
     # checks if the call timeout has been reached
-    if (time.time() - startTime) > DEDUPLICATION_TIMEOUT / 1000.0:
+
+    if (time.time() - start_time) > DEDUPLICATION_TIMEOUT / 1000.0:
       return None
 
     # drops duplicate entries
-    duplicateIndices.reverse()
-    for i in duplicateIndices: del eventsRemaining[i]
 
-    returnEvents.append((entry, len(duplicateIndices)))
+    duplicate_indices.reverse()
+
+    for i in duplicate_indices:
+      del events_remaining[i]
+
+    return_events.append((entry, len(duplicate_indices)))
 
   CACHED_DUPLICATES_ARGUMENTS = list(events)
-  CACHED_DUPLICATES_RESULT = list(returnEvents)
+  CACHED_DUPLICATES_RESULT = list(return_events)
+
+  return return_events
 
-  return returnEvents
 
-def isDuplicate(event, eventSet, getDuplicates = False):
+def is_duplicate(event, event_set, get_duplicates = False):
   """
-  True if the event is a duplicate for something in the eventSet, false
-  otherwise. If the getDuplicates flag is set this provides the indices of
+  True if the event is a duplicate for something in the event_set, false
+  otherwise. If the get_duplicates flag is set this provides the indices of
   the duplicates instead.
 
   Arguments:
     event         - event to search for duplicates of
-    eventSet      - set to look for the event in
-    getDuplicates - instead of providing back a boolean this gives a list of
-                    the duplicate indices in the eventSet
+    event_set      - set to look for the event in
+    get_duplicates - instead of providing back a boolean this gives a list of
+                    the duplicate indices in the event_set
   """
 
-  duplicateIndices = []
-  for i in range(len(eventSet)):
-    forwardEntry = eventSet[i]
+  duplicate_indices = []
+
+  for i in range(len(event_set)):
+    forward_entry = event_set[i]
 
     # if showing dates then do duplicate detection for each day, rather
     # than globally
-    if forwardEntry.type == DAYBREAK_EVENT: break
 
-    if event.type == forwardEntry.type:
-      isDuplicate = False
-      if event.msg == forwardEntry.msg: isDuplicate = True
+    if forward_entry.type == DAYBREAK_EVENT:
+      break
+
+    if event.type == forward_entry.type:
+      is_duplicate = False
+
+      if event.msg == forward_entry.msg:
+        is_duplicate = True
       elif event.type in COMMON_LOG_MESSAGES:
-        for commonMsg in COMMON_LOG_MESSAGES[event.type]:
+        for common_msg in COMMON_LOG_MESSAGES[event.type]:
           # if it starts with an asterisk then check the whole message rather
           # than just the start
-          if commonMsg[0] == "*":
-            isDuplicate = commonMsg[1:] in event.msg and commonMsg[1:] in forwardEntry.msg
+
+          if common_msg[0] == "*":
+            is_duplicate = common_msg[1:] in event.msg and common_msg[1:] in forward_entry.msg
           else:
-            isDuplicate = event.msg.startswith(commonMsg) and forwardEntry.msg.startswith(commonMsg)
+            is_duplicate = event.msg.startswith(common_msg) and forward_entry.msg.startswith(common_msg)
 
-          if isDuplicate: break
+          if is_duplicate:
+            break
 
-      if isDuplicate:
-        if getDuplicates: duplicateIndices.append(i)
-        else: return True
+      if is_duplicate:
+        if get_duplicates:
+          duplicate_indices.append(i)
+        else:
+          return True
+
+  if get_duplicates:
+    return duplicate_indices
+  else:
+    return False
 
-  if getDuplicates: return duplicateIndices
-  else: return False
 
 class LogEntry():
   """
   Individual log file entry, having the following attributes:
     timestamp - unix timestamp for when the event occurred
-    eventType - event type that occurred ("INFO", "BW", "ARM_WARN", etc)
+    event_type - event type that occurred ("INFO", "BW", "ARM_WARN", etc)
     msg       - message that was logged
     color     - color of the log entry
   """
 
-  def __init__(self, timestamp, eventType, msg, color):
+  def __init__(self, timestamp, event_type, msg, color):
     self.timestamp = timestamp
-    self.type = eventType
+    self.type = event_type
     self.msg = msg
     self.color = color
-    self._displayMessage = None
+    self._display_message = None
 
-  def getDisplayMessage(self, includeDate = False):
+  def get_display_message(self, include_date = False):
     """
     Provides the entry's message for the log.
 
     Arguments:
-      includeDate - appends the event's date to the start of the message
+      include_date - appends the event's date to the start of the message
     """
 
-    if includeDate:
+    if include_date:
       # not the common case so skip caching
-      entryTime = time.localtime(self.timestamp)
-      timeLabel =  "%i/%i/%i %02i:%02i:%02i" % (entryTime[1], entryTime[2], entryTime[0], entryTime[3], entryTime[4], entryTime[5])
-      return "%s [%s] %s" % (timeLabel, self.type, self.msg)
+      entry_time = time.localtime(self.timestamp)
+      time_label = "%i/%i/%i %02i:%02i:%02i" % (entry_time[1], entry_time[2], entry_time[0], entry_time[3], entry_time[4], entry_time[5])
+      return "%s [%s] %s" % (time_label, self.type, self.msg)
+
+    if not self._display_message:
+      entry_time = time.localtime(self.timestamp)
+      self._display_message = "%02i:%02i:%02i [%s] %s" % (entry_time[3], entry_time[4], entry_time[5], self.type, self.msg)
 
-    if not self._displayMessage:
-      entryTime = time.localtime(self.timestamp)
-      self._displayMessage = "%02i:%02i:%02i [%s] %s" % (entryTime[3], entryTime[4], entryTime[5], self.type, self.msg)
+    return self._display_message
 
-    return self._displayMessage
 
 class LogPanel(panel.Panel, threading.Thread, logging.Handler):
   """
@@ -391,7 +463,7 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
   from tor's log file if it exists.
   """
 
-  def __init__(self, stdscr, loggedEvents):
+  def __init__(self, stdscr, logged_events):
     panel.Panel.__init__(self, stdscr, "log", 0)
     logging.Handler.__init__(self, level = log.logging_level(log.DEBUG))
 
@@ -406,77 +478,91 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
     # Make sure that the msg.* messages are loaded. Lazy loading it later is
     # fine, but this way we're sure it happens before warning about unused
     # config options.
-    loadLogMessages()
+
+    load_log_messages()
 
     # regex filters the user has defined
-    self.filterOptions = []
+
+    self.filter_options = []
 
     for filter in CONFIG["features.log.regex"]:
       # checks if we can't have more filters
-      if len(self.filterOptions) >= MAX_REGEX_FILTERS: break
+
+      if len(self.filter_options) >= MAX_REGEX_FILTERS:
+        break
 
       try:
         re.compile(filter)
-        self.filterOptions.append(filter)
-      except re.error, exc:
+        self.filter_options.append(filter)
+      except re.error as exc:
         log.notice("Invalid regular expression pattern (%s): %s" % (exc, filter))
 
-    self.loggedEvents = [] # needs to be set before we receive any events
+    self.logged_events = []  # needs to be set before we receive any events
 
     # restricts the input to the set of events we can listen to, and
     # configures the controller to liten to them
-    self.loggedEvents = self.setEventListening(loggedEvents)
 
-    self.setPauseAttr("msgLog")         # tracks the message log when we're paused
-    self.msgLog = []                    # log entries, sorted by the timestamp
-    self.regexFilter = None             # filter for presented log events (no filtering if None)
-    self.lastContentHeight = 0          # height of the rendered content when last drawn
-    self.logFile = None                 # file log messages are saved to (skipped if None)
+    self.logged_events = self.set_event_listening(logged_events)
+
+    self.set_pause_attr("msg_log")       # tracks the message log when we're paused
+    self.msg_log = []                    # log entries, sorted by the timestamp
+    self.regex_filter = None             # filter for presented log events (no filtering if None)
+    self.last_content_height = 0         # height of the rendered content when last drawn
+    self.log_file = None                 # file log messages are saved to (skipped if None)
     self.scroll = 0
 
-    self._lastUpdate = -1               # time the content was last revised
-    self._halt = False                  # terminates thread if true
-    self._cond = threading.Condition()  # used for pausing/resuming the thread
+    self._last_update = -1               # time the content was last revised
+    self._halt = False                   # terminates thread if true
+    self._cond = threading.Condition()   # used for pausing/resuming the thread
 
     # restricts concurrent write access to attributes used to draw the display
     # and pausing:
-    # msgLog, loggedEvents, regexFilter, scroll
-    self.valsLock = threading.RLock()
+    # msg_log, logged_events, regex_filter, scroll
+
+    self.vals_lock = threading.RLock()
 
     # cached parameters (invalidated if arguments for them change)
     # last set of events we've drawn with
-    self._lastLoggedEvents = []
 
-    # _getTitle (args: loggedEvents, regexFilter pattern, width)
-    self._titleCache = None
-    self._titleArgs = (None, None, None)
+    self._last_logged_events = []
+
+    # _get_title (args: logged_events, regex_filter pattern, width)
+
+    self._title_cache = None
+    self._title_args = (None, None, None)
+
+    self.reprepopulate_events()
 
-    self.reprepopulateEvents()
+    # leaving last_content_height as being too low causes initialization problems
 
-    # leaving lastContentHeight as being too low causes initialization problems
-    self.lastContentHeight = len(self.msgLog)
+    self.last_content_height = len(self.msg_log)
 
     # adds listeners for tor and stem events
-    conn = torTools.getConn()
-    conn.addStatusListener(self._resetListener)
+
+    conn = torTools.get_conn()
+    conn.add_status_listener(self._reset_listener)
 
     # opens log file if we'll be saving entries
-    if CONFIG["features.logFile"]:
-      logPath = CONFIG["features.logFile"]
+
+    if CONFIG["features.log_file"]:
+      log_path = CONFIG["features.log_file"]
 
       try:
         # make dir if the path doesn't already exist
-        baseDir = os.path.dirname(logPath)
-        if not os.path.exists(baseDir): os.makedirs(baseDir)
 
-        self.logFile = open(logPath, "a")
-        log.notice("arm %s opening log file (%s)" % (__version__, logPath))
-      except IOError, exc:
+        base_dir = os.path.dirname(log_path)
+
+        if not os.path.exists(base_dir):
+          os.makedirs(base_dir)
+
+        self.log_file = open(log_path, "a")
+        log.notice("arm %s opening log file (%s)" % (__version__, log_path))
+      except IOError as exc:
         log.error("Unable to write to log file: %s" % exc.strerror)
-        self.logFile = None
-      except OSError, exc:
+        self.log_file = None
+      except OSError as exc:
         log.error("Unable to write to log file: %s" % exc)
-        self.logFile = None
+        self.log_file = None
 
     stem_logger = log.get_logger()
     stem_logger.addHandler(self)
@@ -485,48 +571,52 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
     if record.levelname == "WARNING":
       record.levelname = "WARN"
 
-    eventColor = RUNLEVEL_EVENT_COLOR[record.levelname]
-    self.registerEvent(LogEntry(int(record.created), "ARM_%s" % record.levelname, record.msg, eventColor))
+    event_color = RUNLEVEL_EVENT_COLOR[record.levelname]
+    self.register_event(LogEntry(int(record.created), "ARM_%s" % record.levelname, record.msg, event_color))
 
-  def reprepopulateEvents(self):
+  def reprepopulate_events(self):
     """
     Clears the event log and repopulates it from the arm and tor backlogs.
     """
 
-    self.valsLock.acquire()
+    self.vals_lock.acquire()
 
     # clears the event log
-    self.msgLog = []
+
+    self.msg_log = []
 
     # fetches past tor events from log file, if available
+
     if CONFIG["features.log.prepopulate"]:
-      setRunlevels = list(set.intersection(set(self.loggedEvents), set(list(log.Runlevel))))
-      readLimit = CONFIG["features.log.prepopulateReadLimit"]
-      addLimit = CONFIG["cache.logPanel.size"]
-      for entry in getLogFileEntries(setRunlevels, readLimit, addLimit):
-        self.msgLog.append(entry)
+      set_runlevels = list(set.intersection(set(self.logged_events), set(list(log.Runlevel))))
+      read_limit = CONFIG["features.log.prepopulateReadLimit"]
+      add_limit = CONFIG["cache.log_panel.size"]
+
+      for entry in get_log_file_entries(set_runlevels, read_limit, add_limit):
+        self.msg_log.append(entry)
 
     # crops events that are either too old, or more numerous than the caching size
-    self._trimEvents(self.msgLog)
 
-    self.valsLock.release()
+    self._trim_events(self.msg_log)
 
-  def setDuplicateVisability(self, isVisible):
+    self.vals_lock.release()
+
+  def set_duplicate_visability(self, is_visible):
     """
     Sets if duplicate log entries are collaped or expanded.
 
     Arguments:
-      isVisible - if true all log entries are shown, otherwise they're
-                  deduplicated
+      is_visible - if true all log entries are shown, otherwise they're
+                   deduplicated
     """
 
-    armConf = conf.get_config("arm")
-    armConf.set("features.log.showDuplicateEntries", str(isVisible))
+    arm_config = conf.get_config("arm")
+    arm_config.set("features.log.showDuplicateEntries", str(is_visible))
 
-  def registerTorEvent(self, event):
+  def register_tor_event(self, event):
     """
     Translates a stem.response.event.Event instance into a LogEvent, and calls
-    registerEvent().
+    register_event().
     """
 
     msg, color = ' '.join(str(event).split(' ')[1:]), "white"
@@ -546,11 +636,11 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
     elif isinstance(event, events.GuardEvent):
       color = "yellow"
     elif not event.type in arm.arguments.TOR_EVENT_TYPES.values():
-      color = "red" # unknown event type
+      color = "red"  # unknown event type
 
-    self.registerEvent(LogEntry(event.arrived_at, event.type, msg, color))
+    self.register_event(LogEntry(event.arrived_at, event.type, msg, color))
 
-  def registerEvent(self, event):
+  def register_event(self, event):
     """
     Notes event and redraws log. If paused it's held in a temporary buffer.
 
@@ -558,164 +648,184 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
       event - LogEntry for the event that occurred
     """
 
-    if not event.type in self.loggedEvents: return
+    if not event.type in self.logged_events:
+      return
 
     # strips control characters to avoid screwing up the terminal
-    event.msg = uiTools.getPrintable(event.msg)
+
+    event.msg = uiTools.get_printable(event.msg)
 
     # note event in the log file if we're saving them
-    if self.logFile:
+
+    if self.log_file:
       try:
-        self.logFile.write(event.getDisplayMessage(True) + "\n")
-        self.logFile.flush()
-      except IOError, exc:
+        self.log_file.write(event.get_display_message(True) + "\n")
+        self.log_file.flush()
+      except IOError as exc:
         log.error("Unable to write to log file: %s" % exc.strerror)
-        self.logFile = None
+        self.log_file = None
 
-    self.valsLock.acquire()
-    self.msgLog.insert(0, event)
-    self._trimEvents(self.msgLog)
+    self.vals_lock.acquire()
+    self.msg_log.insert(0, event)
+    self._trim_events(self.msg_log)
 
     # notifies the display that it has new content
-    if not self.regexFilter or self.regexFilter.search(event.getDisplayMessage()):
+
+    if not self.regex_filter or self.regex_filter.search(event.get_display_message()):
       self._cond.acquire()
       self._cond.notifyAll()
       self._cond.release()
 
-    self.valsLock.release()
+    self.vals_lock.release()
 
-  def setLoggedEvents(self, eventTypes):
+  def set_logged_events(self, event_types):
     """
     Sets the event types recognized by the panel.
 
     Arguments:
-      eventTypes - event types to be logged
+      event_types - event types to be logged
     """
 
-    if eventTypes == self.loggedEvents: return
-    self.valsLock.acquire()
+    if event_types == self.logged_events:
+      return
+
+    self.vals_lock.acquire()
 
     # configures the controller to listen for these tor events, and provides
     # back a subset without anything we're failing to listen to
-    setTypes = self.setEventListening(eventTypes)
-    self.loggedEvents = setTypes
+
+    set_types = self.set_event_listening(event_types)
+    self.logged_events = set_types
     self.redraw(True)
-    self.valsLock.release()
+    self.vals_lock.release()
 
-  def getFilter(self):
+  def get_filter(self):
     """
     Provides our currently selected regex filter.
     """
 
-    return self.filterOptions[0] if self.regexFilter else None
+    return self.filter_options[0] if self.regex_filter else None
 
-  def setFilter(self, logFilter):
+  def set_filter(self, log_filter):
     """
     Filters log entries according to the given regular expression.
 
     Arguments:
-      logFilter - regular expression used to determine which messages are
+      log_filter - regular expression used to determine which messages are
                   shown, None if no filter should be applied
     """
 
-    if logFilter == self.regexFilter: return
+    if log_filter == self.regex_filter:
+      return
 
-    self.valsLock.acquire()
-    self.regexFilter = logFilter
+    self.vals_lock.acquire()
+    self.regex_filter = log_filter
     self.redraw(True)
-    self.valsLock.release()
+    self.vals_lock.release()
 
-  def makeFilterSelection(self, selectedOption):
+  def make_filter_selection(self, selected_option):
     """
     Makes the given filter selection, applying it to the log and reorganizing
     our filter selection.
 
     Arguments:
-      selectedOption - regex filter we've already added, None if no filter
+      selected_option - regex filter we've already added, None if no filter
                        should be applied
     """
 
-    if selectedOption:
+    if selected_option:
       try:
-        self.setFilter(re.compile(selectedOption))
+        self.set_filter(re.compile(selected_option))
 
         # move selection to top
-        self.filterOptions.remove(selectedOption)
-        self.filterOptions.insert(0, selectedOption)
-      except re.error, exc:
+
+        self.filter_options.remove(selected_option)
+        self.filter_options.insert(0, selected_option)
+      except re.error as exc:
         # shouldn't happen since we've already checked validity
-        log.warn("Invalid regular expression ('%s': %s) - removing from listing" % (selectedOption, exc))
-        self.filterOptions.remove(selectedOption)
-    else: self.setFilter(None)
 
-  def showFilterPrompt(self):
+        log.warn("Invalid regular expression ('%s': %s) - removing from listing" % (selected_option, exc))
+        self.filter_options.remove(selected_option)
+    else:
+      self.set_filter(None)
+
+  def show_filter_prompt(self):
     """
     Prompts the user to add a new regex filter.
     """
 
-    regexInput = arm.popups.inputPrompt("Regular expression: ")
+    regex_input = arm.popups.input_prompt("Regular expression: ")
 
-    if regexInput:
+    if regex_input:
       try:
-        self.setFilter(re.compile(regexInput))
-        if regexInput in self.filterOptions: self.filterOptions.remove(regexInput)
-        self.filterOptions.insert(0, regexInput)
-      except re.error, exc:
-        arm.popups.showMsg("Unable to compile expression: %s" % exc, 2)
+        self.set_filter(re.compile(regex_input))
+
+        if regex_input in self.filter_options:
+          self.filter_options.remove(regex_input)
+
+        self.filter_options.insert(0, regex_input)
+      except re.error as exc:
+        arm.popups.show_msg("Unable to compile expression: %s" % exc, 2)
 
-  def showEventSelectionPrompt(self):
+  def show_event_selection_prompt(self):
     """
     Prompts the user to select the events being listened for.
     """
 
     # allow user to enter new types of events to log - unchanged if left blank
+
     popup, width, height = arm.popups.init(11, 80)
 
     if popup:
       try:
         # displays the available flags
+
         popup.win.box()
         popup.addstr(0, 0, "Event Types:", curses.A_STANDOUT)
-        eventLines = CONFIG['msg.misc.event_types'].split("\n")
+        event_lines = CONFIG['msg.misc.event_types'].split("\n")
 
-        for i in range(len(eventLines)):
-          popup.addstr(i + 1, 1, eventLines[i][6:])
+        for i in range(len(event_lines)):
+          popup.addstr(i + 1, 1, event_lines[i][6:])
 
         popup.win.refresh()
 
-        userInput = arm.popups.inputPrompt("Events to log: ")
-        if userInput:
-          userInput = userInput.replace(' ', '') # strips spaces
-          try: self.setLoggedEvents(arm.arguments.expand_events(userInput))
-          except ValueError, exc:
-            arm.popups.showMsg("Invalid flags: %s" % str(exc), 2)
-      finally: arm.popups.finalize()
+        user_input = arm.popups.input_prompt("Events to log: ")
+
+        if user_input:
+          user_input = user_input.replace(' ', '')  # strips spaces
+
+          try:
+            self.set_logged_events(arm.arguments.expand_events(user_input))
+          except ValueError as exc:
+            arm.popups.show_msg("Invalid flags: %s" % str(exc), 2)
+      finally:
+        arm.popups.finalize()
 
-  def showSnapshotPrompt(self):
+  def show_snapshot_prompt(self):
     """
     Lets user enter a path to take a snapshot, canceling if left blank.
     """
 
-    pathInput = arm.popups.inputPrompt("Path to save log snapshot: ")
+    path_input = arm.popups.input_prompt("Path to save log snapshot: ")
 
-    if pathInput:
+    if path_input:
       try:
-        self.saveSnapshot(pathInput)
-        arm.popups.showMsg("Saved: %s" % pathInput, 2)
-      except IOError, exc:
-        arm.popups.showMsg("Unable to save snapshot: %s" % exc.strerror, 2)
+        self.save_snapshot(path_input)
+        arm.popups.show_msg("Saved: %s" % path_input, 2)
+      except IOError as exc:
+        arm.popups.show_msg("Unable to save snapshot: %s" % exc.strerror, 2)
 
   def clear(self):
     """
     Clears the contents of the event log.
     """
 
-    self.valsLock.acquire()
-    self.msgLog = []
+    self.vals_lock.acquire()
+    self.msg_log = []
     self.redraw(True)
-    self.valsLock.release()
+    self.vals_lock.release()
 
-  def saveSnapshot(self, path):
+  def save_snapshot(self, path):
     """
     Saves the log events currently being displayed to the given path. This
     takes filers into account. This overwrites the file if it already exists,
@@ -728,84 +838,98 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
     path = os.path.abspath(os.path.expanduser(path))
 
     # make dir if the path doesn't already exist
-    baseDir = os.path.dirname(path)
+
+    base_dir = os.path.dirname(path)
 
     try:
-      if not os.path.exists(baseDir): os.makedirs(baseDir)
-    except OSError, exc:
-      raise IOError("unable to make directory '%s'" % baseDir)
+      if not os.path.exists(base_dir):
+        os.makedirs(base_dir)
+    except OSError as exc:
+      raise IOError("unable to make directory '%s'" % base_dir)
+
+    snapshot_file = open(path, "w")
+    self.vals_lock.acquire()
 
-    snapshotFile = open(path, "w")
-    self.valsLock.acquire()
     try:
-      for entry in self.msgLog:
-        isVisible = not self.regexFilter or self.regexFilter.search(entry.getDisplayMessage())
-        if isVisible: snapshotFile.write(entry.getDisplayMessage(True) + "\n")
+      for entry in self.msg_log:
+        is_visible = not self.regex_filter or self.regex_filter.search(entry.get_display_message())
+
+        if is_visible:
+          snapshot_file.write(entry.get_display_message(True) + "\n")
 
-      self.valsLock.release()
-    except Exception, exc:
-      self.valsLock.release()
+      self.vals_lock.release()
+    except Exception as exc:
+      self.vals_lock.release()
       raise exc
 
-  def handleKey(self, key):
-    isKeystrokeConsumed = True
-    if uiTools.isScrollKey(key):
-      pageHeight = self.getPreferredSize()[0] - 1
-      newScroll = uiTools.getScrollPosition(key, self.scroll, pageHeight, self.lastContentHeight)
+  def handle_key(self, key):
+    is_keystroke_consumed = True
 
-      if self.scroll != newScroll:
-        self.valsLock.acquire()
-        self.scroll = newScroll
+    if uiTools.is_scroll_key(key):
+      page_height = self.get_preferred_size()[0] - 1
+      new_scroll = uiTools.get_scroll_position(key, self.scroll, page_height, self.last_content_height)
+
+      if self.scroll != new_scroll:
+        self.vals_lock.acquire()
+        self.scroll = new_scroll
         self.redraw(True)
-        self.valsLock.release()
+        self.vals_lock.release()
     elif key in (ord('u'), ord('U')):
-      self.valsLock.acquire()
-      self.setDuplicateVisability(not CONFIG["features.log.showDuplicateEntries"])
+      self.vals_lock.acquire()
+      self.set_duplicate_visability(not CONFIG["features.log.showDuplicateEntries"])
       self.redraw(True)
-      self.valsLock.release()
+      self.vals_lock.release()
     elif key == ord('c') or key == ord('C'):
       msg = "This will clear the log. Are you sure (c again to confirm)?"
-      keyPress = arm.popups.showMsg(msg, attr = curses.A_BOLD)
-      if keyPress in (ord('c'), ord('C')): self.clear()
+      key_press = arm.popups.show_msg(msg, attr = curses.A_BOLD)
+
+      if key_press in (ord('c'), ord('C')):
+        self.clear()
     elif key == ord('f') or key == ord('F'):
       # Provides menu to pick regular expression filters or adding new ones:
       # for syntax see: http://docs.python.org/library/re.html#regular-expression-syntax
-      options = ["None"] + self.filterOptions + ["New..."]
-      oldSelection = 0 if not self.regexFilter else 1
+
+      options = ["None"] + self.filter_options + ["New..."]
+      old_selection = 0 if not self.regex_filter else 1
 
       # does all activity under a curses lock to prevent redraws when adding
       # new filters
+
       panel.CURSES_LOCK.acquire()
+
       try:
-        selection = arm.popups.showMenu("Log Filter:", options, oldSelection)
+        selection = arm.popups.show_menu("Log Filter:", options, old_selection)
 
         # applies new setting
+
         if selection == 0:
-          self.setFilter(None)
+          self.set_filter(None)
         elif selection == len(options) - 1:
           # selected 'New...' option - prompt user to input regular expression
-          self.showFilterPrompt()
+          self.show_filter_prompt()
         elif selection != -1:
-          self.makeFilterSelection(self.filterOptions[selection - 1])
+          self.make_filter_selection(self.filter_options[selection - 1])
       finally:
         panel.CURSES_LOCK.release()
 
-      if len(self.filterOptions) > MAX_REGEX_FILTERS: del self.filterOptions[MAX_REGEX_FILTERS:]
+      if len(self.filter_options) > MAX_REGEX_FILTERS:
+        del self.filter_options[MAX_REGEX_FILTERS:]
     elif key == ord('e') or key == ord('E'):
-      self.showEventSelectionPrompt()
+      self.show_event_selection_prompt()
     elif key == ord('a') or key == ord('A'):
-      self.showSnapshotPrompt()
-    else: isKeystrokeConsumed = False
+      self.show_snapshot_prompt()
+    else:
+      is_keystroke_consumed = False
 
-    return isKeystrokeConsumed
+    return is_keystroke_consumed
 
-  def getHelp(self):
+  def get_help(self):
     options = []
     options.append(("up arrow", "scroll log up a line", None))
     options.append(("down arrow", "scroll log down a line", None))
     options.append(("a", "save snapshot of the log", None))
     options.append(("e", "change logged events", None))
-    options.append(("f", "log regex filter", "enabled" if self.regexFilter else "disabled"))
+    options.append(("f", "log regex filter", "enabled" if self.regex_filter else "disabled"))
     options.append(("u", "duplicate log entries", "visible" if CONFIG["features.log.showDuplicateEntries"] else "hidden"))
     options.append(("c", "clear event log", None))
     return options
@@ -816,158 +940,179 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
     contain up to two lines. Starts with newest entries.
     """
 
-    currentLog = self.getAttr("msgLog")
+    current_log = self.get_attr("msg_log")
 
-    self.valsLock.acquire()
-    self._lastLoggedEvents, self._lastUpdate = list(currentLog), time.time()
+    self.vals_lock.acquire()
+    self._last_logged_events, self._last_update = list(current_log), time.time()
 
     # draws the top label
-    if self.isTitleVisible():
-      self.addstr(0, 0, self._getTitle(width), curses.A_STANDOUT)
+
+    if self.is_title_visible():
+      self.addstr(0, 0, self._get_title(width), curses.A_STANDOUT)
 
     # restricts scroll location to valid bounds
-    self.scroll = max(0, min(self.scroll, self.lastContentHeight - height + 1))
+
+    self.scroll = max(0, min(self.scroll, self.last_content_height - height + 1))
 
     # draws left-hand scroll bar if content's longer than the height
-    msgIndent, dividerIndent = 1, 0 # offsets for scroll bar
-    isScrollBarVisible = self.lastContentHeight > height - 1
-    if isScrollBarVisible:
-      msgIndent, dividerIndent = 3, 2
-      self.addScrollBar(self.scroll, self.scroll + height - 1, self.lastContentHeight, 1)
+
+    msg_indent, divider_indent = 1, 0  # offsets for scroll bar
+    is_scroll_bar_visible = self.last_content_height > height - 1
+
+    if is_scroll_bar_visible:
+      msg_indent, divider_indent = 3, 2
+      self.add_scroll_bar(self.scroll, self.scroll + height - 1, self.last_content_height, 1)
 
     # draws log entries
-    lineCount = 1 - self.scroll
-    seenFirstDateDivider = False
-    dividerAttr, duplicateAttr = curses.A_BOLD | uiTools.getColor("yellow"), curses.A_BOLD | uiTools.getColor("green")
 
-    isDatesShown = self.regexFilter == None and CONFIG["features.log.showDateDividers"]
-    eventLog = getDaybreaks(currentLog, self.isPaused()) if isDatesShown else list(currentLog)
+    line_count = 1 - self.scroll
+    seen_first_date_divider = False
+    divider_attr, duplicate_attr = curses.A_BOLD | uiTools.get_color("yellow"), curses.A_BOLD | uiTools.get_color("green")
+
+    is_dates_shown = self.regex_filter is None and CONFIG["features.log.showDateDividers"]
+    event_log = get_daybreaks(current_log, self.is_paused()) if is_dates_shown else list(current_log)
+
     if not CONFIG["features.log.showDuplicateEntries"]:
-      deduplicatedLog = getDuplicates(eventLog)
+      deduplicated_log = get_duplicates(event_log)
 
-      if deduplicatedLog == None:
+      if deduplicated_log is None:
         log.warn("Deduplication took too long. Its current implementation has difficulty handling large logs so disabling it to keep the interface responsive.")
-        self.setDuplicateVisability(True)
-        deduplicatedLog = [(entry, 0) for entry in eventLog]
-    else: deduplicatedLog = [(entry, 0) for entry in eventLog]
+        self.set_duplicate_visability(True)
+        deduplicated_log = [(entry, 0) for entry in event_log]
+    else:
+      deduplicated_log = [(entry, 0) for entry in event_log]
 
     # determines if we have the minimum width to show date dividers
-    showDaybreaks = width - dividerIndent >= 3
 
-    while deduplicatedLog:
-      entry, duplicateCount = deduplicatedLog.pop(0)
+    show_daybreaks = width - divider_indent >= 3
 
-      if self.regexFilter and not self.regexFilter.search(entry.getDisplayMessage()):
+    while deduplicated_log:
+      entry, duplicate_count = deduplicated_log.pop(0)
+
+      if self.regex_filter and not self.regex_filter.search(entry.get_display_message()):
         continue  # filter doesn't match log message - skip
 
       # checks if we should be showing a divider with the date
+
       if entry.type == DAYBREAK_EVENT:
         # bottom of the divider
-        if seenFirstDateDivider:
-          if lineCount >= 1 and lineCount < height and showDaybreaks:
-            self.addch(lineCount, dividerIndent, curses.ACS_LLCORNER,  dividerAttr)
-            self.hline(lineCount, dividerIndent + 1, width - dividerIndent - 2, dividerAttr)
-            self.addch(lineCount, width - 1, curses.ACS_LRCORNER, dividerAttr)
 
-          lineCount += 1
+        if seen_first_date_divider:
+          if line_count >= 1 and line_count < height and show_daybreaks:
+            self.addch(line_count, divider_indent, curses.ACS_LLCORNER, divider_attr)
+            self.hline(line_count, divider_indent + 1, width - divider_indent - 2, divider_attr)
+            self.addch(line_count, width - 1, curses.ACS_LRCORNER, divider_attr)
+
+          line_count += 1
 
         # top of the divider
-        if lineCount >= 1 and lineCount < height and showDaybreaks:
-          timeLabel = time.strftime(" %B %d, %Y ", time.localtime(entry.timestamp))
-          self.addch(lineCount, dividerIndent, curses.ACS_ULCORNER, dividerAttr)
-          self.addch(lineCount, dividerIndent + 1, curses.ACS_HLINE, dividerAttr)
-          self.addstr(lineCount, dividerIndent + 2, timeLabel, curses.A_BOLD | dividerAttr)
-
-          lineLength = width - dividerIndent - len(timeLabel) - 3
-          self.hline(lineCount, dividerIndent + len(timeLabel) + 2, lineLength, dividerAttr)
-          self.addch(lineCount, dividerIndent + len(timeLabel) + 2 + lineLength, curses.ACS_URCORNER, dividerAttr)
-
-        seenFirstDateDivider = True
-        lineCount += 1
+
+        if line_count >= 1 and line_count < height and show_daybreaks:
+          time_label = time.strftime(" %B %d, %Y ", time.localtime(entry.timestamp))
+          self.addch(line_count, divider_indent, curses.ACS_ULCORNER, divider_attr)
+          self.addch(line_count, divider_indent + 1, curses.ACS_HLINE, divider_attr)
+          self.addstr(line_count, divider_indent + 2, time_label, curses.A_BOLD | divider_attr)
+
+          line_length = width - divider_indent - len(time_label) - 3
+          self.hline(line_count, divider_indent + len(time_label) + 2, line_length, divider_attr)
+          self.addch(line_count, divider_indent + len(time_label) + 2 + line_length, curses.ACS_URCORNER, divider_attr)
+
+        seen_first_date_divider = True
+        line_count += 1
       else:
         # entry contents to be displayed, tuples of the form:
         # (msg, formatting, includeLinebreak)
-        displayQueue = []
-
-        msgComp = entry.getDisplayMessage().split("\n")
-        for i in range(len(msgComp)):
-          font = curses.A_BOLD if "ERR" in entry.type else curses.A_NORMAL # emphasizes ERR messages
-          displayQueue.append((msgComp[i].strip(), font | uiTools.getColor(entry.color), i != len(msgComp) - 1))
-
-        if duplicateCount:
-          pluralLabel = "s" if duplicateCount > 1 else ""
-          duplicateMsg = DUPLICATE_MSG % (duplicateCount, pluralLabel)
-          displayQueue.append((duplicateMsg, duplicateAttr, False))
-
-        cursorLoc, lineOffset = msgIndent, 0
-        maxEntriesPerLine = CONFIG["features.log.maxLinesPerEntry"]
-        while displayQueue:
-          msg, format, includeBreak = displayQueue.pop(0)
-          drawLine = lineCount + lineOffset
-          if lineOffset == maxEntriesPerLine: break
-
-          maxMsgSize = width - cursorLoc - 1
-          if len(msg) > maxMsgSize:
+
+        display_queue = []
+
+        msg_comp = entry.get_display_message().split("\n")
+
+        for i in range(len(msg_comp)):
+          font = curses.A_BOLD if "ERR" in entry.type else curses.A_NORMAL  # emphasizes ERR messages
+          display_queue.append((msg_comp[i].strip(), font | uiTools.get_color(entry.color), i != len(msg_comp) - 1))
+
+        if duplicate_count:
+          plural_label = "s" if duplicate_count > 1 else ""
+          duplicate_msg = DUPLICATE_MSG % (duplicate_count, plural_label)
+          display_queue.append((duplicate_msg, duplicate_attr, False))
+
+        cursor_location, line_offset = msg_indent, 0
+        max_entries_per_line = CONFIG["features.log.max_lines_per_entry"]
+
+        while display_queue:
+          msg, format, include_break = display_queue.pop(0)
+          draw_line = line_count + line_offset
+
+          if line_offset == max_entries_per_line:
+            break
+
+          max_msg_size = width - cursor_location - 1
+
+          if len(msg) > max_msg_size:
             # message is too long - break it up
-            if lineOffset == maxEntriesPerLine - 1:
-              msg = uiTools.cropStr(msg, maxMsgSize)
+            if line_offset == max_entries_per_line - 1:
+              msg = uiTools.crop_str(msg, max_msg_size)
             else:
-              msg, remainder = uiTools.cropStr(msg, maxMsgSize, 4, 4, uiTools.Ending.HYPHEN, True)
-              displayQueue.insert(0, (remainder.strip(), format, includeBreak))
+              msg, remainder = uiTools.crop_str(msg, max_msg_size, 4, 4, uiTools.Ending.HYPHEN, True)
+              display_queue.insert(0, (remainder.strip(), format, include_break))
 
-            includeBreak = True
+            include_break = True
 
-          if drawLine < height and drawLine >= 1:
-            if seenFirstDateDivider and width - dividerIndent >= 3 and showDaybreaks:
-              self.addch(drawLine, dividerIndent, curses.ACS_VLINE, dividerAttr)
-              self.addch(drawLine, width - 1, curses.ACS_VLINE, dividerAttr)
+          if draw_line < height and draw_line >= 1:
+            if seen_first_date_divider and width - divider_indent >= 3 and show_daybreaks:
+              self.addch(draw_line, divider_indent, curses.ACS_VLINE, divider_attr)
+              self.addch(draw_line, width - 1, curses.ACS_VLINE, divider_attr)
 
-            self.addstr(drawLine, cursorLoc, msg, format)
+            self.addstr(draw_line, cursor_location, msg, format)
 
-          cursorLoc += len(msg)
+          cursor_location += len(msg)
 
-          if includeBreak or not displayQueue:
-            lineOffset += 1
-            cursorLoc = msgIndent + ENTRY_INDENT
+          if include_break or not display_queue:
+            line_offset += 1
+            cursor_location = msg_indent + ENTRY_INDENT
 
-        lineCount += lineOffset
+        line_count += line_offset
 
       # if this is the last line and there's room, then draw the bottom of the divider
-      if not deduplicatedLog and seenFirstDateDivider:
-        if lineCount < height and showDaybreaks:
-          self.addch(lineCount, dividerIndent, curses.ACS_LLCORNER, dividerAttr)
-          self.hline(lineCount, dividerIndent + 1, width - dividerIndent - 2, dividerAttr)
-          self.addch(lineCount, width - 1, curses.ACS_LRCORNER, dividerAttr)
 
-        lineCount += 1
+      if not deduplicated_log and seen_first_date_divider:
+        if line_count < height and show_daybreaks:
+          self.addch(line_count, divider_indent, curses.ACS_LLCORNER, divider_attr)
+          self.hline(line_count, divider_indent + 1, width - divider_indent - 2, divider_attr)
+          self.addch(line_count, width - 1, curses.ACS_LRCORNER, divider_attr)
+
+        line_count += 1
 
     # redraw the display if...
-    # - lastContentHeight was off by too much
+    # - last_content_height was off by too much
     # - we're off the bottom of the page
-    newContentHeight = lineCount + self.scroll - 1
-    contentHeightDelta = abs(self.lastContentHeight - newContentHeight)
-    forceRedraw, forceRedrawReason = True, ""
-
-    if contentHeightDelta >= CONTENT_HEIGHT_REDRAW_THRESHOLD:
-      forceRedrawReason = "estimate was off by %i" % contentHeightDelta
-    elif newContentHeight > height and self.scroll + height - 1 > newContentHeight:
-      forceRedrawReason = "scrolled off the bottom of the page"
-    elif not isScrollBarVisible and newContentHeight > height - 1:
-      forceRedrawReason = "scroll bar wasn't previously visible"
-    elif isScrollBarVisible and newContentHeight <= height - 1:
-      forceRedrawReason = "scroll bar shouldn't be visible"
-    else: forceRedraw = False
-
-    self.lastContentHeight = newContentHeight
-    if forceRedraw:
-      log.debug("redrawing the log panel with the corrected content height (%s)" % forceRedrawReason)
+
+    new_content_height = line_count + self.scroll - 1
+    content_height_delta = abs(self.last_content_height - new_content_height)
+    force_redraw, force_redraw_reason = True, ""
+
+    if content_height_delta >= CONTENT_HEIGHT_REDRAW_THRESHOLD:
+      force_redraw_reason = "estimate was off by %i" % content_height_delta
+    elif new_content_height > height and self.scroll + height - 1 > new_content_height:
+      force_redraw_reason = "scrolled off the bottom of the page"
+    elif not is_scroll_bar_visible and new_content_height > height - 1:
+      force_redraw_reason = "scroll bar wasn't previously visible"
+    elif is_scroll_bar_visible and new_content_height <= height - 1:
+      force_redraw_reason = "scroll bar shouldn't be visible"
+    else:
+      force_redraw = False
+
+    self.last_content_height = new_content_height
+
+    if force_redraw:
+      log.debug("redrawing the log panel with the corrected content height (%s)" % force_redraw_reason)
       self.redraw(True)
 
-    self.valsLock.release()
+    self.vals_lock.release()
 
-  def redraw(self, forceRedraw=False, block=False):
+  def redraw(self, force_redraw=False, block=False):
     # determines if the content needs to be redrawn or not
-    panel.Panel.redraw(self, forceRedraw, block)
+    panel.Panel.redraw(self, force_redraw, block)
 
   def run(self):
     """
@@ -976,29 +1121,35 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
     responsive if additions are less frequent.
     """
 
-    lastDay = daysSince() # used to determine if the date has changed
+    last_day = days_since()  # used to determine if the date has changed
+
     while not self._halt:
-      currentDay = daysSince()
-      timeSinceReset = time.time() - self._lastUpdate
-      maxLogUpdateRate = CONFIG["features.log.maxRefreshRate"] / 1000.0
+      current_day = days_since()
+      time_since_reset = time.time() - self._last_update
+      max_log_update_rate = CONFIG["features.log.maxRefreshRate"] / 1000.0
+
+      sleep_time = 0
 
-      sleepTime = 0
-      if (self.msgLog == self._lastLoggedEvents and lastDay == currentDay) or self.isPaused():
-        sleepTime = 5
-      elif timeSinceReset < maxLogUpdateRate:
-        sleepTime = max(0.05, maxLogUpdateRate - timeSinceReset)
+      if (self.msg_log == self._last_logged_events and last_day == current_day) or self.is_paused():
+        sleep_time = 5
+      elif time_since_reset < max_log_update_rate:
+        sleep_time = max(0.05, max_log_update_rate - time_since_reset)
 
-      if sleepTime:
+      if sleep_time:
         self._cond.acquire()
-        if not self._halt: self._cond.wait(sleepTime)
+
+        if not self._halt:
+          self._cond.wait(sleep_time)
+
         self._cond.release()
       else:
-        lastDay = currentDay
+        last_day = current_day
         self.redraw(True)
 
         # makes sure that we register this as an update, otherwise lacking the
         # curses lock can cause a busy wait here
-        self._lastUpdate = time.time()
+
+        self._last_update = time.time()
 
   def stop(self):
     """
@@ -1010,7 +1161,7 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
     self._cond.notifyAll()
     self._cond.release()
 
-  def setEventListening(self, events):
+  def set_event_listening(self, events):
     """
     Configures the events Tor listens for, filtering non-tor events from what we
     request from the controller. This returns a sorted list of the events we
@@ -1020,9 +1171,10 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
       events - event types to attempt to set
     """
 
-    events = set(events) # drops duplicates
+    events = set(events)  # drops duplicates
 
     # accounts for runlevel naming difference
+
     if "ERROR" in events:
       events.add("ERR")
       events.remove("ERROR")
@@ -1031,36 +1183,38 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
       events.add("WARN")
       events.remove("WARNING")
 
-    torEvents = events.intersection(set(arm.arguments.TOR_EVENT_TYPES.values()))
-    armEvents = events.intersection(set(["ARM_%s" % runlevel for runlevel in log.Runlevel.keys()]))
+    tor_events = events.intersection(set(arm.arguments.TOR_EVENT_TYPES.values()))
+    arm_events = events.intersection(set(["ARM_%s" % runlevel for runlevel in log.Runlevel.keys()]))
 
     # adds events unrecognized by arm if we're listening to the 'UNKNOWN' type
+
     if "UNKNOWN" in events:
-      torEvents.update(set(arm.arguments.missing_event_types()))
+      tor_events.update(set(arm.arguments.missing_event_types()))
 
-    torConn = torTools.getConn()
-    torConn.removeEventListener(self.registerTorEvent)
+    tor_conn = torTools.get_conn()
+    tor_conn.remove_event_listener(self.register_tor_event)
 
-    for eventType in list(torEvents):
+    for event_type in list(tor_events):
       try:
-        torConn.addEventListener(self.registerTorEvent, eventType)
+        tor_conn.add_event_listener(self.register_tor_event, event_type)
       except stem.ProtocolError:
-        torEvents.remove(eventType)
+        tor_events.remove(event_type)
 
     # provides back the input set minus events we failed to set
-    return sorted(torEvents.union(armEvents))
 
-  def _resetListener(self, controller, eventType, _):
+    return sorted(tor_events.union(arm_events))
+
+  def _reset_listener(self, controller, event_type, _):
     # if we're attaching to a new tor instance then clears the log and
     # prepopulates it with the content belonging to this instance
 
-    if eventType == State.INIT:
-      self.reprepopulateEvents()
+    if event_type == State.INIT:
+      self.reprepopulate_events()
       self.redraw(True)
-    elif eventType == State.CLOSED:
+    elif event_type == State.CLOSED:
       log.notice("Tor control port closed")
 
-  def _getTitle(self, width):
+  def _get_title(self, width):
     """
     Provides the label used for the panel, looking like:
       Events (ARM NOTICE - ERR, BW - filter: prepopulate):
@@ -1075,113 +1229,143 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
 
     # usually the attributes used to make the label are decently static, so
     # provide cached results if they're unchanged
-    self.valsLock.acquire()
-    currentPattern = self.regexFilter.pattern if self.regexFilter else None
-    isUnchanged = self._titleArgs[0] == self.loggedEvents
-    isUnchanged &= self._titleArgs[1] == currentPattern
-    isUnchanged &= self._titleArgs[2] == width
-    if isUnchanged:
-      self.valsLock.release()
-      return self._titleCache
-
-    eventsList = list(self.loggedEvents)
-    if not eventsList:
-      if not currentPattern:
-        panelLabel = "Events:"
+
+    self.vals_lock.acquire()
+    current_pattern = self.regex_filter.pattern if self.regex_filter else None
+    is_unchanged = self._title_args[0] == self.logged_events
+    is_unchanged &= self._title_args[1] == current_pattern
+    is_unchanged &= self._title_args[2] == width
+
+    if is_unchanged:
+      self.vals_lock.release()
+      return self._title_cache
+
+    events_list = list(self.logged_events)
+
+    if not events_list:
+      if not current_pattern:
+        panel_label = "Events:"
       else:
-        labelPattern = uiTools.cropStr(currentPattern, width - 18)
-        panelLabel = "Events (filter: %s):" % labelPattern
+        label_pattern = uiTools.crop_str(current_pattern, width - 18)
+        panel_label = "Events (filter: %s):" % label_pattern
     else:
       # does the following with all runlevel types (tor, arm, and stem):
       # - pulls to the start of the list
       # - condenses range if there's three or more in a row (ex. "ARM_INFO - WARN")
       # - condense further if there's identical runlevel ranges for multiple
       #   types (ex. "NOTICE - ERR, ARM_NOTICE - ERR" becomes "TOR/ARM NOTICE - ERR")
-      tmpRunlevels = [] # runlevels pulled from the list (just the runlevel part)
-      runlevelRanges = [] # tuple of type, startLevel, endLevel for ranges to be consensed
+
+      tmp_runlevels = []  # runlevels pulled from the list (just the runlevel part)
+      runlevel_ranges = []  # tuple of type, start_level, end_level for ranges to be consensed
 
       # reverses runlevels and types so they're appended in the right order
-      reversedRunlevels = list(log.Runlevel)
-      reversedRunlevels.reverse()
+
+      reversed_runlevels = list(log.Runlevel)
+      reversed_runlevels.reverse()
+
       for prefix in ("ARM_", ""):
         # blank ending runlevel forces the break condition to be reached at the end
-        for runlevel in reversedRunlevels + [""]:
-          eventType = prefix + runlevel
-          if runlevel and eventType in eventsList:
+        for runlevel in reversed_runlevels + [""]:
+          event_type = prefix + runlevel
+          if runlevel and event_type in events_list:
             # runlevel event found, move to the tmp list
-            eventsList.remove(eventType)
-            tmpRunlevels.append(runlevel)
-          elif tmpRunlevels:
-            # adds all tmp list entries to the start of eventsList
-            if len(tmpRunlevels) >= 3:
+            events_list.remove(event_type)
+            tmp_runlevels.append(runlevel)
+          elif tmp_runlevels:
+            # adds all tmp list entries to the start of events_list
+            if len(tmp_runlevels) >= 3:
               # save condense sequential runlevels to be added later
-              runlevelRanges.append((prefix, tmpRunlevels[-1], tmpRunlevels[0]))
+              runlevel_ranges.append((prefix, tmp_runlevels[-1], tmp_runlevels[0]))
             else:
               # adds runlevels individaully
-              for tmpRunlevel in tmpRunlevels:
-                eventsList.insert(0, prefix + tmpRunlevel)
+              for tmp_runlevel in tmp_runlevels:
+                events_list.insert(0, prefix + tmp_runlevel)
 
-            tmpRunlevels = []
+            tmp_runlevels = []
 
       # adds runlevel ranges, condensing if there's identical ranges
-      for i in range(len(runlevelRanges)):
-        if runlevelRanges[i]:
-          prefix, startLevel, endLevel = runlevelRanges[i]
+
+      for i in range(len(runlevel_ranges)):
+        if runlevel_ranges[i]:
+          prefix, start_level, end_level = runlevel_ranges[i]
 
           # check for matching ranges
+
           matches = []
-          for j in range(i + 1, len(runlevelRanges)):
-            if runlevelRanges[j] and runlevelRanges[j][1] == startLevel and runlevelRanges[j][2] == endLevel:
-              matches.append(runlevelRanges[j])
-              runlevelRanges[j] = None
+
+          for j in range(i + 1, len(runlevel_ranges)):
+            if runlevel_ranges[j] and runlevel_ranges[j][1] == start_level and runlevel_ranges[j][2] == end_level:
+              matches.append(runlevel_ranges[j])
+              runlevel_ranges[j] = None
 
           if matches:
             # strips underscores and replaces empty entries with "TOR"
+
             prefixes = [entry[0] for entry in matches] + [prefix]
+
             for k in range(len(prefixes)):
-              if prefixes[k] == "": prefixes[k] = "TOR"
-              else: prefixes[k] = prefixes[k].replace("_", "")
+              if prefixes[k] == "":
+                prefixes[k] = "TOR"
+              else:
+                prefixes[k] = prefixes[k].replace("_", "")
 
-            eventsList.insert(0, "%s %s - %s" % ("/".join(prefixes), startLevel, endLevel))
+            events_list.insert(0, "%s %s - %s" % ("/".join(prefixes), start_level, end_level))
           else:
-            eventsList.insert(0, "%s%s - %s" % (prefix, startLevel, endLevel))
+            events_list.insert(0, "%s%s - %s" % (prefix, start_level, end_level))
 
       # truncates to use an ellipsis if too long, for instance:
-      attrLabel = ", ".join(eventsList)
-      if currentPattern: attrLabel += " - filter: %s" % currentPattern
-      attrLabel = uiTools.cropStr(attrLabel, width - 10, 1)
-      if attrLabel: attrLabel = " (%s)" % attrLabel
-      panelLabel = "Events%s:" % attrLabel
+
+      attr_label = ", ".join(events_list)
+
+      if current_pattern:
+        attr_label += " - filter: %s" % current_pattern
+
+      attr_label = uiTools.crop_str(attr_label, width - 10, 1)
+
+      if attr_label:
+        attr_label = " (%s)" % attr_label
+
+      panel_label = "Events%s:" % attr_label
 
     # cache results and return
-    self._titleCache = panelLabel
-    self._titleArgs = (list(self.loggedEvents), currentPattern, width)
-    self.valsLock.release()
-    return panelLabel
 
-  def _trimEvents(self, eventListing):
+    self._title_cache = panel_label
+    self._title_args = (list(self.logged_events), current_pattern, width)
+    self.vals_lock.release()
+
+    return panel_label
+
+  def _trim_events(self, event_listing):
     """
     Crops events that have either:
     - grown beyond the cache limit
     - outlived the configured log duration
 
     Argument:
-      eventListing - listing of log entries
+      event_listing - listing of log entries
     """
 
-    cacheSize = CONFIG["cache.logPanel.size"]
-    if len(eventListing) > cacheSize: del eventListing[cacheSize:]
+    cache_size = CONFIG["cache.log_panel.size"]
+
+    if len(event_listing) > cache_size:
+      del event_listing[cache_size:]
+
+    log_ttl = CONFIG["features.log.entryDuration"]
+
+    if log_ttl > 0:
+      current_day = days_since()
+
+      breakpoint = None  # index at which to crop from
 
-    logTTL = CONFIG["features.log.entryDuration"]
-    if logTTL > 0:
-      currentDay = daysSince()
+      for i in range(len(event_listing) - 1, -1, -1):
+        days_since_event = current_day - days_since(event_listing[i].timestamp)
 
-      breakpoint = None # index at which to crop from
-      for i in range(len(eventListing) - 1, -1, -1):
-        daysSinceEvent = currentDay - daysSince(eventListing[i].timestamp)
-        if daysSinceEvent > logTTL: breakpoint = i # older than the ttl
-        else: break
+        if days_since_event > log_ttl:
+          breakpoint = i  # older than the ttl
+        else:
+          break
 
       # removes entries older than the ttl
-      if breakpoint != None: del eventListing[breakpoint:]
 
+      if breakpoint is not None:
+        del event_listing[breakpoint:]
diff --git a/arm/menu/__init__.py b/arm/menu/__init__.py
index f6d43ec..4cc12de 100644
--- a/arm/menu/__init__.py
+++ b/arm/menu/__init__.py
@@ -3,4 +3,3 @@ Resources for displaying the menu.
 """
 
 __all__ = ["actions", "item", "menu"]
-
diff --git a/arm/menu/actions.py b/arm/menu/actions.py
index 6602b6b..b11f54f 100644
--- a/arm/menu/actions.py
+++ b/arm/menu/actions.py
@@ -20,34 +20,36 @@ CONFIG = conf.config_dict("arm", {
   "features.log.showDuplicateEntries": False,
 })
 
-def makeMenu():
+
+def make_menu():
   """
   Constructs the base menu and all of its contents.
   """
 
-  baseMenu = arm.menu.item.Submenu("")
-  baseMenu.add(makeActionsMenu())
-  baseMenu.add(makeViewMenu())
+  base_menu = arm.menu.item.Submenu("")
+  base_menu.add(make_actions_menu())
+  base_menu.add(make_view_menu())
+
+  control = arm.controller.get_controller()
 
-  control = arm.controller.getController()
+  for page_panel in control.get_display_panels(include_sticky = False):
+    if page_panel.get_name() == "graph":
+      base_menu.add(make_graph_menu(page_panel))
+    elif page_panel.get_name() == "log":
+      base_menu.add(make_log_menu(page_panel))
+    elif page_panel.get_name() == "connections":
+      base_menu.add(make_connections_menu(page_panel))
+    elif page_panel.get_name() == "configuration":
+      base_menu.add(make_configuration_menu(page_panel))
+    elif page_panel.get_name() == "torrc":
+      base_menu.add(make_torrc_menu(page_panel))
 
-  for pagePanel in control.getDisplayPanels(includeSticky = False):
-    if pagePanel.getName() == "graph":
-      baseMenu.add(makeGraphMenu(pagePanel))
-    elif pagePanel.getName() == "log":
-      baseMenu.add(makeLogMenu(pagePanel))
-    elif pagePanel.getName() == "connections":
-      baseMenu.add(makeConnectionsMenu(pagePanel))
-    elif pagePanel.getName() == "configuration":
-      baseMenu.add(makeConfigurationMenu(pagePanel))
-    elif pagePanel.getName() == "torrc":
-      baseMenu.add(makeTorrcMenu(pagePanel))
+  base_menu.add(make_help_menu())
 
-  baseMenu.add(makeHelpMenu())
+  return base_menu
 
-  return baseMenu
 
-def makeActionsMenu():
+def make_actions_menu():
   """
   Submenu consisting of...
     Close Menu
@@ -57,26 +59,30 @@ def makeActionsMenu():
     Exit
   """
 
-  control = arm.controller.getController()
-  conn = torTools.getConn()
-  headerPanel = control.getPanel("header")
-  actionsMenu = arm.menu.item.Submenu("Actions")
-  actionsMenu.add(arm.menu.item.MenuItem("Close Menu", None))
-  actionsMenu.add(arm.menu.item.MenuItem("New Identity", headerPanel.sendNewnym))
+  control = arm.controller.get_controller()
+  conn = torTools.get_conn()
+  header_panel = control.get_panel("header")
+  actions_menu = arm.menu.item.Submenu("Actions")
+  actions_menu.add(arm.menu.item.MenuItem("Close Menu", None))
+  actions_menu.add(arm.menu.item.MenuItem("New Identity", header_panel.send_newnym))
+
+  if conn.is_alive():
+    actions_menu.add(arm.menu.item.MenuItem("Stop Tor", conn.shutdown))
 
-  if conn.isAlive():
-    actionsMenu.add(arm.menu.item.MenuItem("Stop Tor", conn.shutdown))
+  actions_menu.add(arm.menu.item.MenuItem("Reset Tor", conn.reload))
 
-  actionsMenu.add(arm.menu.item.MenuItem("Reset Tor", conn.reload))
+  if control.is_paused():
+    label, arg = "Unpause", False
+  else:
+    label, arg = "Pause", True
 
-  if control.isPaused(): label, arg = "Unpause", False
-  else: label, arg = "Pause", True
-  actionsMenu.add(arm.menu.item.MenuItem(label, functools.partial(control.setPaused, arg)))
+  actions_menu.add(arm.menu.item.MenuItem(label, functools.partial(control.set_paused, arg)))
+  actions_menu.add(arm.menu.item.MenuItem("Exit", control.quit))
 
-  actionsMenu.add(arm.menu.item.MenuItem("Exit", control.quit))
-  return actionsMenu
+  return actions_menu
 
-def makeViewMenu():
+
+def make_view_menu():
   """
   Submenu consisting of...
     [X] <Page 1>
@@ -85,44 +91,46 @@ def makeViewMenu():
         Color (Submenu)
   """
 
-  viewMenu = arm.menu.item.Submenu("View")
-  control = arm.controller.getController()
+  view_menu = arm.menu.item.Submenu("View")
+  control = arm.controller.get_controller()
 
-  if control.getPageCount() > 0:
-    pageGroup = arm.menu.item.SelectionGroup(control.setPage, control.getPage())
+  if control.get_page_count() > 0:
+    page_group = arm.menu.item.SelectionGroup(control.set_page, control.get_page())
 
-    for i in range(control.getPageCount()):
-      pagePanels = control.getDisplayPanels(pageNumber = i, includeSticky = False)
-      label = " / ".join([str_tools._to_camel_case(panel.getName()) for panel in pagePanels])
+    for i in range(control.get_page_count()):
+      page_panels = control.get_display_panels(page_number = i, include_sticky = False)
+      label = " / ".join([str_tools._to_camel_case(panel.get_name()) for panel in page_panels])
 
-      viewMenu.add(arm.menu.item.SelectionMenuItem(label, pageGroup, i))
+      view_menu.add(arm.menu.item.SelectionMenuItem(label, page_group, i))
 
-  if uiTools.isColorSupported():
-    colorMenu = arm.menu.item.Submenu("Color")
-    colorGroup = arm.menu.item.SelectionGroup(uiTools.setColorOverride, uiTools.getColorOverride())
+  if uiTools.is_color_supported():
+    color_menu = arm.menu.item.Submenu("Color")
+    color_group = arm.menu.item.SelectionGroup(uiTools.set_color_override, uiTools.get_color_override())
 
-    colorMenu.add(arm.menu.item.SelectionMenuItem("All", colorGroup, None))
+    color_menu.add(arm.menu.item.SelectionMenuItem("All", color_group, None))
 
     for color in uiTools.COLOR_LIST:
-      colorMenu.add(arm.menu.item.SelectionMenuItem(str_tools._to_camel_case(color), colorGroup, color))
+      color_menu.add(arm.menu.item.SelectionMenuItem(str_tools._to_camel_case(color), color_group, color))
+
+    view_menu.add(color_menu)
 
-    viewMenu.add(colorMenu)
+  return view_menu
 
-  return viewMenu
 
-def makeHelpMenu():
+def make_help_menu():
   """
   Submenu consisting of...
     Hotkeys
     About
   """
 
-  helpMenu = arm.menu.item.Submenu("Help")
-  helpMenu.add(arm.menu.item.MenuItem("Hotkeys", arm.popups.showHelpPopup))
-  helpMenu.add(arm.menu.item.MenuItem("About", arm.popups.showAboutPopup))
-  return helpMenu
+  help_menu = arm.menu.item.Submenu("Help")
+  help_menu.add(arm.menu.item.MenuItem("Hotkeys", arm.popups.show_help_popup))
+  help_menu.add(arm.menu.item.MenuItem("About", arm.popups.show_about_popup))
+  return help_menu
+
 
-def makeGraphMenu(graphPanel):
+def make_graph_menu(graph_panel):
   """
   Submenu for the graph panel, consisting of...
     [X] <Stat 1>
@@ -133,47 +141,52 @@ def makeGraphMenu(graphPanel):
         Bounds (Submenu)
 
   Arguments:
-    graphPanel - instance of the graph panel
+    graph_panel - instance of the graph panel
   """
 
-  graphMenu = arm.menu.item.Submenu("Graph")
+  graph_menu = arm.menu.item.Submenu("Graph")
 
   # stats options
-  statGroup = arm.menu.item.SelectionGroup(graphPanel.setStats, graphPanel.getStats())
-  availableStats = graphPanel.stats.keys()
-  availableStats.sort()
 
-  for statKey in ["None"] + availableStats:
-    label = str_tools._to_camel_case(statKey, divider = " ")
-    statKey = None if statKey == "None" else statKey
-    graphMenu.add(arm.menu.item.SelectionMenuItem(label, statGroup, statKey))
+  stat_group = arm.menu.item.SelectionGroup(graph_panel.set_stats, graph_panel.get_stats())
+  available_stats = graph_panel.stats.keys()
+  available_stats.sort()
+
+  for stat_key in ["None"] + available_stats:
+    label = str_tools._to_camel_case(stat_key, divider = " ")
+    stat_key = None if stat_key == "None" else stat_key
+    graph_menu.add(arm.menu.item.SelectionMenuItem(label, stat_group, stat_key))
 
   # resizing option
-  graphMenu.add(arm.menu.item.MenuItem("Resize...", graphPanel.resizeGraph))
+
+  graph_menu.add(arm.menu.item.MenuItem("Resize...", graph_panel.resize_graph))
 
   # interval submenu
-  intervalMenu = arm.menu.item.Submenu("Interval")
-  intervalGroup = arm.menu.item.SelectionGroup(graphPanel.setUpdateInterval, graphPanel.getUpdateInterval())
+
+  interval_menu = arm.menu.item.Submenu("Interval")
+  interval_group = arm.menu.item.SelectionGroup(graph_panel.set_update_interval, graph_panel.get_update_interval())
 
   for i in range(len(arm.graphing.graphPanel.UPDATE_INTERVALS)):
     label = arm.graphing.graphPanel.UPDATE_INTERVALS[i][0]
     label = str_tools._to_camel_case(label, divider = " ")
-    intervalMenu.add(arm.menu.item.SelectionMenuItem(label, intervalGroup, i))
+    interval_menu.add(arm.menu.item.SelectionMenuItem(label, interval_group, i))
 
-  graphMenu.add(intervalMenu)
+  graph_menu.add(interval_menu)
 
   # bounds submenu
-  boundsMenu = arm.menu.item.Submenu("Bounds")
-  boundsGroup = arm.menu.item.SelectionGroup(graphPanel.setBoundsType, graphPanel.getBoundsType())
 
-  for boundsType in arm.graphing.graphPanel.Bounds:
-    boundsMenu.add(arm.menu.item.SelectionMenuItem(boundsType, boundsGroup, boundsType))
+  bounds_menu = arm.menu.item.Submenu("Bounds")
+  bounds_group = arm.menu.item.SelectionGroup(graph_panel.set_bounds_type, graph_panel.get_bounds_type())
+
+  for bounds_type in arm.graphing.graphPanel.Bounds:
+    bounds_menu.add(arm.menu.item.SelectionMenuItem(bounds_type, bounds_group, bounds_type))
+
+  graph_menu.add(bounds_menu)
 
-  graphMenu.add(boundsMenu)
+  return graph_menu
 
-  return graphMenu
 
-def makeLogMenu(logPanel):
+def make_log_menu(log_panel):
   """
   Submenu for the log panel, consisting of...
     Events...
@@ -183,35 +196,39 @@ def makeLogMenu(logPanel):
     Filter (Submenu)
 
   Arguments:
-    logPanel - instance of the log panel
+    log_panel - instance of the log panel
   """
 
-  logMenu = arm.menu.item.Submenu("Log")
+  log_menu = arm.menu.item.Submenu("Log")
 
-  logMenu.add(arm.menu.item.MenuItem("Events...", logPanel.showEventSelectionPrompt))
-  logMenu.add(arm.menu.item.MenuItem("Snapshot...", logPanel.showSnapshotPrompt))
-  logMenu.add(arm.menu.item.MenuItem("Clear", logPanel.clear))
+  log_menu.add(arm.menu.item.MenuItem("Events...", log_panel.show_event_selection_prompt))
+  log_menu.add(arm.menu.item.MenuItem("Snapshot...", log_panel.show_snapshot_prompt))
+  log_menu.add(arm.menu.item.MenuItem("Clear", log_panel.clear))
 
   if CONFIG["features.log.showDuplicateEntries"]:
     label, arg = "Hide", False
-  else: label, arg = "Show", True
-  logMenu.add(arm.menu.item.MenuItem("%s Duplicates" % label, functools.partial(logPanel.setDuplicateVisability, arg)))
+  else:
+    label, arg = "Show", True
+
+  log_menu.add(arm.menu.item.MenuItem("%s Duplicates" % label, functools.partial(log_panel.set_duplicate_visability, arg)))
 
   # filter submenu
-  filterMenu = arm.menu.item.Submenu("Filter")
-  filterGroup = arm.menu.item.SelectionGroup(logPanel.makeFilterSelection, logPanel.getFilter())
 
-  filterMenu.add(arm.menu.item.SelectionMenuItem("None", filterGroup, None))
+  filter_menu = arm.menu.item.Submenu("Filter")
+  filter_group = arm.menu.item.SelectionGroup(log_panel.make_filter_selection, log_panel.get_filter())
+
+  filter_menu.add(arm.menu.item.SelectionMenuItem("None", filter_group, None))
+
+  for option in log_panel.filter_options:
+    filter_menu.add(arm.menu.item.SelectionMenuItem(option, filter_group, option))
 
-  for option in logPanel.filterOptions:
-    filterMenu.add(arm.menu.item.SelectionMenuItem(option, filterGroup, option))
+  filter_menu.add(arm.menu.item.MenuItem("New...", log_panel.show_filter_prompt))
+  log_menu.add(filter_menu)
 
-  filterMenu.add(arm.menu.item.MenuItem("New...", logPanel.showFilterPrompt))
-  logMenu.add(filterMenu)
+  return log_menu
 
-  return logMenu
 
-def makeConnectionsMenu(connPanel):
+def make_connections_menu(conn_panel):
   """
   Submenu for the connections panel, consisting of...
     [X] IP Address
@@ -221,38 +238,42 @@ def makeConnectionsMenu(connPanel):
         Resolver (Submenu)
 
   Arguments:
-    connPanel - instance of the connections panel
+    conn_panel - instance of the connections panel
   """
 
-  connectionsMenu = arm.menu.item.Submenu("Connections")
+  connections_menu = arm.menu.item.Submenu("Connections")
 
   # listing options
-  listingGroup = arm.menu.item.SelectionGroup(connPanel.setListingType, connPanel.getListingType())
 
-  listingOptions = list(arm.connections.entries.ListingType)
-  listingOptions.remove(arm.connections.entries.ListingType.HOSTNAME)
+  listing_group = arm.menu.item.SelectionGroup(conn_panel.set_listing_type, conn_panel.get_listing_type())
 
-  for option in listingOptions:
-    connectionsMenu.add(arm.menu.item.SelectionMenuItem(option, listingGroup, option))
+  listing_options = list(arm.connections.entries.ListingType)
+  listing_options.remove(arm.connections.entries.ListingType.HOSTNAME)
+
+  for option in listing_options:
+    connections_menu.add(arm.menu.item.SelectionMenuItem(option, listing_group, option))
 
   # sorting option
-  connectionsMenu.add(arm.menu.item.MenuItem("Sorting...", connPanel.showSortDialog))
+
+  connections_menu.add(arm.menu.item.MenuItem("Sorting...", conn_panel.show_sort_dialog))
 
   # resolver submenu
-  connResolver = arm.util.tracker.get_connection_tracker()
-  resolverMenu = arm.menu.item.Submenu("Resolver")
-  resolverGroup = arm.menu.item.SelectionGroup(connResolver.set_custom_resolver, connResolver.get_custom_resolver())
 
-  resolverMenu.add(arm.menu.item.SelectionMenuItem("auto", resolverGroup, None))
+  conn_resolver = arm.util.tracker.get_connection_tracker()
+  resolver_menu = arm.menu.item.Submenu("Resolver")
+  resolver_group = arm.menu.item.SelectionGroup(conn_resolver.set_custom_resolver, conn_resolver.get_custom_resolver())
+
+  resolver_menu.add(arm.menu.item.SelectionMenuItem("auto", resolver_group, None))
 
   for option in stem.util.connection.Resolver:
-    resolverMenu.add(arm.menu.item.SelectionMenuItem(option, resolverGroup, option))
+    resolver_menu.add(arm.menu.item.SelectionMenuItem(option, resolver_group, option))
 
-  connectionsMenu.add(resolverMenu)
+  connections_menu.add(resolver_menu)
 
-  return connectionsMenu
+  return connections_menu
 
-def makeConfigurationMenu(configPanel):
+
+def make_configuration_menu(config_panel):
   """
   Submenu for the configuration panel, consisting of...
     Save Config...
@@ -260,20 +281,24 @@ def makeConfigurationMenu(configPanel):
     Filter / Unfilter Options
 
   Arguments:
-    configPanel - instance of the configuration panel
+    config_panel - instance of the configuration panel
   """
 
-  configMenu = arm.menu.item.Submenu("Configuration")
-  configMenu.add(arm.menu.item.MenuItem("Save Config...", configPanel.showWriteDialog))
-  configMenu.add(arm.menu.item.MenuItem("Sorting...", configPanel.showSortDialog))
+  config_menu = arm.menu.item.Submenu("Configuration")
+  config_menu.add(arm.menu.item.MenuItem("Save Config...", config_panel.show_write_dialog))
+  config_menu.add(arm.menu.item.MenuItem("Sorting...", config_panel.show_sort_dialog))
+
+  if config_panel.show_all:
+    label, arg = "Filter", True
+  else:
+    label, arg = "Unfilter", False
+
+  config_menu.add(arm.menu.item.MenuItem("%s Options" % label, functools.partial(config_panel.set_filtering, arg)))
 
-  if configPanel.showAll: label, arg = "Filter", True
-  else: label, arg = "Unfilter", False
-  configMenu.add(arm.menu.item.MenuItem("%s Options" % label, functools.partial(configPanel.setFiltering, arg)))
+  return config_menu
 
-  return configMenu
 
-def makeTorrcMenu(torrcPanel):
+def make_torrc_menu(torrc_panel):
   """
   Submenu for the torrc panel, consisting of...
     Reload
@@ -281,19 +306,23 @@ def makeTorrcMenu(torrcPanel):
     Show / Hide Line Numbers
 
   Arguments:
-    torrcPanel - instance of the torrc panel
+    torrc_panel - instance of the torrc panel
   """
 
-  torrcMenu = arm.menu.item.Submenu("Torrc")
-  torrcMenu.add(arm.menu.item.MenuItem("Reload", torrcPanel.reloadTorrc))
+  torrc_menu = arm.menu.item.Submenu("Torrc")
+  torrc_menu.add(arm.menu.item.MenuItem("Reload", torrc_panel.reload_torrc))
 
-  if torrcPanel.stripComments: label, arg = "Show", True
-  else: label, arg = "Hide", False
-  torrcMenu.add(arm.menu.item.MenuItem("%s Comments" % label, functools.partial(torrcPanel.setCommentsVisible, arg)))
+  if torrc_panel.strip_comments:
+    label, arg = "Show", True
+  else:
+    label, arg = "Hide", False
 
-  if torrcPanel.showLineNum: label, arg = "Hide", False
-  else: label, arg = "Show", True
-  torrcMenu.add(arm.menu.item.MenuItem("%s Line Numbers" % label, functools.partial(torrcPanel.setLineNumberVisible, arg)))
+  torrc_menu.add(arm.menu.item.MenuItem("%s Comments" % label, functools.partial(torrc_panel.set_comments_visible, arg)))
 
-  return torrcMenu
+  if torrc_panel.show_line_num:
+    label, arg = "Hide", False
+  else:
+    label, arg = "Show", True
+  torrc_menu.add(arm.menu.item.MenuItem("%s Line Numbers" % label, functools.partial(torrc_panel.set_line_number_visible, arg)))
 
+  return torrc_menu
diff --git a/arm/menu/item.py b/arm/menu/item.py
index ffd46a5..8dd14bc 100644
--- a/arm/menu/item.py
+++ b/arm/menu/item.py
@@ -4,6 +4,7 @@ Menu item, representing an option in the drop-down menu.
 
 import arm.controller
 
+
 class MenuItem():
   """
   Option in a drop-down menu.
@@ -14,7 +15,7 @@ class MenuItem():
     self._callback = callback
     self._parent = None
 
-  def getLabel(self):
+  def get_label(self):
     """
     Provides a tuple of three strings representing the prefix, label, and
     suffix for this item.
@@ -22,32 +23,34 @@ class MenuItem():
 
     return ("", self._label, "")
 
-  def getParent(self):
+  def get_parent(self):
     """
     Provides the Submenu we're contained within.
     """
 
     return self._parent
 
-  def getHierarchy(self):
+  def get_hierarchy(self):
     """
     Provides a list with all of our parents, up to the root.
     """
 
-    myHierarchy = [self]
-    while myHierarchy[-1].getParent():
-      myHierarchy.append(myHierarchy[-1].getParent())
+    my_hierarchy = [self]
+    while my_hierarchy[-1].get_parent():
+      my_hierarchy.append(my_hierarchy[-1].get_parent())
 
-    myHierarchy.reverse()
-    return myHierarchy
+    my_hierarchy.reverse()
+    return my_hierarchy
 
-  def getRoot(self):
+  def get_root(self):
     """
     Provides the base submenu we belong to.
     """
 
-    if self._parent: return self._parent.getRoot()
-    else: return self
+    if self._parent:
+      return self._parent.get_root()
+    else:
+      return self
 
   def select(self):
     """
@@ -56,8 +59,8 @@ class MenuItem():
     """
 
     if self._callback:
-      control = arm.controller.getController()
-      control.setMsg()
+      control = arm.controller.get_controller()
+      control.set_msg()
       control.redraw()
       self._callback()
     return True
@@ -68,7 +71,7 @@ class MenuItem():
     if we don't have a parent.
     """
 
-    return self._getSibling(1)
+    return self._get_sibling(1)
 
   def prev(self):
     """
@@ -76,9 +79,9 @@ class MenuItem():
     if we don't have a parent.
     """
 
-    return self._getSibling(-1)
+    return self._get_sibling(-1)
 
-  def _getSibling(self, offset):
+  def _get_sibling(self, offset):
     """
     Provides our sibling with a given index offset from us, raising a
     ValueError if we don't have a parent.
@@ -88,22 +91,24 @@ class MenuItem():
     """
 
     if self._parent:
-      mySiblings = self._parent.getChildren()
+      my_siblings = self._parent.get_children()
 
       try:
-        myIndex = mySiblings.index(self)
-        return mySiblings[(myIndex + offset) % len(mySiblings)]
+        my_index = my_siblings.index(self)
+        return my_siblings[(my_index + offset) % len(my_siblings)]
       except ValueError:
         # We expect a bidirectional references between submenus and their
         # children. If we don't have this then our menu's screwed up.
 
-        msg = "The '%s' submenu doesn't contain '%s' (children: '%s')" % (self, self._parent, "', '".join(mySiblings))
+        msg = "The '%s' submenu doesn't contain '%s' (children: '%s')" % (self, self._parent, "', '".join(my_siblings))
         raise ValueError(msg)
-    else: raise ValueError("Menu option '%s' doesn't have a parent" % self)
+    else:
+      raise ValueError("Menu option '%s' doesn't have a parent" % self)
 
   def __str__(self):
     return self._label
 
+
 class Submenu(MenuItem):
   """
   Menu item that lists other menu options.
@@ -113,37 +118,37 @@ class Submenu(MenuItem):
     MenuItem.__init__(self, label, None)
     self._children = []
 
-  def getLabel(self):
+  def get_label(self):
     """
     Provides our label with a ">" suffix to indicate that we have suboptions.
     """
 
-    myLabel = MenuItem.getLabel(self)[1]
-    return ("", myLabel, " >")
+    my_label = MenuItem.get_label(self)[1]
+    return ("", my_label, " >")
 
-  def add(self, menuItem):
+  def add(self, menu_item):
     """
     Adds the given menu item to our listing. This raises a ValueError if the
     item already has a parent.
 
     Arguments:
-      menuItem - menu option to be added
+      menu_item - menu option to be added
     """
 
-    if menuItem.getParent():
-      raise ValueError("Menu option '%s' already has a parent" % menuItem)
+    if menu_item.get_parent():
+      raise ValueError("Menu option '%s' already has a parent" % menu_item)
     else:
-      menuItem._parent = self
-      self._children.append(menuItem)
+      menu_item._parent = self
+      self._children.append(menu_item)
 
-  def getChildren(self):
+  def get_children(self):
     """
     Provides the menu and submenus we contain.
     """
 
     return list(self._children)
 
-  def isEmpty(self):
+  def is_empty(self):
     """
     True if we have no children, false otherwise.
     """
@@ -153,14 +158,16 @@ class Submenu(MenuItem):
   def select(self):
     return False
 
+
 class SelectionGroup():
   """
   Radio button groups that SelectionMenuItems can belong to.
   """
 
-  def __init__(self, action, selectedArg):
+  def __init__(self, action, selected_arg):
     self.action = action
-    self.selectedArg = selectedArg
+    self.selected_arg = selected_arg
+
 
 class SelectionMenuItem(MenuItem):
   """
@@ -173,29 +180,28 @@ class SelectionMenuItem(MenuItem):
     self._group = group
     self._arg = arg
 
-  def isSelected(self):
+  def is_selected(self):
     """
     True if we're the selected item, false otherwise.
     """
 
-    return self._arg == self._group.selectedArg
+    return self._arg == self._group.selected_arg
 
-  def getLabel(self):
+  def get_label(self):
     """
     Provides our label with a "[X]" prefix if selected and "[ ]" if not.
     """
 
-    myLabel = MenuItem.getLabel(self)[1]
-    myPrefix = "[X] " if self.isSelected() else "[ ] "
-    return (myPrefix, myLabel, "")
+    my_label = MenuItem.get_label(self)[1]
+    my_prefix = "[X] " if self.is_selected() else "[ ] "
+    return (my_prefix, my_label, "")
 
   def select(self):
     """
     Performs the group's setter action with our argument.
     """
 
-    if not self.isSelected():
+    if not self.is_selected():
       self._group.action(self._arg)
 
     return True
-
diff --git a/arm/menu/menu.py b/arm/menu/menu.py
index 3edb0a7..99286c7 100644
--- a/arm/menu/menu.py
+++ b/arm/menu/menu.py
@@ -11,154 +11,185 @@ import arm.menu.actions
 
 from arm.util import uiTools
 
+
 class MenuCursor:
   """
   Tracks selection and key handling in the menu.
   """
 
-  def __init__(self, initialSelection):
-    self._selection = initialSelection
-    self._isDone = False
+  def __init__(self, initial_selection):
+    self._selection = initial_selection
+    self._is_done = False
 
-  def isDone(self):
+  def is_done(self):
     """
     Provides true if a selection has indicated that we should close the menu.
     False otherwise.
     """
 
-    return self._isDone
+    return self._is_done
 
-  def getSelection(self):
+  def get_selection(self):
     """
     Provides the currently selected menu item.
     """
 
     return self._selection
 
-  def handleKey(self, key):
-    isSelectionSubmenu = isinstance(self._selection, arm.menu.item.Submenu)
-    selectionHierarchy = self._selection.getHierarchy()
+  def handle_key(self, key):
+    is_selection_submenu = isinstance(self._selection, arm.menu.item.Submenu)
+    selection_hierarchy = self._selection.get_hierarchy()
 
-    if uiTools.isSelectionKey(key):
-      if isSelectionSubmenu:
-        if not self._selection.isEmpty():
-          self._selection = self._selection.getChildren()[0]
-      else: self._isDone = self._selection.select()
+    if uiTools.is_selection_key(key):
+      if is_selection_submenu:
+        if not self._selection.is_empty():
+          self._selection = self._selection.get_children()[0]
+      else:
+        self._is_done = self._selection.select()
     elif key == curses.KEY_UP:
       self._selection = self._selection.prev()
     elif key == curses.KEY_DOWN:
       self._selection = self._selection.next()
     elif key == curses.KEY_LEFT:
-      if len(selectionHierarchy) <= 3:
+      if len(selection_hierarchy) <= 3:
         # shift to the previous main submenu
-        prevSubmenu = selectionHierarchy[1].prev()
-        self._selection = prevSubmenu.getChildren()[0]
+
+        prev_submenu = selection_hierarchy[1].prev()
+        self._selection = prev_submenu.get_children()[0]
       else:
         # go up a submenu level
-        self._selection = self._selection.getParent()
+
+        self._selection = self._selection.get_parent()
     elif key == curses.KEY_RIGHT:
-      if isSelectionSubmenu:
+      if is_selection_submenu:
         # open submenu (same as making a selection)
-        if not self._selection.isEmpty():
-          self._selection = self._selection.getChildren()[0]
+
+        if not self._selection.is_empty():
+          self._selection = self._selection.get_children()[0]
       else:
         # shift to the next main submenu
-        nextSubmenu = selectionHierarchy[1].next()
-        self._selection = nextSubmenu.getChildren()[0]
+
+        next_submenu = selection_hierarchy[1].next()
+        self._selection = next_submenu.get_children()[0]
     elif key in (27, ord('m'), ord('M')):
       # close menu
-      self._isDone = True
 
-def showMenu():
-  popup, _, _ = arm.popups.init(1, belowStatic = False)
-  if not popup: return
-  control = arm.controller.getController()
+      self._is_done = True
+
+
+def show_menu():
+  popup, _, _ = arm.popups.init(1, below_static = False)
+
+  if not popup:
+    return
+
+  control = arm.controller.get_controller()
 
   try:
     # generates the menu and uses the initial selection of the first item in
     # the file menu
-    menu = arm.menu.actions.makeMenu()
-    cursor = MenuCursor(menu.getChildren()[0].getChildren()[0])
 
-    while not cursor.isDone():
+    menu = arm.menu.actions.make_menu()
+    cursor = MenuCursor(menu.get_children()[0].get_children()[0])
+
+    while not cursor.is_done():
       # sets the background color
+
       popup.win.clear()
-      popup.win.bkgd(' ', curses.A_STANDOUT | uiTools.getColor("red"))
-      selectionHierarchy = cursor.getSelection().getHierarchy()
+      popup.win.bkgd(' ', curses.A_STANDOUT | uiTools.get_color("red"))
+      selection_hierarchy = cursor.get_selection().get_hierarchy()
 
       # provide a message saying how to close the menu
-      control.setMsg("Press m or esc to close the menu.", curses.A_BOLD, True)
+
+      control.set_msg("Press m or esc to close the menu.", curses.A_BOLD, True)
 
       # renders the menu bar, noting where the open submenu is positioned
-      drawLeft, selectionLeft = 0, 0
 
-      for topLevelItem in menu.getChildren():
-        drawFormat = curses.A_BOLD
-        if topLevelItem == selectionHierarchy[1]:
-          drawFormat |= curses.A_UNDERLINE
-          selectionLeft = drawLeft
+      draw_left, selection_left = 0, 0
+
+      for top_level_item in menu.get_children():
+        draw_format = curses.A_BOLD
 
-        drawLabel = " %s " % topLevelItem.getLabel()[1]
-        popup.addstr(0, drawLeft, drawLabel, drawFormat)
-        popup.addch(0, drawLeft + len(drawLabel), curses.ACS_VLINE)
+        if top_level_item == selection_hierarchy[1]:
+          draw_format |= curses.A_UNDERLINE
+          selection_left = draw_left
 
-        drawLeft += len(drawLabel) + 1
+        draw_label = " %s " % top_level_item.get_label()[1]
+        popup.addstr(0, draw_left, draw_label, draw_format)
+        popup.addch(0, draw_left + len(draw_label), curses.ACS_VLINE)
+
+        draw_left += len(draw_label) + 1
 
       # recursively shows opened submenus
-      _drawSubmenu(cursor, 1, 1, selectionLeft)
+
+      _draw_submenu(cursor, 1, 1, selection_left)
 
       popup.win.refresh()
 
       curses.cbreak()
-      key = control.getScreen().getch()
-      cursor.handleKey(key)
+      key = control.get_screen().getch()
+      cursor.handle_key(key)
 
       # redraws the rest of the interface if we're rendering on it again
-      if not cursor.isDone(): control.redraw()
+
+      if not cursor.is_done():
+        control.redraw()
   finally:
-    control.setMsg()
+    control.set_msg()
     arm.popups.finalize()
 
-def _drawSubmenu(cursor, level, top, left):
-  selectionHierarchy = cursor.getSelection().getHierarchy()
+
+def _draw_submenu(cursor, level, top, left):
+  selection_hierarchy = cursor.get_selection().get_hierarchy()
 
   # checks if there's nothing to display
-  if len(selectionHierarchy) < level + 2: return
+
+  if len(selection_hierarchy) < level + 2:
+    return
 
   # fetches the submenu and selection we're displaying
-  submenu = selectionHierarchy[level]
-  selection = selectionHierarchy[level + 1]
+
+  submenu = selection_hierarchy[level]
+  selection = selection_hierarchy[level + 1]
 
   # gets the size of the prefix, middle, and suffix columns
-  allLabelSets = [entry.getLabel() for entry in submenu.getChildren()]
-  prefixColSize = max([len(entry[0]) for entry in allLabelSets])
-  middleColSize = max([len(entry[1]) for entry in allLabelSets])
-  suffixColSize = max([len(entry[2]) for entry in allLabelSets])
+
+  all_label_sets = [entry.get_label() for entry in submenu.get_children()]
+  prefix_col_size = max([len(entry[0]) for entry in all_label_sets])
+  middle_col_size = max([len(entry[1]) for entry in all_label_sets])
+  suffix_col_size = max([len(entry[2]) for entry in all_label_sets])
 
   # formatted string so we can display aligned menu entries
-  labelFormat = " %%-%is%%-%is%%-%is " % (prefixColSize, middleColSize, suffixColSize)
-  menuWidth = len(labelFormat % ("", "", ""))
 
-  popup, _, _ = arm.popups.init(len(submenu.getChildren()), menuWidth, top, left, belowStatic = False)
-  if not popup: return
+  label_format = " %%-%is%%-%is%%-%is " % (prefix_col_size, middle_col_size, suffix_col_size)
+  menu_width = len(label_format % ("", "", ""))
+
+  popup, _, _ = arm.popups.init(len(submenu.get_children()), menu_width, top, left, below_static = False)
+
+  if not popup:
+    return
 
   try:
     # sets the background color
-    popup.win.bkgd(' ', curses.A_STANDOUT | uiTools.getColor("red"))
 
-    drawTop, selectionTop = 0, 0
-    for menuItem in submenu.getChildren():
-      if menuItem == selection:
-        drawFormat = curses.A_BOLD | uiTools.getColor("white")
-        selectionTop = drawTop
-      else: drawFormat = curses.A_NORMAL
+    popup.win.bkgd(' ', curses.A_STANDOUT | uiTools.get_color("red"))
 
-      popup.addstr(drawTop, 0, labelFormat % menuItem.getLabel(), drawFormat)
-      drawTop += 1
+    draw_top, selection_top = 0, 0
+
+    for menu_item in submenu.get_children():
+      if menu_item == selection:
+        draw_format = curses.A_BOLD | uiTools.get_color("white")
+        selection_top = draw_top
+      else:
+        draw_format = curses.A_NORMAL
+
+      popup.addstr(draw_top, 0, label_format % menu_item.get_label(), draw_format)
+      draw_top += 1
 
     popup.win.refresh()
 
     # shows the next submenu
-    _drawSubmenu(cursor, level + 1, top + selectionTop, left + menuWidth)
-  finally: arm.popups.finalize()
 
+    _draw_submenu(cursor, level + 1, top + selection_top, left + menu_width)
+  finally:
+    arm.popups.finalize()
diff --git a/arm/popups.py b/arm/popups.py
index c4aed89..dcf1f93 100644
--- a/arm/popups.py
+++ b/arm/popups.py
@@ -9,7 +9,8 @@ import arm.controller
 from arm import __version__, __release_date__
 from arm.util import panel, uiTools
 
-def init(height = -1, width = -1, top = 0, left = 0, belowStatic = True):
+
+def init(height = -1, width = -1, top = 0, left = 0, below_static = True):
   """
   Preparation for displaying a popup. This creates a popup with a valid
   subwindow instance. If that's successful then the curses lock is acquired
@@ -22,24 +23,30 @@ def init(height = -1, width = -1, top = 0, left = 0, belowStatic = True):
     width       - maximum width of the popup
     top         - top position, relative to the sticky content
     left        - left position from the screen
-    belowStatic - positions popup below static content if true
+    below_static - positions popup below static content if true
   """
 
-  control = arm.controller.getController()
-  if belowStatic:
-    stickyHeight = sum([stickyPanel.getHeight() for stickyPanel in control.getStickyPanels()])
-  else: stickyHeight = 0
+  control = arm.controller.get_controller()
+
+  if below_static:
+    sticky_height = sum([sticky_panel.get_height() for sticky_panel in control.get_sticky_panels()])
+  else:
+    sticky_height = 0
 
-  popup = panel.Panel(control.getScreen(), "popup", top + stickyHeight, left, height, width)
-  popup.setVisible(True)
+  popup = panel.Panel(control.get_screen(), "popup", top + sticky_height, left, height, width)
+  popup.set_visible(True)
 
   # Redraws the popup to prepare a subwindow instance. If none is spawned then
   # the panel can't be drawn (for instance, due to not being visible).
+
   popup.redraw(True)
-  if popup.win != None:
+
+  if popup.win is not None:
     panel.CURSES_LOCK.acquire()
-    return (popup, popup.maxX - 1, popup.maxY)
-  else: return (None, 0, 0)
+    return (popup, popup.max_x - 1, popup.max_y)
+  else:
+    return (None, 0, 0)
+
 
 def finalize():
   """
@@ -47,53 +54,60 @@ def finalize():
   the rest of the display.
   """
 
-  arm.controller.getController().requestRedraw()
+  arm.controller.get_controller().request_redraw()
   panel.CURSES_LOCK.release()
 
-def inputPrompt(msg, initialValue = ""):
+
+def input_prompt(msg, initial_value = ""):
   """
   Prompts the user to enter a string on the control line (which usually
   displays the page number and basic controls).
 
   Arguments:
     msg          - message to prompt the user for input with
-    initialValue - initial value of the field
+    initial_value - initial value of the field
   """
 
   panel.CURSES_LOCK.acquire()
-  control = arm.controller.getController()
-  msgPanel = control.getPanel("msg")
-  msgPanel.setMessage(msg)
-  msgPanel.redraw(True)
-  userInput = msgPanel.getstr(0, len(msg), initialValue)
-  control.setMsg()
+  control = arm.controller.get_controller()
+  msg_panel = control.get_panel("msg")
+  msg_panel.set_message(msg)
+  msg_panel.redraw(True)
+  user_input = msg_panel.getstr(0, len(msg), initial_value)
+  control.set_msg()
   panel.CURSES_LOCK.release()
-  return userInput
 
-def showMsg(msg, maxWait = -1, attr = curses.A_STANDOUT):
+  return user_input
+
+
+def show_msg(msg, max_wait = -1, attr = curses.A_STANDOUT):
   """
   Displays a single line message on the control line for a set time. Pressing
   any key will end the message. This returns the key pressed.
 
   Arguments:
     msg     - message to be displayed to the user
-    maxWait - time to show the message, indefinite if -1
+    max_wait - time to show the message, indefinite if -1
     attr    - attributes with which to draw the message
   """
 
   panel.CURSES_LOCK.acquire()
-  control = arm.controller.getController()
-  control.setMsg(msg, attr, True)
+  control = arm.controller.get_controller()
+  control.set_msg(msg, attr, True)
+
+  if max_wait == -1:
+    curses.cbreak()
+  else:
+    curses.halfdelay(max_wait * 10)
 
-  if maxWait == -1: curses.cbreak()
-  else: curses.halfdelay(maxWait * 10)
-  keyPress = control.getScreen().getch()
-  control.setMsg()
+  key_press = control.get_screen().getch()
+  control.set_msg()
   panel.CURSES_LOCK.release()
 
-  return keyPress
+  return key_press
+
 
-def showHelpPopup():
+def show_help_popup():
   """
   Presents a popup with instructions for the current page's hotkeys. This
   returns the user input used to close the popup. If the popup didn't close
@@ -101,33 +115,44 @@ def showHelpPopup():
   """
 
   popup, _, height = init(9, 80)
-  if not popup: return
 
-  exitKey = None
+  if not popup:
+    return
+
+  exit_key = None
+
   try:
-    control = arm.controller.getController()
-    pagePanels = control.getDisplayPanels()
+    control = arm.controller.get_controller()
+    page_panels = control.get_display_panels()
 
     # the first page is the only one with multiple panels, and it looks better
     # with the log entries first, so reversing the order
-    pagePanels.reverse()
 
-    helpOptions = []
-    for entry in pagePanels:
-      helpOptions += entry.getHelp()
+    page_panels.reverse()
+
+    help_options = []
+
+    for entry in page_panels:
+      help_options += entry.get_help()
 
     # test doing afterward in case of overwriting
+
     popup.win.box()
-    popup.addstr(0, 0, "Page %i Commands:" % (control.getPage() + 1), curses.A_STANDOUT)
+    popup.addstr(0, 0, "Page %i Commands:" % (control.get_page() + 1), curses.A_STANDOUT)
 
-    for i in range(len(helpOptions)):
-      if i / 2 >= height - 2: break
+    for i in range(len(help_options)):
+      if i / 2 >= height - 2:
+        break
 
       # draws entries in the form '<key>: <description>[ (<selection>)]', for
       # instance...
       # u: duplicate log entries (hidden)
-      key, description, selection = helpOptions[i]
-      if key: description = ": " + description
+
+      key, description, selection = help_options[i]
+
+      if key:
+        description = ": " + description
+
       row = (i / 2) + 1
       col = 2 if i % 2 == 0 else 41
 
@@ -142,30 +167,36 @@ def showHelpPopup():
         popup.addstr(row, col + 2 + len(selection), ")")
 
     # tells user to press a key if the lower left is unoccupied
-    if len(helpOptions) < 13 and height == 9:
+
+    if len(help_options) < 13 and height == 9:
       popup.addstr(7, 2, "Press any key...")
 
     popup.win.refresh()
     curses.cbreak()
-    exitKey = control.getScreen().getch()
-  finally: finalize()
+    exit_key = control.get_screen().getch()
+  finally:
+    finalize()
+
+  if not uiTools.is_selection_key(exit_key) and \
+    not uiTools.is_scroll_key(exit_key) and \
+    not exit_key in (curses.KEY_LEFT, curses.KEY_RIGHT):
+    return exit_key
+  else:
+    return None
 
-  if not uiTools.isSelectionKey(exitKey) and \
-    not uiTools.isScrollKey(exitKey) and \
-    not exitKey in (curses.KEY_LEFT, curses.KEY_RIGHT):
-    return exitKey
-  else: return None
 
-def showAboutPopup():
+def show_about_popup():
   """
   Presents a popup with author and version information.
   """
 
   popup, _, height = init(9, 80)
-  if not popup: return
+
+  if not popup:
+    return
 
   try:
-    control = arm.controller.getController()
+    control = arm.controller.get_controller()
 
     popup.win.box()
     popup.addstr(0, 0, "About:", curses.A_STANDOUT)
@@ -177,10 +208,12 @@ def showAboutPopup():
     popup.win.refresh()
 
     curses.cbreak()
-    control.getScreen().getch()
-  finally: finalize()
+    control.get_screen().getch()
+  finally:
+    finalize()
 
-def showSortDialog(title, options, oldSelection, optionColors):
+
+def show_sort_dialog(title, options, old_selection, option_colors):
   """
   Displays a sorting dialog of the form:
 
@@ -196,65 +229,78 @@ def showSortDialog(title, options, oldSelection, optionColors):
   Arguments:
     title   - title displayed for the popup window
     options      - ordered listing of option labels
-    oldSelection - current ordering
-    optionColors - mappings of options to their color
+    old_selection - current ordering
+    option_colors - mappings of options to their color
   """
 
   popup, _, _ = init(9, 80)
-  if not popup: return
-  newSelections = []  # new ordering
+
+  if not popup:
+    return
+
+  new_selections = []  # new ordering
 
   try:
-    cursorLoc = 0     # index of highlighted option
-    curses.cbreak()   # wait indefinitely for key presses (no timeout)
+    cursor_location = 0     # index of highlighted option
+    curses.cbreak()         # wait indefinitely for key presses (no timeout)
 
-    selectionOptions = list(options)
-    selectionOptions.append("Cancel")
+    selection_options = list(options)
+    selection_options.append("Cancel")
 
-    while len(newSelections) < len(oldSelection):
+    while len(new_selections) < len(old_selection):
       popup.win.erase()
       popup.win.box()
       popup.addstr(0, 0, title, curses.A_STANDOUT)
 
-      _drawSortSelection(popup, 1, 2, "Current Order: ", oldSelection, optionColors)
-      _drawSortSelection(popup, 2, 2, "New Order: ", newSelections, optionColors)
+      _draw_sort_selection(popup, 1, 2, "Current Order: ", old_selection, option_colors)
+      _draw_sort_selection(popup, 2, 2, "New Order: ", new_selections, option_colors)
 
       # presents remaining options, each row having up to four options with
       # spacing of nineteen cells
+
       row, col = 4, 0
-      for i in range(len(selectionOptions)):
-        optionFormat = curses.A_STANDOUT if cursorLoc == i else curses.A_NORMAL
-        popup.addstr(row, col * 19 + 2, selectionOptions[i], optionFormat)
+
+      for i in range(len(selection_options)):
+        option_format = curses.A_STANDOUT if cursor_location == i else curses.A_NORMAL
+        popup.addstr(row, col * 19 + 2, selection_options[i], option_format)
         col += 1
-        if col == 4: row, col = row + 1, 0
+
+        if col == 4:
+          row, col = row + 1, 0
 
       popup.win.refresh()
 
-      key = arm.controller.getController().getScreen().getch()
+      key = arm.controller.get_controller().get_screen().getch()
+
       if key == curses.KEY_LEFT:
-        cursorLoc = max(0, cursorLoc - 1)
+        cursor_location = max(0, cursor_location - 1)
       elif key == curses.KEY_RIGHT:
-        cursorLoc = min(len(selectionOptions) - 1, cursorLoc + 1)
+        cursor_location = min(len(selection_options) - 1, cursor_location + 1)
       elif key == curses.KEY_UP:
-        cursorLoc = max(0, cursorLoc - 4)
+        cursor_location = max(0, cursor_location - 4)
       elif key == curses.KEY_DOWN:
-        cursorLoc = min(len(selectionOptions) - 1, cursorLoc + 4)
-      elif uiTools.isSelectionKey(key):
-        selection = selectionOptions[cursorLoc]
+        cursor_location = min(len(selection_options) - 1, cursor_location + 4)
+      elif uiTools.is_selection_key(key):
+        selection = selection_options[cursor_location]
 
-        if selection == "Cancel": break
+        if selection == "Cancel":
+          break
         else:
-          newSelections.append(selection)
-          selectionOptions.remove(selection)
-          cursorLoc = min(cursorLoc, len(selectionOptions) - 1)
-      elif key == 27: break # esc - cancel
-  finally: finalize()
+          new_selections.append(selection)
+          selection_options.remove(selection)
+          cursor_location = min(cursor_location, len(selection_options) - 1)
+      elif key == 27:
+        break  # esc - cancel
+  finally:
+    finalize()
+
+  if len(new_selections) == len(old_selection):
+    return new_selections
+  else:
+    return None
 
-  if len(newSelections) == len(oldSelection):
-    return newSelections
-  else: return None
 
-def _drawSortSelection(popup, y, x, prefix, options, optionColors):
+def _draw_sort_selection(popup, y, x, prefix, options, option_colors):
   """
   Draws a series of comma separated sort selections. The whole line is bold
   and sort options also have their specified color. Example:
@@ -267,24 +313,26 @@ def _drawSortSelection(popup, y, x, prefix, options, optionColors):
     x            - horizontal location
     prefix       - initial string description
     options      - sort options to be shown
-    optionColors - mappings of options to their color
+    option_colors - mappings of options to their color
   """
 
   popup.addstr(y, x, prefix, curses.A_BOLD)
   x += len(prefix)
 
   for i in range(len(options)):
-    sortType = options[i]
-    sortColor = uiTools.getColor(optionColors.get(sortType, "white"))
-    popup.addstr(y, x, sortType, sortColor | curses.A_BOLD)
-    x += len(sortType)
+    sort_type = options[i]
+    sort_color = uiTools.get_color(option_colors.get(sort_type, "white"))
+    popup.addstr(y, x, sort_type, sort_color | curses.A_BOLD)
+    x += len(sort_type)
 
     # comma divider between options, if this isn't the last
+
     if i < len(options) - 1:
       popup.addstr(y, x, ", ", curses.A_BOLD)
       x += 2
 
-def showMenu(title, options, oldSelection):
+
+def show_menu(title, options, old_selection):
   """
   Provides menu with options laid out in a single column. User can cancel
   selection with the escape key, in which case this proives -1. Otherwise this
@@ -293,25 +341,29 @@ def showMenu(title, options, oldSelection):
   Arguments:
     title        - title displayed for the popup window
     options      - ordered listing of options to display
-    oldSelection - index of the initially selected option (uses the first
+    old_selection - index of the initially selected option (uses the first
                    selection without a carrot if -1)
   """
 
-  maxWidth = max(map(len, options)) + 9
-  popup, _, _ = init(len(options) + 2, maxWidth)
-  if not popup: return
-  key, selection = 0, oldSelection if oldSelection != -1 else 0
+  max_width = max(map(len, options)) + 9
+  popup, _, _ = init(len(options) + 2, max_width)
+
+  if not popup:
+    return
+
+  key, selection = 0, old_selection if old_selection != -1 else 0
 
   try:
     # hides the title of the first panel on the page
-    control = arm.controller.getController()
-    topPanel = control.getDisplayPanels(includeSticky = False)[0]
-    topPanel.setTitleVisible(False)
-    topPanel.redraw(True)
+
+    control = arm.controller.get_controller()
+    top_panel = control.get_display_panels(include_sticky = False)[0]
+    top_panel.set_title_visible(False)
+    top_panel.redraw(True)
 
     curses.cbreak()   # wait indefinitely for key presses (no timeout)
 
-    while not uiTools.isSelectionKey(key):
+    while not uiTools.is_selection_key(key):
       popup.win.erase()
       popup.win.box()
       popup.addstr(0, 0, title, curses.A_STANDOUT)
@@ -319,19 +371,22 @@ def showMenu(title, options, oldSelection):
       for i in range(len(options)):
         label = options[i]
         format = curses.A_STANDOUT if i == selection else curses.A_NORMAL
-        tab = "> " if i == oldSelection else "  "
+        tab = "> " if i == old_selection else "  "
         popup.addstr(i + 1, 2, tab)
         popup.addstr(i + 1, 4, " %s " % label, format)
 
       popup.win.refresh()
 
-      key = control.getScreen().getch()
-      if key == curses.KEY_UP: selection = max(0, selection - 1)
-      elif key == curses.KEY_DOWN: selection = min(len(options) - 1, selection + 1)
-      elif key == 27: selection, key = -1, curses.KEY_ENTER # esc - cancel
+      key = control.get_screen().getch()
+
+      if key == curses.KEY_UP:
+        selection = max(0, selection - 1)
+      elif key == curses.KEY_DOWN:
+        selection = min(len(options) - 1, selection + 1)
+      elif key == 27:
+        selection, key = -1, curses.KEY_ENTER  # esc - cancel
   finally:
-    topPanel.setTitleVisible(True)
+    top_panel.set_title_visible(True)
     finalize()
 
   return selection
-
diff --git a/arm/starter.py b/arm/starter.py
index c974f2c..5b3bfc3 100644
--- a/arm/starter.py
+++ b/arm/starter.py
@@ -72,7 +72,7 @@ def main():
     # TODO: Our tor_controller() method will gradually replace the torTools
     # module, but until that we need to initialize it too.
 
-    arm.util.torTools.getConn().init(controller)
+    arm.util.torTools.get_conn().init(controller)
   except ValueError as exc:
     print exc
     exit(1)
@@ -232,7 +232,7 @@ def _load_tor_config_descriptions():
   Attempt to determine descriptions for tor's configuration options.
   """
 
-  arm.util.torConfig.loadConfigurationDescriptions(BASE_DIR)
+  arm.util.torConfig.load_configuration_descriptions(BASE_DIR)
 
 
 def _use_english_subcommands():
diff --git a/arm/torrcPanel.py b/arm/torrcPanel.py
index 4940302..51ff1a1 100644
--- a/arm/torrcPanel.py
+++ b/arm/torrcPanel.py
@@ -13,18 +13,21 @@ from arm.util import panel, torConfig, torTools, uiTools
 from stem.control import State
 from stem.util import conf, enum
 
+
 def conf_handler(key, value):
-  if key == "features.config.file.maxLinesPerEntry":
+  if key == "features.config.file.max_lines_per_entry":
     return max(1, value)
 
+
 CONFIG = conf.config_dict("arm", {
   "features.config.file.showScrollbars": True,
-  "features.config.file.maxLinesPerEntry": 8,
+  "features.config.file.max_lines_per_entry": 8,
 }, conf_handler)
 
 # TODO: The armrc use case is incomplete. There should be equivilant reloading
 # and validation capabilities to the torrc.
-Config = enum.Enum("TORRC", "ARMRC") # configuration file types that can be displayed
+Config = enum.Enum("TORRC", "ARMRC")  # configuration file types that can be displayed
+
 
 class TorrcPanel(panel.Panel):
   """
@@ -32,280 +35,319 @@ class TorrcPanel(panel.Panel):
   area.
   """
 
-  def __init__(self, stdscr, configType):
+  def __init__(self, stdscr, config_type):
     panel.Panel.__init__(self, stdscr, "torrc", 0)
 
-    self.valsLock = threading.RLock()
-    self.configType = configType
+    self.vals_lock = threading.RLock()
+    self.config_type = config_type
     self.scroll = 0
-    self.showLineNum = True     # shows left aligned line numbers
-    self.stripComments = False  # drops comments and extra whitespace
+    self.show_line_num = True     # shows left aligned line numbers
+    self.strip_comments = False   # drops comments and extra whitespace
 
     # height of the content when last rendered (the cached value is invalid if
-    # _lastContentHeightArgs is None or differs from the current dimensions)
-    self._lastContentHeight = 1
-    self._lastContentHeightArgs = None
+    # _last_content_height_args is None or differs from the current dimensions)
+
+    self._last_content_height = 1
+    self._last_content_height_args = None
 
     # listens for tor reload (sighup) events
-    conn = torTools.getConn()
-    conn.addStatusListener(self.resetListener)
-    if conn.isAlive(): self.resetListener(None, State.INIT, None)
 
-  def resetListener(self, controller, eventType, _):
+    conn = torTools.get_conn()
+    conn.add_status_listener(self.reset_listener)
+
+    if conn.is_alive():
+      self.reset_listener(None, State.INIT, None)
+
+  def reset_listener(self, controller, event_type, _):
     """
     Reloads and displays the torrc on tor reload (sighup) events.
     """
 
-    if eventType == State.INIT:
+    if event_type == State.INIT:
       # loads the torrc and provides warnings in case of validation errors
+
       try:
-        loadedTorrc = torConfig.getTorrc()
-        loadedTorrc.load(True)
-        loadedTorrc.logValidationIssues()
+        loaded_torrc = torConfig.get_torrc()
+        loaded_torrc.load(True)
+        loaded_torrc.log_validation_issues()
         self.redraw(True)
-      except: pass
-    elif eventType == State.RESET:
+      except:
+        pass
+    elif event_type == State.RESET:
       try:
-        torConfig.getTorrc().load(True)
+        torConfig.get_torrc().load(True)
         self.redraw(True)
-      except: pass
+      except:
+        pass
 
-  def setCommentsVisible(self, isVisible):
+  def set_comments_visible(self, is_visible):
     """
     Sets if comments and blank lines are shown or stripped.
 
     Arguments:
-      isVisible - displayed comments and blank lines if true, strips otherwise
+      is_visible - displayed comments and blank lines if true, strips otherwise
     """
 
-    self.stripComments = not isVisible
-    self._lastContentHeightArgs = None
+    self.strip_comments = not is_visible
+    self._last_content_height_args = None
     self.redraw(True)
 
-  def setLineNumberVisible(self, isVisible):
+  def set_line_number_visible(self, is_visible):
     """
     Sets if line numbers are shown or hidden.
 
     Arguments:
-      isVisible - displays line numbers if true, hides otherwise
+      is_visible - displays line numbers if true, hides otherwise
     """
 
-    self.showLineNum = isVisible
-    self._lastContentHeightArgs = None
+    self.show_line_num = is_visible
+    self._last_content_height_args = None
     self.redraw(True)
 
-  def reloadTorrc(self):
+  def reload_torrc(self):
     """
     Reloads the torrc, displaying an indicator of success or failure.
     """
 
     try:
-      torConfig.getTorrc().load()
-      self._lastContentHeightArgs = None
+      torConfig.get_torrc().load()
+      self._last_content_height_args = None
       self.redraw(True)
-      resultMsg = "torrc reloaded"
+      result_msg = "torrc reloaded"
     except IOError:
-      resultMsg = "failed to reload torrc"
+      result_msg = "failed to reload torrc"
 
-    self._lastContentHeightArgs = None
+    self._last_content_height_args = None
     self.redraw(True)
-    arm.popups.showMsg(resultMsg, 1)
+    arm.popups.show_msg(result_msg, 1)
 
-  def handleKey(self, key):
-    self.valsLock.acquire()
-    isKeystrokeConsumed = True
-    if uiTools.isScrollKey(key):
-      pageHeight = self.getPreferredSize()[0] - 1
-      newScroll = uiTools.getScrollPosition(key, self.scroll, pageHeight, self._lastContentHeight)
+  def handle_key(self, key):
+    self.vals_lock.acquire()
+    is_keystroke_consumed = True
+    if uiTools.is_scroll_key(key):
+      page_height = self.get_preferred_size()[0] - 1
+      new_scroll = uiTools.get_scroll_position(key, self.scroll, page_height, self._last_content_height)
 
-      if self.scroll != newScroll:
-        self.scroll = newScroll
+      if self.scroll != new_scroll:
+        self.scroll = new_scroll
         self.redraw(True)
     elif key == ord('n') or key == ord('N'):
-      self.setLineNumberVisible(not self.showLineNum)
+      self.set_line_number_visible(not self.show_line_num)
     elif key == ord('s') or key == ord('S'):
-      self.setCommentsVisible(self.stripComments)
+      self.set_comments_visible(self.strip_comments)
     elif key == ord('r') or key == ord('R'):
-      self.reloadTorrc()
-    else: isKeystrokeConsumed = False
+      self.reload_torrc()
+    else:
+      is_keystroke_consumed = False
 
-    self.valsLock.release()
-    return isKeystrokeConsumed
+    self.vals_lock.release()
+    return is_keystroke_consumed
 
-  def setVisible(self, isVisible):
-    if not isVisible:
-      self._lastContentHeightArgs = None # redraws when next displayed
+  def set_visible(self, is_visible):
+    if not is_visible:
+      self._last_content_height_args = None  # redraws when next displayed
 
-    panel.Panel.setVisible(self, isVisible)
+    panel.Panel.set_visible(self, is_visible)
 
-  def getHelp(self):
+  def get_help(self):
     options = []
     options.append(("up arrow", "scroll up a line", None))
     options.append(("down arrow", "scroll down a line", None))
     options.append(("page up", "scroll up a page", None))
     options.append(("page down", "scroll down a page", None))
-    options.append(("s", "comment stripping", "on" if self.stripComments else "off"))
-    options.append(("n", "line numbering", "on" if self.showLineNum else "off"))
+    options.append(("s", "comment stripping", "on" if self.strip_comments else "off"))
+    options.append(("n", "line numbering", "on" if self.show_line_num else "off"))
     options.append(("r", "reload torrc", None))
     options.append(("x", "reset tor (issue sighup)", None))
     return options
 
   def draw(self, width, height):
-    self.valsLock.acquire()
+    self.vals_lock.acquire()
 
-    # If true, we assume that the cached value in self._lastContentHeight is
+    # If true, we assume that the cached value in self._last_content_height is
     # still accurate, and stop drawing when there's nothing more to display.
-    # Otherwise the self._lastContentHeight is suspect, and we'll process all
+    # Otherwise the self._last_content_height is suspect, and we'll process all
     # the content to check if it's right (and redraw again with the corrected
     # height if not).
-    trustLastContentHeight = self._lastContentHeightArgs == (width, height)
+
+    trust_last_content_height = self._last_content_height_args == (width, height)
 
     # restricts scroll location to valid bounds
-    self.scroll = max(0, min(self.scroll, self._lastContentHeight - height + 1))
 
-    renderedContents, corrections, confLocation = None, {}, None
-    if self.configType == Config.TORRC:
-      loadedTorrc = torConfig.getTorrc()
-      loadedTorrc.getLock().acquire()
-      confLocation = loadedTorrc.getConfigLocation()
+    self.scroll = max(0, min(self.scroll, self._last_content_height - height + 1))
 
-      if not loadedTorrc.isLoaded():
-        renderedContents = ["### Unable to load the torrc ###"]
+    rendered_contents, corrections, conf_location = None, {}, None
+
+    if self.config_type == Config.TORRC:
+      loaded_torrc = torConfig.get_torrc()
+      loaded_torrc.get_lock().acquire()
+      conf_location = loaded_torrc.get_config_location()
+
+      if not loaded_torrc.is_loaded():
+        rendered_contents = ["### Unable to load the torrc ###"]
       else:
-        renderedContents = loadedTorrc.getDisplayContents(self.stripComments)
+        rendered_contents = loaded_torrc.get_display_contents(self.strip_comments)
 
         # constructs a mapping of line numbers to the issue on it
-        corrections = dict((lineNum, (issue, msg)) for lineNum, issue, msg in loadedTorrc.getCorrections())
 
-      loadedTorrc.getLock().release()
+        corrections = dict((line_number, (issue, msg)) for line_number, issue, msg in loaded_torrc.get_corrections())
+
+      loaded_torrc.get_lock().release()
     else:
-      loadedArmrc = conf.get_config("arm")
-      confLocation = loadedArmrc._path
-      renderedContents = list(loadedArmrc._raw_contents)
+      loaded_armrc = conf.get_config("arm")
+      conf_location = loaded_armrc._path
+      rendered_contents = list(loaded_armrc._raw_contents)
 
     # offset to make room for the line numbers
-    lineNumOffset = 0
-    if self.showLineNum:
-      if len(renderedContents) == 0: lineNumOffset = 2
-      else: lineNumOffset = int(math.log10(len(renderedContents))) + 2
+
+    line_number_offset = 0
+
+    if self.show_line_num:
+      if len(rendered_contents) == 0:
+        line_number_offset = 2
+      else:
+        line_number_offset = int(math.log10(len(rendered_contents))) + 2
 
     # draws left-hand scroll bar if content's longer than the height
-    scrollOffset = 0
-    if CONFIG["features.config.file.showScrollbars"] and self._lastContentHeight > height - 1:
-      scrollOffset = 3
-      self.addScrollBar(self.scroll, self.scroll + height - 1, self._lastContentHeight, 1)
 
-    displayLine = -self.scroll + 1 # line we're drawing on
+    scroll_offset = 0
+
+    if CONFIG["features.config.file.showScrollbars"] and self._last_content_height > height - 1:
+      scroll_offset = 3
+      self.add_scroll_bar(self.scroll, self.scroll + height - 1, self._last_content_height, 1)
+
+    display_line = -self.scroll + 1  # line we're drawing on
 
     # draws the top label
-    if self.isTitleVisible():
-      sourceLabel = "Tor" if self.configType == Config.TORRC else "Arm"
-      locationLabel = " (%s)" % confLocation if confLocation else ""
-      self.addstr(0, 0, "%s Configuration File%s:" % (sourceLabel, locationLabel), curses.A_STANDOUT)
 
-    isMultiline = False # true if we're in the middle of a multiline torrc entry
-    for lineNumber in range(0, len(renderedContents)):
-      lineText = renderedContents[lineNumber]
-      lineText = lineText.rstrip() # remove ending whitespace
+    if self.is_title_visible():
+      source_label = "Tor" if self.config_type == Config.TORRC else "Arm"
+      location_label = " (%s)" % conf_location if conf_location else ""
+      self.addstr(0, 0, "%s Configuration File%s:" % (source_label, location_label), curses.A_STANDOUT)
+
+    is_multiline = False  # true if we're in the middle of a multiline torrc entry
+
+    for line_number in range(0, len(rendered_contents)):
+      line_text = rendered_contents[line_number]
+      line_text = line_text.rstrip()  # remove ending whitespace
 
       # blank lines are hidden when stripping comments
-      if self.stripComments and not lineText: continue
+
+      if self.strip_comments and not line_text:
+        continue
 
       # splits the line into its component (msg, format) tuples
-      lineComp = {"option": ["", curses.A_BOLD | uiTools.getColor("green")],
-                  "argument": ["", curses.A_BOLD | uiTools.getColor("cyan")],
-                  "correction": ["", curses.A_BOLD | uiTools.getColor("cyan")],
-                  "comment": ["", uiTools.getColor("white")]}
+
+      line_comp = {
+        "option": ["", curses.A_BOLD | uiTools.get_color("green")],
+        "argument": ["", curses.A_BOLD | uiTools.get_color("cyan")],
+        "correction": ["", curses.A_BOLD | uiTools.get_color("cyan")],
+        "comment": ["", uiTools.get_color("white")],
+      }
 
       # parses the comment
-      commentIndex = lineText.find("#")
-      if commentIndex != -1:
-        lineComp["comment"][0] = lineText[commentIndex:]
-        lineText = lineText[:commentIndex]
+
+      comment_index = line_text.find("#")
+
+      if comment_index != -1:
+        line_comp["comment"][0] = line_text[comment_index:]
+        line_text = line_text[:comment_index]
 
       # splits the option and argument, preserving any whitespace around them
-      strippedLine = lineText.strip()
-      optionIndex = strippedLine.find(" ")
-      if isMultiline:
+
+      stripped_line = line_text.strip()
+      option_index = stripped_line.find(" ")
+
+      if is_multiline:
         # part of a multiline entry started on a previous line so everything
         # is part of the argument
-        lineComp["argument"][0] = lineText
-      elif optionIndex == -1:
+        line_comp["argument"][0] = line_text
+      elif option_index == -1:
         # no argument provided
-        lineComp["option"][0] = lineText
+        line_comp["option"][0] = line_text
       else:
-        optionText = strippedLine[:optionIndex]
-        optionEnd = lineText.find(optionText) + len(optionText)
-        lineComp["option"][0] = lineText[:optionEnd]
-        lineComp["argument"][0] = lineText[optionEnd:]
+        option_text = stripped_line[:option_index]
+        option_end = line_text.find(option_text) + len(option_text)
+        line_comp["option"][0] = line_text[:option_end]
+        line_comp["argument"][0] = line_text[option_end:]
 
       # flags following lines as belonging to this multiline entry if it ends
       # with a slash
-      if strippedLine: isMultiline = strippedLine.endswith("\\")
+
+      if stripped_line:
+        is_multiline = stripped_line.endswith("\\")
 
       # gets the correction
-      if lineNumber in corrections:
-        lineIssue, lineIssueMsg = corrections[lineNumber]
-
-        if lineIssue in (torConfig.ValidationError.DUPLICATE, torConfig.ValidationError.IS_DEFAULT):
-          lineComp["option"][1] = curses.A_BOLD | uiTools.getColor("blue")
-          lineComp["argument"][1] = curses.A_BOLD | uiTools.getColor("blue")
-        elif lineIssue == torConfig.ValidationError.MISMATCH:
-          lineComp["argument"][1] = curses.A_BOLD | uiTools.getColor("red")
-          lineComp["correction"][0] = " (%s)" % lineIssueMsg
+
+      if line_number in corrections:
+        line_issue, line_issue_msg = corrections[line_number]
+
+        if line_issue in (torConfig.ValidationError.DUPLICATE, torConfig.ValidationError.IS_DEFAULT):
+          line_comp["option"][1] = curses.A_BOLD | uiTools.get_color("blue")
+          line_comp["argument"][1] = curses.A_BOLD | uiTools.get_color("blue")
+        elif line_issue == torConfig.ValidationError.MISMATCH:
+          line_comp["argument"][1] = curses.A_BOLD | uiTools.get_color("red")
+          line_comp["correction"][0] = " (%s)" % line_issue_msg
         else:
           # For some types of configs the correction field is simply used to
           # provide extra data (for instance, the type for tor state fields).
-          lineComp["correction"][0] = " (%s)" % lineIssueMsg
-          lineComp["correction"][1] = curses.A_BOLD | uiTools.getColor("magenta")
+
+          line_comp["correction"][0] = " (%s)" % line_issue_msg
+          line_comp["correction"][1] = curses.A_BOLD | uiTools.get_color("magenta")
 
       # draws the line number
-      if self.showLineNum and displayLine < height and displayLine >= 1:
-        lineNumStr = ("%%%ii" % (lineNumOffset - 1)) % (lineNumber + 1)
-        self.addstr(displayLine, scrollOffset, lineNumStr, curses.A_BOLD | uiTools.getColor("yellow"))
+
+      if self.show_line_num and display_line < height and display_line >= 1:
+        line_number_str = ("%%%ii" % (line_number_offset - 1)) % (line_number + 1)
+        self.addstr(display_line, scroll_offset, line_number_str, curses.A_BOLD | uiTools.get_color("yellow"))
 
       # draws the rest of the components with line wrap
-      cursorLoc, lineOffset = lineNumOffset + scrollOffset, 0
-      maxLinesPerEntry = CONFIG["features.config.file.maxLinesPerEntry"]
-      displayQueue = [lineComp[entry] for entry in ("option", "argument", "correction", "comment")]
 
-      while displayQueue:
-        msg, format = displayQueue.pop(0)
+      cursor_location, line_offset = line_number_offset + scroll_offset, 0
+      max_lines_per_entry = CONFIG["features.config.file.max_lines_per_entry"]
+      display_queue = [line_comp[entry] for entry in ("option", "argument", "correction", "comment")]
+
+      while display_queue:
+        msg, format = display_queue.pop(0)
+
+        max_msg_size, include_break = width - cursor_location, False
 
-        maxMsgSize, includeBreak = width - cursorLoc, False
-        if len(msg) >= maxMsgSize:
+        if len(msg) >= max_msg_size:
           # message is too long - break it up
-          if lineOffset == maxLinesPerEntry - 1:
-            msg = uiTools.cropStr(msg, maxMsgSize)
+
+          if line_offset == max_lines_per_entry - 1:
+            msg = uiTools.crop_str(msg, max_msg_size)
           else:
-            includeBreak = True
-            msg, remainder = uiTools.cropStr(msg, maxMsgSize, 4, 4, uiTools.Ending.HYPHEN, True)
-            displayQueue.insert(0, (remainder.strip(), format))
+            include_break = True
+            msg, remainder = uiTools.crop_str(msg, max_msg_size, 4, 4, uiTools.Ending.HYPHEN, True)
+            display_queue.insert(0, (remainder.strip(), format))
+
+        draw_line = display_line + line_offset
 
-        drawLine = displayLine + lineOffset
-        if msg and drawLine < height and drawLine >= 1:
-          self.addstr(drawLine, cursorLoc, msg, format)
+        if msg and draw_line < height and draw_line >= 1:
+          self.addstr(draw_line, cursor_location, msg, format)
 
         # If we're done, and have added content to this line, then start
         # further content on the next line.
-        cursorLoc += len(msg)
-        includeBreak |= not displayQueue and cursorLoc != lineNumOffset + scrollOffset
 
-        if includeBreak:
-          lineOffset += 1
-          cursorLoc = lineNumOffset + scrollOffset
+        cursor_location += len(msg)
+        include_break |= not display_queue and cursor_location != line_number_offset + scroll_offset
 
-      displayLine += max(lineOffset, 1)
+        if include_break:
+          line_offset += 1
+          cursor_location = line_number_offset + scroll_offset
 
-      if trustLastContentHeight and displayLine >= height: break
+      display_line += max(line_offset, 1)
 
-    if not trustLastContentHeight:
-      self._lastContentHeightArgs = (width, height)
-      newContentHeight = displayLine + self.scroll - 1
+      if trust_last_content_height and display_line >= height:
+        break
 
-      if self._lastContentHeight != newContentHeight:
-        self._lastContentHeight = newContentHeight
-        self.redraw(True)
+    if not trust_last_content_height:
+      self._last_content_height_args = (width, height)
+      new_content_height = display_line + self.scroll - 1
 
-    self.valsLock.release()
+      if self._last_content_height != new_content_height:
+        self._last_content_height = new_content_height
+        self.redraw(True)
 
+    self.vals_lock.release()
diff --git a/arm/util/panel.py b/arm/util/panel.py
index fb33c7a..c34ac5e 100644
--- a/arm/util/panel.py
+++ b/arm/util/panel.py
@@ -15,19 +15,30 @@ from stem.util import log
 
 # global ui lock governing all panel instances (curses isn't thread save and
 # concurrency bugs produce especially sinister glitches)
+
 CURSES_LOCK = RLock()
 
+
 # tags used by addfstr - this maps to functor/argument combinations since the
 # actual values (in the case of color attributes) might not yet be initialized
-def _noOp(arg): return arg
-FORMAT_TAGS = {"<b>": (_noOp, curses.A_BOLD),
-               "<u>": (_noOp, curses.A_UNDERLINE),
-               "<h>": (_noOp, curses.A_STANDOUT)}
-for colorLabel in uiTools.COLOR_LIST: FORMAT_TAGS["<%s>" % colorLabel] = (uiTools.getColor, colorLabel)
+
+def _no_op(arg):
+  return arg
+
+
+FORMAT_TAGS = {
+  "<b>": (_no_op, curses.A_BOLD),
+  "<u>": (_no_op, curses.A_UNDERLINE),
+  "<h>": (_no_op, curses.A_STANDOUT),
+}
+
+for color_label in uiTools.COLOR_LIST:
+  FORMAT_TAGS["<%s>" % color_label] = (uiTools.get_color, color_label)
 
 # prevents curses redraws if set
 HALT_ACTIVITY = False
 
+
 class Panel():
   """
   Wrapper for curses subwindows. This hides most of the ugliness in common
@@ -42,7 +53,7 @@ class Panel():
   redraw().
   """
 
-  def __init__(self, parent, name, top, left=0, height=-1, width=-1):
+  def __init__(self, parent, name, top, left = 0, height = -1, width = -1):
     """
     Creates a durable wrapper for a curses subwindow in the given parent.
 
@@ -59,19 +70,19 @@ class Panel():
     # implementations aren't entirely deterministic (for instance panels
     # might chose their height based on its parent's current width).
 
-    self.panelName = name
+    self.panel_name = name
     self.parent = parent
     self.visible = False
-    self.titleVisible = True
+    self.title_visible = True
 
-    # Attributes for pausing. The pauseAttr contains variables our getAttr
+    # Attributes for pausing. The pause_attr contains variables our get_attr
     # method is tracking, and the pause buffer has copies of the values from
     # when we were last unpaused (unused unless we're paused).
 
     self.paused = False
-    self.pauseAttr = []
-    self.pauseBuffer = {}
-    self.pauseTime = -1
+    self.pause_attr = []
+    self.pause_buffer = {}
+    self.pause_time = -1
 
     self.top = top
     self.left = left
@@ -85,97 +96,86 @@ class Panel():
     # remade before it's used. The later could be for a couple reasons:
     # - The subwindow was never initialized.
     # - Any of the parameters used for subwindow initialization have changed.
+
     self.win = None
 
-    self.maxY, self.maxX = -1, -1 # subwindow dimensions when last redrawn
+    self.max_y, self.max_x = -1, -1  # subwindow dimensions when last redrawn
 
-  def getName(self):
+  def get_name(self):
     """
     Provides panel's identifier.
     """
 
-    return self.panelName
+    return self.panel_name
 
-  def isTitleVisible(self):
+  def is_title_visible(self):
     """
     True if the title is configured to be visible, False otherwise.
     """
 
-    return self.titleVisible
+    return self.title_visible
 
-  def setTitleVisible(self, isVisible):
+  def set_title_visible(self, is_visible):
     """
     Configures the panel's title to be visible or not when it's next redrawn.
     This is not guarenteed to be respected (not all panels have a title).
     """
 
-    self.titleVisible = isVisible
+    self.title_visible = is_visible
 
-  def getParent(self):
+  def get_parent(self):
     """
     Provides the parent used to create subwindows.
     """
 
     return self.parent
 
-  def setParent(self, parent):
-    """
-    Changes the parent used to create subwindows.
-
-    Arguments:
-      parent - parent curses window
-    """
-
-    if self.parent != parent:
-      self.parent = parent
-      self.win = None
-
-  def isVisible(self):
+  def is_visible(self):
     """
     Provides if the panel's configured to be visible or not.
     """
 
     return self.visible
 
-  def setVisible(self, isVisible):
+  def set_visible(self, is_visible):
     """
     Toggles if the panel is visible or not.
 
     Arguments:
-      isVisible - panel is redrawn when requested if true, skipped otherwise
+      is_visible - panel is redrawn when requested if true, skipped otherwise
     """
 
-    self.visible = isVisible
+    self.visible = is_visible
 
-  def isPaused(self):
+  def is_paused(self):
     """
     Provides if the panel's configured to be paused or not.
     """
 
     return self.paused
 
-  def setPauseAttr(self, attr):
+  def set_pause_attr(self, attr):
     """
-    Configures the panel to track the given attribute so that getAttr provides
+    Configures the panel to track the given attribute so that get_attr provides
     the value when it was last unpaused (or its current value if we're
     currently unpaused). For instance...
 
-    > self.setPauseAttr("myVar")
+    > self.set_pause_attr("myVar")
     > self.myVar = 5
-    > self.myVar = 6 # self.getAttr("myVar") -> 6
-    > self.setPaused(True)
-    > self.myVar = 7 # self.getAttr("myVar") -> 6
-    > self.setPaused(False)
-    > self.myVar = 7 # self.getAttr("myVar") -> 7
+    > self.myVar = 6  # self.get_attr("myVar") -> 6
+    > self.set_paused(True)
+    > self.myVar = 7  # self.get_attr("myVar") -> 6
+    > self.set_paused(False)
+    > self.myVar = 7  # self.get_attr("myVar") -> 7
 
     Arguments:
-      attr - parameter to be tracked for getAttr
+      attr - parameter to be tracked for get_attr
     """
 
-    self.pauseAttr.append(attr)
-    self.pauseBuffer[attr] = self.copyAttr(attr)
+    self.pause_attr.append(attr)
+    self.pause_buffer[attr] = self.copy_attr(attr)
 
-  def getAttr(self, attr):
+  def get_attr(self, attr):
     """
     Provides the value of the given attribute when we were last unpaused. If
     we're currently unpaused then this is the current value. If untracked this
@@ -185,11 +185,14 @@ class Panel():
       attr - local variable to be returned
     """
 
-    if not attr in self.pauseAttr: return None
-    elif self.paused: return self.pauseBuffer[attr]
-    else: return self.__dict__.get(attr)
+    if not attr in self.pause_attr:
+      return None
+    elif self.paused:
+      return self.pause_buffer[attr]
+    else:
+      return self.__dict__.get(attr)
 
-  def copyAttr(self, attr):
+  def copy_attr(self, attr):
     """
     Provides a duplicate of the given configuration value, suitable for the
     pause buffer.
@@ -198,10 +201,10 @@ class Panel():
       attr - parameter to be provided back
     """
 
-    currentValue = self.__dict__.get(attr)
-    return copy.copy(currentValue)
+    current_value = self.__dict__.get(attr)
+    return copy.copy(current_value)
 
-  def setPaused(self, isPause, suppressRedraw = False):
+  def set_paused(self, is_pause, suppress_redraw = False):
     """
     Toggles if the panel is paused or not. This causes the panel to be redrawn
     when toggling is pause state unless told to do otherwise. This is
@@ -211,40 +214,46 @@ class Panel():
     This returns True if the panel's pause state was changed, False otherwise.
 
     Arguments:
-      isPause        - freezes the state of the pause attributes if true, makes
-                       them editable otherwise
-      suppressRedraw - if true then this will never redraw the panel
+      is_pause        - freezes the state of the pause attributes if true, makes
+                        them editable otherwise
+      suppress_redraw - if true then this will never redraw the panel
     """
 
-    if isPause != self.paused:
-      if isPause: self.pauseTime = time.time()
-      self.paused = isPause
+    if is_pause != self.paused:
+      if is_pause:
+        self.pause_time = time.time()
 
-      if isPause:
+      self.paused = is_pause
+
+      if is_pause:
         # copies tracked attributes so we know what they were before pausing
-        for attr in self.pauseAttr:
-          self.pauseBuffer[attr] = self.copyAttr(attr)
 
-      if not suppressRedraw: self.redraw(True)
+        for attr in self.pause_attr:
+          self.pause_buffer[attr] = self.copy_attr(attr)
+
+      if not suppress_redraw:
+        self.redraw(True)
+
       return True
-    else: return False
+    else:
+      return False
 
-  def getPauseTime(self):
+  def get_pause_time(self):
     """
     Provides the time that we were last paused, returning -1 if we've never
     been paused.
     """
 
-    return self.pauseTime
+    return self.pause_time
 
-  def getTop(self):
+  def get_top(self):
     """
     Provides the position subwindows are placed at within its parent.
     """
 
     return self.top
 
-  def setTop(self, top):
+  def set_top(self, top):
     """
     Changes the position where subwindows are placed within its parent.
 
@@ -256,7 +265,7 @@ class Panel():
       self.top = top
       self.win = None
 
-  def getLeft(self):
+  def get_left(self):
     """
     Provides the left position where this subwindow is placed within its
     parent.
@@ -264,7 +273,7 @@ class Panel():
 
     return self.left
 
-  def setLeft(self, left):
+  def set_left(self, left):
     """
     Changes the left position where this subwindow is placed within its parent.
 
@@ -276,14 +285,14 @@ class Panel():
       self.left = left
       self.win = None
 
-  def getHeight(self):
+  def get_height(self):
     """
     Provides the height used for subwindows (-1 if it isn't limited).
     """
 
     return self.height
 
-  def setHeight(self, height):
+  def set_height(self, height):
     """
     Changes the height used for subwindows. This uses all available space if -1.
 
@@ -295,14 +304,14 @@ class Panel():
       self.height = height
       self.win = None
 
-  def getWidth(self):
+  def get_width(self):
     """
     Provides the width used for subwindows (-1 if it isn't limited).
     """
 
     return self.width
 
-  def setWidth(self, width):
+  def set_width(self, width):
     """
     Changes the width used for subwindows. This uses all available space if -1.
 
@@ -314,22 +323,27 @@ class Panel():
       self.width = width
       self.win = None
 
-  def getPreferredSize(self):
+  def get_preferred_size(self):
     """
     Provides the dimensions the subwindow would use when next redrawn, given
     that none of the properties of the panel or parent change before then. This
     returns a tuple of (height, width).
     """
 
-    newHeight, newWidth = self.parent.getmaxyx()
-    setHeight, setWidth = self.getHeight(), self.getWidth()
-    newHeight = max(0, newHeight - self.top)
-    newWidth = max(0, newWidth - self.left)
-    if setHeight != -1: newHeight = min(newHeight, setHeight)
-    if setWidth != -1: newWidth = min(newWidth, setWidth)
-    return (newHeight, newWidth)
+    new_height, new_width = self.parent.getmaxyx()
+    set_height, set_width = self.get_height(), self.get_width()
+    new_height = max(0, new_height - self.top)
+    new_width = max(0, new_width - self.left)
+
+    if set_height != -1:
+      new_height = min(new_height, set_height)
 
-  def handleKey(self, key):
+    if set_width != -1:
+      new_width = min(new_width, set_width)
+
+    return (new_height, new_width)
+
+  def handle_key(self, key):
     """
     Handler for user input. This returns true if the key press was consumed,
     false otherwise.
@@ -340,7 +354,7 @@ class Panel():
 
     return False
 
-  def getHelp(self):
+  def get_help(self):
     """
     Provides help information for the controls this page provides. This is a
     list of tuples of the form...
@@ -363,29 +377,34 @@ class Panel():
 
     pass
 
-  def redraw(self, forceRedraw=False, block=False):
+  def redraw(self, force_redraw=False, block=False):
     """
     Clears display and redraws its content. This can skip redrawing content if
     able (ie, the subwindow's unchanged), instead just refreshing the display.
 
     Arguments:
-      forceRedraw - forces the content to be cleared and redrawn if true
+      force_redraw - forces the content to be cleared and redrawn if true
       block       - if drawing concurrently with other panels this determines
                     if the request is willing to wait its turn or should be
                     abandoned
     """
 
     # skipped if not currently visible or activity has been halted
-    if not self.isVisible() or HALT_ACTIVITY: return
+
+    if not self.is_visible() or HALT_ACTIVITY:
+      return
 
     # if the panel's completely outside its parent then this is a no-op
-    newHeight, newWidth = self.getPreferredSize()
-    if newHeight == 0 or newWidth == 0:
+
+    new_height, new_width = self.get_preferred_size()
+
+    if new_height == 0 or new_width == 0:
       self.win = None
       return
 
     # recreates the subwindow if necessary
-    isNewWindow = self._resetSubwindow()
+
+    is_new_window = self._reset_subwindow()
 
     # The reset argument is disregarded in a couple of situations:
     # - The subwindow's been recreated (obviously it then doesn't have the old
@@ -393,16 +412,20 @@ class Panel():
     # - The subwindow's dimensions have changed since last drawn (this will
     #   likely change the content's layout)
 
-    subwinMaxY, subwinMaxX = self.win.getmaxyx()
-    if isNewWindow or subwinMaxY != self.maxY or subwinMaxX != self.maxX:
-      forceRedraw = True
+    subwin_max_y, subwin_max_x = self.win.getmaxyx()
+
+    if is_new_window or subwin_max_y != self.max_y or subwin_max_x != self.max_x:
+      force_redraw = True
+
+    self.max_y, self.max_x = subwin_max_y, subwin_max_x
+
+    if not CURSES_LOCK.acquire(block):
+      return
 
-    self.maxY, self.maxX = subwinMaxY, subwinMaxX
-    if not CURSES_LOCK.acquire(block): return
     try:
-      if forceRedraw:
-        self.win.erase() # clears any old contents
-        self.draw(self.maxX, self.maxY)
+      if force_redraw:
+        self.win.erase()  # clears any old contents
+        self.draw(self.max_x, self.max_y)
       self.win.refresh()
     finally:
       CURSES_LOCK.release()
@@ -419,10 +442,10 @@ class Panel():
       attr   - text attributes
     """
 
-    if self.win and self.maxX > x and self.maxY > y:
+    if self.win and self.max_x > x and self.max_y > y:
       try:
-        drawLength = min(length, self.maxX - x)
-        self.win.hline(y, x, curses.ACS_HLINE | attr, drawLength)
+        draw_length = min(length, self.max_x - x)
+        self.win.hline(y, x, curses.ACS_HLINE | attr, draw_length)
       except:
         # in edge cases drawing could cause a _curses.error
         pass
@@ -439,10 +462,10 @@ class Panel():
       attr   - text attributes
     """
 
-    if self.win and self.maxX > x and self.maxY > y:
+    if self.win and self.max_x > x and self.max_y > y:
       try:
-        drawLength = min(length, self.maxY - y)
-        self.win.vline(y, x, curses.ACS_VLINE | attr, drawLength)
+        draw_length = min(length, self.max_y - y)
+        self.win.vline(y, x, curses.ACS_VLINE | attr, draw_length)
       except:
         # in edge cases drawing could cause a _curses.error
         pass
@@ -459,7 +482,7 @@ class Panel():
       attr - text attributes
     """
 
-    if self.win and self.maxX > x and self.maxY > y:
+    if self.win and self.max_x > x and self.max_y > y:
       try:
         self.win.addch(y, x, char, attr)
       except:
@@ -481,9 +504,10 @@ class Panel():
 
     # subwindows need a single character buffer (either in the x or y
     # direction) from actual content to prevent crash when shrank
-    if self.win and self.maxX > x and self.maxY > y:
+
+    if self.win and self.max_x > x and self.max_y > y:
       try:
-        self.win.addstr(y, x, msg[:self.maxX - x], attr)
+        self.win.addstr(y, x, msg[:self.max_x - x], attr)
       except:
         # this might produce a _curses.error during edge cases, for instance
         # when resizing with visible popups
@@ -496,7 +520,7 @@ class Panel():
     <b>text</b>               bold
     <u>text</u>               underline
     <h>text</h>               highlight
-    <[color]>text</[color]>   use color (see uiTools.getColor() for constants)
+    <[color]>text</[color]>   use color (see uiTools.get_color() for constants)
 
     Tag nesting is supported and tag closing is strictly enforced (raising an
     exception for invalid formatting). Unrecognized tags are treated as normal
@@ -512,67 +536,77 @@ class Panel():
       msg  - formatted text to be added
     """
 
-    if self.win and self.maxY > y:
+    if self.win and self.max_y > y:
       formatting = [curses.A_NORMAL]
-      expectedCloseTags = []
-      unusedMsg = msg
+      expected_close_tags = []
+      unused_msg = msg
 
-      while self.maxX > x and len(unusedMsg) > 0:
+      while self.max_x > x and len(unused_msg) > 0:
         # finds next consumeable tag (left as None if there aren't any left)
-        nextTag, tagStart, tagEnd = None, -1, -1
 
-        tmpChecked = 0 # portion of the message cleared for having any valid tags
-        expectedTags = FORMAT_TAGS.keys() + expectedCloseTags
-        while nextTag == None:
-          tagStart = unusedMsg.find("<", tmpChecked)
-          tagEnd = unusedMsg.find(">", tagStart) + 1 if tagStart != -1 else -1
+        next_tag, tag_start, tag_end = None, -1, -1
+
+        tmp_checked = 0  # portion of the message cleared for having any valid tags
+        expected_tags = FORMAT_TAGS.keys() + expected_close_tags
 
-          if tagStart == -1 or tagEnd == -1: break # no more tags to consume
+        while next_tag is None:
+          tag_start = unused_msg.find("<", tmp_checked)
+          tag_end = unused_msg.find(">", tag_start) + 1 if tag_start != -1 else -1
+
+          if tag_start == -1 or tag_end == -1:
+            break  # no more tags to consume
           else:
             # check if the tag we've found matches anything being expected
-            if unusedMsg[tagStart:tagEnd] in expectedTags:
-              nextTag = unusedMsg[tagStart:tagEnd]
-              break # found a tag to use
+            if unused_msg[tag_start:tag_end] in expected_tags:
+              next_tag = unused_msg[tag_start:tag_end]
+              break  # found a tag to use
             else:
               # not a valid tag - narrow search to everything after it
-              tmpChecked = tagEnd
+              tmp_checked = tag_end
 
         # splits into text before and after tag
-        if nextTag:
-          msgSegment = unusedMsg[:tagStart]
-          unusedMsg = unusedMsg[tagEnd:]
+
+        if next_tag:
+          msg_segment = unused_msg[:tag_start]
+          unused_msg = unused_msg[tag_end:]
         else:
-          msgSegment = unusedMsg
-          unusedMsg = ""
+          msg_segment = unused_msg
+          unused_msg = ""
 
         # adds text before tag with current formatting
+
         attr = 0
-        for format in formatting: attr |= format
-        self.win.addstr(y, x, msgSegment[:self.maxX - x - 1], attr)
-        x += len(msgSegment)
+
+        for text_format in formatting:
+          attr |= text_format
+
+        self.win.addstr(y, x, msg_segment[:self.max_x - x - 1], attr)
+        x += len(msg_segment)
 
         # applies tag attributes for future text
-        if nextTag:
-          formatTag = "<" + nextTag[2:] if nextTag.startswith("</") else nextTag
-          formatMatch = FORMAT_TAGS[formatTag][0](FORMAT_TAGS[formatTag][1])
 
-          if not nextTag.startswith("</"):
+        if next_tag:
+          format_tag = "<" + next_tag[2:] if next_tag.startswith("</") else next_tag
+          format_match = FORMAT_TAGS[format_tag][0](FORMAT_TAGS[format_tag][1])
+
+          if not next_tag.startswith("</"):
             # open tag - add formatting
-            expectedCloseTags.append("</" + nextTag[1:])
-            formatting.append(formatMatch)
+            expected_close_tags.append("</" + next_tag[1:])
+            formatting.append(format_match)
           else:
             # close tag - remove formatting
-            expectedCloseTags.remove(nextTag)
-            formatting.remove(formatMatch)
+            expected_close_tags.remove(next_tag)
+            formatting.remove(format_match)
 
       # only check for unclosed tags if we processed the whole message (if we
       # stopped processing prematurely it might still be valid)
-      if expectedCloseTags and not unusedMsg:
+
+      if expected_close_tags and not unused_msg:
         # if we're done then raise an exception for any unclosed tags (tisk, tisk)
-        baseMsg = "Unclosed formatting tag%s:" % ("s" if len(expectedCloseTags) > 1 else "")
-        raise ValueError("%s: '%s'\n  \"%s\"" % (baseMsg, "', '".join(expectedCloseTags), msg))
+        base_msg = "Unclosed formatting tag%s:" % ("s" if len(expected_close_tags) > 1 else "")
+        raise ValueError("%s: '%s'\n  \"%s\"" % (base_msg, "', '".join(expected_close_tags), msg))
 
-  def getstr(self, y, x, initialText = "", format = None, maxWidth = None, validator = None):
+  def getstr(self, y, x, initial_text = "", text_format = None, max_width = None, validator = None):
     """
     Provides a text field where the user can input a string, blocking until
     they've done so and returning the result. If the user presses escape then
@@ -584,54 +618,69 @@ class Panel():
     input).
 
     Arguments:
-      y           - vertical location
-      x           - horizontal location
-      initialText - starting text in this field
-      format      - format used for the text
-      maxWidth    - maximum width for the text field
-      validator   - custom TextInputValidator for handling keybindings
+      y            - vertical location
+      x            - horizontal location
+      initial_text - starting text in this field
+      text_format  - format used for the text
+      max_width    - maximum width for the text field
+      validator    - custom TextInputValidator for handling keybindings
     """
 
-    if not format: format = curses.A_NORMAL
+    if not text_format:
+      text_format = curses.A_NORMAL
 
     # makes cursor visible
-    try: previousCursorState = curses.curs_set(1)
-    except curses.error: previousCursorState = 0
+
+    try:
+      previous_cursor_state = curses.curs_set(1)
+    except curses.error:
+      previous_cursor_state = 0
 
     # temporary subwindow for user input
-    displayWidth = self.getPreferredSize()[1]
-    if maxWidth: displayWidth = min(displayWidth, maxWidth + x)
-    inputSubwindow = self.parent.subwin(1, displayWidth - x, self.top + y, self.left + x)
+
+    display_width = self.get_preferred_size()[1]
+
+    if max_width:
+      display_width = min(display_width, max_width + x)
+
+    input_subwindow = self.parent.subwin(1, display_width - x, self.top + y, self.left + x)
 
     # blanks the field's area, filling it with the font in case it's hilighting
-    inputSubwindow.clear()
-    inputSubwindow.bkgd(' ', format)
+
+    input_subwindow.clear()
+    input_subwindow.bkgd(' ', text_format)
 
     # prepopulates the initial text
-    if initialText:
-      inputSubwindow.addstr(0, 0, initialText[:displayWidth - x - 1], format)
+
+    if initial_text:
+      input_subwindow.addstr(0, 0, initial_text[:display_width - x - 1], text_format)
 
     # Displays the text field, blocking until the user's done. This closes the
-    # text panel and returns userInput to the initial text if the user presses
+    # text panel and returns user_input to the initial text if the user presses
     # escape.
 
-    textbox = curses.textpad.Textbox(inputSubwindow)
+    textbox = curses.textpad.Textbox(input_subwindow)
 
     if not validator:
       validator = textInput.BasicValidator()
 
-    textbox.win.attron(format)
-    userInput = textbox.edit(lambda key: validator.validate(key, textbox)).strip()
-    textbox.win.attroff(format)
-    if textbox.lastcmd == curses.ascii.BEL: userInput = None
+    textbox.win.attron(text_format)
+    user_input = textbox.edit(lambda key: validator.validate(key, textbox)).strip()
+    textbox.win.attroff(text_format)
+
+    if textbox.lastcmd == curses.ascii.BEL:
+      user_input = None
 
     # reverts visability settings
-    try: curses.curs_set(previousCursorState)
-    except curses.error: pass
 
-    return userInput
+    try:
+      curses.curs_set(previous_cursor_state)
+    except curses.error:
+      pass
+
+    return user_input
 
-  def addScrollBar(self, top, bottom, size, drawTop = 0, drawBottom = -1, drawLeft = 0):
+  def add_scroll_bar(self, top, bottom, size, draw_top = 0, draw_bottom = -1, draw_left = 0):
     """
     Draws a left justified scroll bar reflecting position within a vertical
     listing. This is shorted if necessary, and left undrawn if no space is
@@ -649,44 +698,57 @@ class Panel():
       top        - list index for the top-most visible element
       bottom     - list index for the bottom-most visible element
       size       - size of the list in which the listed elements are contained
-      drawTop    - starting row where the scroll bar should be drawn
-      drawBottom - ending row where the scroll bar should end, -1 if it should
+      draw_top    - starting row where the scroll bar should be drawn
+      draw_bottom - ending row where the scroll bar should end, -1 if it should
                    span to the bottom of the panel
-      drawLeft   - left offset at which to draw the scroll bar
+      draw_left   - left offset at which to draw the scroll bar
     """
 
-    if (self.maxY - drawTop) < 2: return # not enough room
+    if (self.max_y - draw_top) < 2:
+      return  # not enough room
+
+    # sets draw_bottom to be the actual row on which the scrollbar should end
 
-    # sets drawBottom to be the actual row on which the scrollbar should end
-    if drawBottom == -1: drawBottom = self.maxY - 1
-    else: drawBottom = min(drawBottom, self.maxY - 1)
+    if draw_bottom == -1:
+      draw_bottom = self.max_y - 1
+    else:
+      draw_bottom = min(draw_bottom, self.max_y - 1)
 
     # determines scrollbar dimensions
-    scrollbarHeight = drawBottom - drawTop
-    sliderTop = scrollbarHeight * top / size
-    sliderSize = scrollbarHeight * (bottom - top) / size
+
+    scrollbar_height = draw_bottom - draw_top
+    slider_top = scrollbar_height * top / size
+    slider_size = scrollbar_height * (bottom - top) / size
 
     # ensures slider isn't at top or bottom unless really at those extreme bounds
-    if top > 0: sliderTop = max(sliderTop, 1)
-    if bottom != size: sliderTop = min(sliderTop, scrollbarHeight - sliderSize - 2)
+
+    if top > 0:
+      slider_top = max(slider_top, 1)
+
+    if bottom != size:
+      slider_top = min(slider_top, scrollbar_height - slider_size - 2)
 
     # avoids a rounding error that causes the scrollbar to be too low when at
     # the bottom
-    if bottom == size: sliderTop = scrollbarHeight - sliderSize - 1
+
+    if bottom == size:
+      slider_top = scrollbar_height - slider_size - 1
 
     # draws scrollbar slider
-    for i in range(scrollbarHeight):
-      if i >= sliderTop and i <= sliderTop + sliderSize:
-        self.addstr(i + drawTop, drawLeft, " ", curses.A_STANDOUT)
+
+    for i in range(scrollbar_height):
+      if i >= slider_top and i <= slider_top + slider_size:
+        self.addstr(i + draw_top, draw_left, " ", curses.A_STANDOUT)
       else:
-        self.addstr(i + drawTop, drawLeft, " ")
+        self.addstr(i + draw_top, draw_left, " ")
 
     # draws box around the scroll bar
-    self.vline(drawTop, drawLeft + 1, drawBottom - 1)
-    self.addch(drawBottom, drawLeft + 1, curses.ACS_LRCORNER)
-    self.addch(drawBottom, drawLeft, curses.ACS_HLINE)
 
-  def _resetSubwindow(self):
+    self.vline(draw_top, draw_left + 1, draw_bottom - 1)
+    self.addch(draw_bottom, draw_left + 1, curses.ACS_LRCORNER)
+    self.addch(draw_bottom, draw_left, curses.ACS_HLINE)
+
+  def _reset_subwindow(self):
     """
     Create a new subwindow instance for the panel if:
     - Panel currently doesn't have a subwindow (was uninitialized or
@@ -702,16 +764,20 @@ class Panel():
     This returns True if a new subwindow instance was created, False otherwise.
     """
 
-    newHeight, newWidth = self.getPreferredSize()
-    if newHeight == 0: return False # subwindow would be outside its parent
+    new_height, new_width = self.get_preferred_size()
+
+    if new_height == 0:
+      return False  # subwindow would be outside its parent
 
     # determines if a new subwindow should be recreated
-    recreate = self.win == None
+
+    recreate = self.win is None
+
     if self.win:
-      subwinMaxY, subwinMaxX = self.win.getmaxyx()
-      recreate |= subwinMaxY < newHeight              # check for vertical growth
+      subwin_max_y, subwin_max_x = self.win.getmaxyx()
+      recreate |= subwin_max_y < new_height           # check for vertical growth
       recreate |= self.top > self.win.getparyx()[0]   # check for displacement
-      recreate |= subwinMaxX > newWidth or subwinMaxY > newHeight # shrinking
+      recreate |= subwin_max_x > new_width or subwin_max_y > new_height  # shrinking
 
     # I'm not sure if recreating subwindows is some sort of memory leak but the
     # Python curses bindings seem to lack all of the following:
@@ -721,9 +787,9 @@ class Panel():
     # would mean far more complicated code and no more selective refreshing)
 
     if recreate:
-      self.win = self.parent.subwin(newHeight, newWidth, self.top, self.left)
+      self.win = self.parent.subwin(new_height, new_width, self.top, self.left)
 
       # note: doing this log before setting win produces an infinite loop
-      log.debug("recreating panel '%s' with the dimensions of %i/%i" % (self.getName(), newHeight, newWidth))
-    return recreate
+      log.debug("recreating panel '%s' with the dimensions of %i/%i" % (self.get_name(), new_height, new_width))
 
+    return recreate
diff --git a/arm/util/textInput.py b/arm/util/textInput.py
index 34a66a0..4faec1e 100644
--- a/arm/util/textInput.py
+++ b/arm/util/textInput.py
@@ -9,14 +9,15 @@ import curses
 
 PASS = -1
 
+
 class TextInputValidator:
   """
-  Basic interface for validators. Implementations should override the handleKey
+  Basic interface for validators. Implementations should override the handle_key
   method.
   """
 
-  def __init__(self, nextValidator = None):
-    self.nextValidator = nextValidator
+  def __init__(self, next_validator = None):
+    self.next_validator = next_validator
 
   def validate(self, key, textbox):
     """
@@ -30,15 +31,16 @@ class TextInputValidator:
       textbox - curses Textbox instance the input came from
     """
 
-    result = self.handleKey(key, textbox)
+    result = self.handle_key(key, textbox)
 
     if result != PASS:
       return result
-    elif self.nextValidator:
-      return self.nextValidator.validate(key, textbox)
-    else: return key
+    elif self.next_validator:
+      return self.next_validator.validate(key, textbox)
+    else:
+      return key
 
-  def handleKey(self, key, textbox):
+  def handle_key(self, key, textbox):
     """
     Process the given keycode with this validator, returning the keycode for
     the textbox to process, and PASS if this doesn't want to modify it.
@@ -50,6 +52,7 @@ class TextInputValidator:
 
     return PASS
 
+
 class BasicValidator(TextInputValidator):
   """
   Interceptor for keystrokes given to a textbox, doing the following:
@@ -59,7 +62,7 @@ class BasicValidator(TextInputValidator):
   - home and end keys move to the start/end of the line
   """
 
-  def handleKey(self, key, textbox):
+  def handle_key(self, key, textbox):
     y, x = textbox.win.getyx()
 
     if curses.ascii.isprint(key) and x < textbox.maxx:
@@ -73,82 +76,96 @@ class BasicValidator(TextInputValidator):
       #   because keycodes read by textbox.win.inch() includes formatting,
       #   causing the curses.ascii.isprint() check it does to fail.
 
-      currentInput = textbox.gather()
-      textbox.win.addstr(y, x + 1, currentInput[x:textbox.maxx - 1])
-      textbox.win.move(y, x) # reverts cursor movement during gather call
+      current_input = textbox.gather()
+      textbox.win.addstr(y, x + 1, current_input[x:textbox.maxx - 1])
+      textbox.win.move(y, x)  # reverts cursor movement during gather call
     elif key == 27:
       # curses.ascii.BEL is a character codes that causes textpad to terminate
+
       return curses.ascii.BEL
     elif key == curses.KEY_HOME:
       textbox.win.move(y, 0)
       return None
     elif key in (curses.KEY_END, curses.KEY_RIGHT):
-      msgLen = len(textbox.gather())
-      textbox.win.move(y, x) # reverts cursor movement during gather call
+      msg_length = len(textbox.gather())
+      textbox.win.move(y, x)  # reverts cursor movement during gather call
 
-      if key == curses.KEY_END and msgLen > 0 and x < msgLen - 1:
+      if key == curses.KEY_END and msg_length > 0 and x < msg_length - 1:
         # if we're in the content then move to the end
-        textbox.win.move(y, msgLen - 1)
+
+        textbox.win.move(y, msg_length - 1)
         return None
-      elif key == curses.KEY_RIGHT and x >= msgLen - 1:
+      elif key == curses.KEY_RIGHT and x >= msg_length - 1:
         # don't move the cursor if there's no content after it
+
         return None
     elif key == 410:
       # if we're resizing the display during text entry then cancel it
       # (otherwise the input field is filled with nonprintable characters)
+
       return curses.ascii.BEL
 
     return PASS
 
+
 class HistoryValidator(TextInputValidator):
   """
   This intercepts the up and down arrow keys to scroll through a backlog of
   previous commands.
   """
 
-  def __init__(self, commandBacklog = [], nextValidator = None):
-    TextInputValidator.__init__(self, nextValidator)
+  def __init__(self, command_backlog = [], next_validator = None):
+    TextInputValidator.__init__(self, next_validator)
 
     # contents that can be scrolled back through, newest to oldest
-    self.commandBacklog = commandBacklog
+
+    self.command_backlog = command_backlog
 
     # selected item from the backlog, -1 if we're not on a backlog item
-    self.selectionIndex = -1
+
+    self.selection_index = -1
 
     # the fields input prior to selecting a backlog item
-    self.customInput = ""
 
-  def handleKey(self, key, textbox):
+    self.custom_input = ""
+
+  def handle_key(self, key, textbox):
     if key in (curses.KEY_UP, curses.KEY_DOWN):
       offset = 1 if key == curses.KEY_UP else -1
-      newSelection = self.selectionIndex + offset
+      new_selection = self.selection_index + offset
 
       # constrains the new selection to valid bounds
-      newSelection = max(-1, newSelection)
-      newSelection = min(len(self.commandBacklog) - 1, newSelection)
+
+      new_selection = max(-1, new_selection)
+      new_selection = min(len(self.command_backlog) - 1, new_selection)
 
       # skips if this is a no-op
-      if self.selectionIndex == newSelection:
+
+      if self.selection_index == new_selection:
         return None
 
       # saves the previous input if we weren't on the backlog
-      if self.selectionIndex == -1:
-        self.customInput = textbox.gather().strip()
 
-      if newSelection == -1: newInput = self.customInput
-      else: newInput = self.commandBacklog[newSelection]
+      if self.selection_index == -1:
+        self.custom_input = textbox.gather().strip()
+
+      if new_selection == -1:
+        new_input = self.custom_input
+      else:
+        new_input = self.command_backlog[new_selection]
 
       y, _ = textbox.win.getyx()
-      _, maxX = textbox.win.getmaxyx()
+      _, max_x = textbox.win.getmaxyx()
       textbox.win.clear()
-      textbox.win.addstr(y, 0, newInput[:maxX - 1])
-      textbox.win.move(y, min(len(newInput), maxX - 1))
+      textbox.win.addstr(y, 0, new_input[:max_x - 1])
+      textbox.win.move(y, min(len(new_input), max_x - 1))
 
-      self.selectionIndex = newSelection
+      self.selection_index = new_selection
       return None
 
     return PASS
 
+
 class TabCompleter(TextInputValidator):
   """
   Provides tab completion based on the current input, finishing if there's only
@@ -156,40 +173,41 @@ class TabCompleter(TextInputValidator):
   provides matches.
   """
 
-  def __init__(self, completer, nextValidator = None):
-    TextInputValidator.__init__(self, nextValidator)
+  def __init__(self, completer, next_validator = None):
+    TextInputValidator.__init__(self, next_validator)
 
     # functor that accepts a string and gives a list of matches
+
     self.completer = completer
 
-  def handleKey(self, key, textbox):
+  def handle_key(self, key, textbox):
     # Matches against the tab key. The ord('\t') is nine, though strangely none
     # of the curses.KEY_*TAB constants match this...
+
     if key == 9:
-      currentContents = textbox.gather().strip()
-      matches = self.completer(currentContents)
-      newInput = None
+      current_contents = textbox.gather().strip()
+      matches = self.completer(current_contents)
+      new_input = None
 
       if len(matches) == 1:
         # only a single match, fill it in
-        newInput = matches[0]
+        new_input = matches[0]
       elif len(matches) > 1:
         # looks for a common prefix we can complete
-        commonPrefix = os.path.commonprefix(matches) # weird that this comes from path...
+        common_prefix = os.path.commonprefix(matches)  # weird that this comes from path...
 
-        if commonPrefix != currentContents:
-          newInput = commonPrefix
+        if common_prefix != current_contents:
+          new_input = common_prefix
 
         # TODO: somehow display matches... this is not gonna be fun
 
-      if newInput:
+      if new_input:
         y, _ = textbox.win.getyx()
-        _, maxX = textbox.win.getmaxyx()
+        _, max_x = textbox.win.getmaxyx()
         textbox.win.clear()
-        textbox.win.addstr(y, 0, newInput[:maxX - 1])
-        textbox.win.move(y, min(len(newInput), maxX - 1))
+        textbox.win.addstr(y, 0, new_input[:max_x - 1])
+        textbox.win.move(y, min(len(new_input), max_x - 1))
 
       return None
 
     return PASS
-
diff --git a/arm/util/torConfig.py b/arm/util/torConfig.py
index 2c89e37..5668995 100644
--- a/arm/util/torConfig.py
+++ b/arm/util/torConfig.py
@@ -14,9 +14,11 @@ from arm.util import torTools, uiTools
 from stem.util import conf, enum, log, str_tools, system
 
 # filename used for cached tor config descriptions
+
 CONFIG_DESC_FILENAME = "torConfigDesc.txt"
 
 # messages related to loading the tor configuration descriptions
+
 DESC_LOAD_SUCCESS_MSG = "Loaded configuration descriptions from '%s' (runtime: %0.3f)"
 DESC_LOAD_FAILED_MSG = "Unable to load configuration descriptions (%s)"
 DESC_INTERNAL_LOAD_SUCCESS_MSG = "Falling back to descriptions for Tor %s"
@@ -26,11 +28,13 @@ DESC_READ_MAN_FAILED_MSG = "Unable to get the descriptions of Tor's configuratio
 DESC_SAVE_SUCCESS_MSG = "Saved configuration descriptions to '%s' (runtime: %0.3f)"
 DESC_SAVE_FAILED_MSG = "Unable to save configuration descriptions (%s)"
 
+
 def conf_handler(key, value):
   if key == "torrc.important":
     # stores lowercase entries to drop case sensitivity
     return [entry.lower() for entry in value]
 
+
 CONFIG = conf.config_dict("arm", {
   "features.torrc.validate": True,
   "torrc.important": [],
@@ -45,12 +49,13 @@ CONFIG = conf.config_dict("arm", {
   "torrc.units.time.hour": [],
   "torrc.units.time.day": [],
   "torrc.units.time.week": [],
-  "startup.dataDirectory": "~/.arm",
+  "startup.data_directory": "~/.arm",
   "features.config.descriptions.enabled": True,
   "features.config.descriptions.persist": True,
   "tor.chroot": '',
 }, conf_handler)
 
+
 def general_conf_handler(config, key):
   value = config.get(key)
 
@@ -61,9 +66,11 @@ def general_conf_handler(config, key):
     # all the torrc.units.* values are comma separated lists
     return [entry.strip() for entry in value[0].split(",")]
 
+
 conf.get_config("arm").add_listener(general_conf_handler, backfill = True)
 
 # enums and values for numeric torrc entries
+
 ValueType = enum.Enum("UNRECOGNIZED", "SIZE", "TIME")
 SIZE_MULT = {"b": 1, "kb": 1024, "mb": 1048576, "gb": 1073741824, "tb": 1099511627776}
 TIME_MULT = {"sec": 1, "min": 60, "hour": 3600, "day": 86400, "week": 604800}
@@ -73,47 +80,57 @@ TIME_MULT = {"sec": 1, "min": 60, "hour": 3600, "day": 86400, "week": 604800}
 # MISMATCH   - the value doesn't match tor's current state
 # MISSING    - value differs from its default but is missing from the torrc
 # IS_DEFAULT - the configuration option matches tor's default
+
 ValidationError = enum.Enum("DUPLICATE", "MISMATCH", "MISSING", "IS_DEFAULT")
 
 # descriptions of tor's configuration options fetched from its man page
+
 CONFIG_DESCRIPTIONS_LOCK = threading.RLock()
 CONFIG_DESCRIPTIONS = {}
 
 # categories for tor configuration options
+
 Category = enum.Enum("GENERAL", "CLIENT", "RELAY", "DIRECTORY", "AUTHORITY", "HIDDEN_SERVICE", "TESTING", "UNKNOWN")
 
-TORRC = None # singleton torrc instance
-MAN_OPT_INDENT = 7 # indentation before options in the man page
-MAN_EX_INDENT = 15 # indentation used for man page examples
-PERSIST_ENTRY_DIVIDER = "-" * 80 + "\n" # splits config entries when saving to a file
-MULTILINE_PARAM = None # cached multiline parameters (lazily loaded)
+TORRC = None  # singleton torrc instance
+MAN_OPT_INDENT = 7  # indentation before options in the man page
+MAN_EX_INDENT = 15  # indentation used for man page examples
+PERSIST_ENTRY_DIVIDER = "-" * 80 + "\n"  # splits config entries when saving to a file
+MULTILINE_PARAM = None  # cached multiline parameters (lazily loaded)
 
 # torrc options that bind to ports
+
 PORT_OPT = ("SocksPort", "ORPort", "DirPort", "ControlPort", "TransPort")
 
+
 class ManPageEntry:
   """
   Information provided about a tor configuration option in its man page entry.
   """
 
-  def __init__(self, option, index, category, argUsage, description):
+  def __init__(self, option, index, category, arg_usage, description):
     self.option = option
     self.index = index
     self.category = category
-    self.argUsage = argUsage
+    self.arg_usage = arg_usage
     self.description = description
 
-def getTorrc():
+
+def get_torrc():
   """
   Singleton constructor for a Controller. Be aware that this starts as being
   unloaded, needing the torrc contents to be loaded before being functional.
   """
 
   global TORRC
-  if TORRC == None: TORRC = Torrc()
+
+  if TORRC is None:
+    TORRC = Torrc()
+
   return TORRC
 
-def loadOptionDescriptions(loadPath = None, checkVersion = True):
+
+def load_option_descriptions(load_path = None, check_version = True):
   """
   Fetches and parses descriptions for tor's configuration options from its man
   page. This can be a somewhat lengthy call, and raises an IOError if issues
@@ -125,151 +142,183 @@ def loadOptionDescriptions(loadPath = None, checkVersion = True):
   is around 200ms).
 
   Arguments:
-    loadPath     - if set, this attempts to fetch the configuration
+    load_path     - if set, this attempts to fetch the configuration
                    descriptions from the given path instead of the man page
-    checkVersion - discards the results if true and tor's version doens't
+    check_version - discards the results if true and tor's version doens't
                    match the cached descriptors, otherwise accepts anyway
   """
 
   CONFIG_DESCRIPTIONS_LOCK.acquire()
   CONFIG_DESCRIPTIONS.clear()
 
-  raisedExc = None
-  loadedVersion = ""
+  raised_exc = None
+  loaded_version = ""
+
   try:
-    if loadPath:
+    if load_path:
       # Input file is expected to be of the form:
       # <option>
       # <arg description>
       # <description, possibly multiple lines>
       # <PERSIST_ENTRY_DIVIDER>
-      inputFile = open(loadPath, "r")
-      inputFileContents = inputFile.readlines()
-      inputFile.close()
+      input_file = open(load_path, "r")
+      input_file_contents = input_file.readlines()
+      input_file.close()
 
       try:
-        versionLine = inputFileContents.pop(0).rstrip()
+        version_line = input_file_contents.pop(0).rstrip()
 
-        if versionLine.startswith("Tor Version "):
-          fileVersion = versionLine[12:]
-          loadedVersion = fileVersion
-          torVersion = torTools.getConn().getInfo("version", "")
+        if version_line.startswith("Tor Version "):
+          file_version = version_line[12:]
+          loaded_version = file_version
+          tor_version = torTools.get_conn().get_info("version", "")
 
-          if checkVersion and fileVersion != torVersion:
-            msg = "wrong version, tor is %s but the file's from %s" % (torVersion, fileVersion)
+          if check_version and file_version != tor_version:
+            msg = "wrong version, tor is %s but the file's from %s" % (tor_version, file_version)
             raise IOError(msg)
         else:
           raise IOError("unable to parse version")
 
-        while inputFileContents:
+        while input_file_contents:
           # gets category enum, failing if it doesn't exist
-          category = inputFileContents.pop(0).rstrip()
+          category = input_file_contents.pop(0).rstrip()
+
           if not category in Category:
-            baseMsg = "invalid category in input file: '%s'"
-            raise IOError(baseMsg % category)
+            base_msg = "invalid category in input file: '%s'"
+            raise IOError(base_msg % category)
 
           # gets the position in the man page
-          indexArg, indexStr = -1, inputFileContents.pop(0).rstrip()
+          index_arg, index_str = -1, input_file_contents.pop(0).rstrip()
 
-          if indexStr.startswith("index: "):
-            indexStr = indexStr[7:]
+          if index_str.startswith("index: "):
+            index_str = index_str[7:]
 
-            if indexStr.isdigit(): indexArg = int(indexStr)
-            else: raise IOError("non-numeric index value: %s" % indexStr)
-          else: raise IOError("malformed index argument: %s"% indexStr)
+            if index_str.isdigit():
+              index_arg = int(index_str)
+            else:
+              raise IOError("non-numeric index value: %s" % index_str)
+          else:
+            raise IOError("malformed index argument: %s" % index_str)
 
-          option = inputFileContents.pop(0).rstrip()
-          argument = inputFileContents.pop(0).rstrip()
+          option = input_file_contents.pop(0).rstrip()
+          argument = input_file_contents.pop(0).rstrip()
 
-          description, loadedLine = "", inputFileContents.pop(0)
-          while loadedLine != PERSIST_ENTRY_DIVIDER:
-            description += loadedLine
+          description, loaded_line = "", input_file_contents.pop(0)
 
-            if inputFileContents: loadedLine = inputFileContents.pop(0)
-            else: break
+          while loaded_line != PERSIST_ENTRY_DIVIDER:
+            description += loaded_line
 
-          CONFIG_DESCRIPTIONS[option.lower()] = ManPageEntry(option, indexArg, category, argument, description.rstrip())
+            if input_file_contents:
+              loaded_line = input_file_contents.pop(0)
+            else:
+              break
+
+          CONFIG_DESCRIPTIONS[option.lower()] = ManPageEntry(option, index_arg, category, argument, description.rstrip())
       except IndexError:
         CONFIG_DESCRIPTIONS.clear()
         raise IOError("input file format is invalid")
     else:
-      manCallResults = system.call("man tor", None)
+      man_call_results = system.call("man tor", None)
 
-      if not manCallResults:
+      if not man_call_results:
         raise IOError("man page not found")
 
       # Fetches all options available with this tor instance. This isn't
-      # vital, and the validOptions are left empty if the call fails.
-      conn, validOptions = torTools.getConn(), []
-      configOptionQuery = conn.getInfo("config/names", None)
-      if configOptionQuery:
-        for line in configOptionQuery.strip().split("\n"):
-          validOptions.append(line[:line.find(" ")].lower())
-
-      optionCount, lastOption, lastArg = 0, None, None
-      lastCategory, lastDescription = Category.GENERAL, ""
-      for line in manCallResults:
-        line = uiTools.getPrintable(line)
-        strippedLine = line.strip()
+      # vital, and the valid_options are left empty if the call fails.
+
+      conn, valid_options = torTools.get_conn(), []
+      config_option_query = conn.get_info("config/names", None)
+
+      if config_option_query:
+        for line in config_option_query.strip().split("\n"):
+          valid_options.append(line[:line.find(" ")].lower())
+
+      option_count, last_option, last_arg = 0, None, None
+      last_category, last_description = Category.GENERAL, ""
+
+      for line in man_call_results:
+        line = uiTools.get_printable(line)
+        stripped_line = line.strip()
 
         # we have content, but an indent less than an option (ignore line)
-        #if strippedLine and not line.startswith(" " * MAN_OPT_INDENT): continue
+        #if stripped_line and not line.startswith(" " * MAN_OPT_INDENT): continue
 
         # line starts with an indent equivilant to a new config option
-        isOptIndent = line.startswith(" " * MAN_OPT_INDENT) and line[MAN_OPT_INDENT] != " "
 
-        isCategoryLine = not line.startswith(" ") and "OPTIONS" in line
+        is_opt_indent = line.startswith(" " * MAN_OPT_INDENT) and line[MAN_OPT_INDENT] != " "
+
+        is_category_line = not line.startswith(" ") and "OPTIONS" in line
 
         # if this is a category header or a new option, add an entry using the
         # buffered results
-        if isOptIndent or isCategoryLine:
+
+        if is_opt_indent or is_category_line:
           # Filters the line based on if the option is recognized by tor or
           # not. This isn't necessary for arm, so if unable to make the check
           # then we skip filtering (no loss, the map will just have some extra
           # noise).
-          strippedDescription = lastDescription.strip()
-          if lastOption and (not validOptions or lastOption.lower() in validOptions):
-            CONFIG_DESCRIPTIONS[lastOption.lower()] = ManPageEntry(lastOption, optionCount, lastCategory, lastArg, strippedDescription)
-            optionCount += 1
-          lastDescription = ""
+
+          stripped_description = last_description.strip()
+
+          if last_option and (not valid_options or last_option.lower() in valid_options):
+            CONFIG_DESCRIPTIONS[last_option.lower()] = ManPageEntry(last_option, option_count, last_category, last_arg, stripped_description)
+            option_count += 1
+
+          last_description = ""
 
           # parses the option and argument
+
           line = line.strip()
-          divIndex = line.find(" ")
-          if divIndex != -1:
-            lastOption, lastArg = line[:divIndex], line[divIndex + 1:]
+          div_index = line.find(" ")
+
+          if div_index != -1:
+            last_option, last_arg = line[:div_index], line[div_index + 1:]
 
           # if this is a category header then switch it
-          if isCategoryLine:
-            if line.startswith("OPTIONS"): lastCategory = Category.GENERAL
-            elif line.startswith("CLIENT"): lastCategory = Category.CLIENT
-            elif line.startswith("SERVER"): lastCategory = Category.RELAY
-            elif line.startswith("DIRECTORY SERVER"): lastCategory = Category.DIRECTORY
-            elif line.startswith("DIRECTORY AUTHORITY SERVER"): lastCategory = Category.AUTHORITY
-            elif line.startswith("HIDDEN SERVICE"): lastCategory = Category.HIDDEN_SERVICE
-            elif line.startswith("TESTING NETWORK"): lastCategory = Category.TESTING
+
+          if is_category_line:
+            if line.startswith("OPTIONS"):
+              last_category = Category.GENERAL
+            elif line.startswith("CLIENT"):
+              last_category = Category.CLIENT
+            elif line.startswith("SERVER"):
+              last_category = Category.RELAY
+            elif line.startswith("DIRECTORY SERVER"):
+              last_category = Category.DIRECTORY
+            elif line.startswith("DIRECTORY AUTHORITY SERVER"):
+              last_category = Category.AUTHORITY
+            elif line.startswith("HIDDEN SERVICE"):
+              last_category = Category.HIDDEN_SERVICE
+            elif line.startswith("TESTING NETWORK"):
+              last_category = Category.TESTING
             else:
               log.notice("Unrecognized category in the man page: %s" % line.strip())
         else:
           # Appends the text to the running description. Empty lines and lines
           # starting with a specific indentation are used for formatting, for
           # instance the ExitPolicy and TestingTorNetwork entries.
-          if lastDescription and lastDescription[-1] != "\n":
-            lastDescription += " "
 
-          if not strippedLine:
-            lastDescription += "\n\n"
+          if last_description and last_description[-1] != "\n":
+            last_description += " "
+
+          if not stripped_line:
+            last_description += "\n\n"
           elif line.startswith(" " * MAN_EX_INDENT):
-            lastDescription += "    %s\n" % strippedLine
-          else: lastDescription += strippedLine
-  except IOError, exc:
-    raisedExc = exc
+            last_description += "    %s\n" % stripped_line
+          else:
+            last_description += stripped_line
+  except IOError as exc:
+    raised_exc = exc
 
   CONFIG_DESCRIPTIONS_LOCK.release()
-  if raisedExc: raise raisedExc
-  else: return loadedVersion
 
-def saveOptionDescriptions(path):
+  if raised_exc:
+    raise raised_exc
+  else:
+    return loaded_version
+
+
+def save_option_descriptions(path):
   """
   Preserves the current configuration descriptors to the given path. This
   raises an IOError or OSError if unable to do so.
@@ -279,25 +328,33 @@ def saveOptionDescriptions(path):
   """
 
   # make dir if the path doesn't already exist
-  baseDir = os.path.dirname(path)
-  if not os.path.exists(baseDir): os.makedirs(baseDir)
-  outputFile = open(path, "w")
+
+  base_dir = os.path.dirname(path)
+
+  if not os.path.exists(base_dir):
+    os.makedirs(base_dir)
+
+  output_file = open(path, "w")
 
   CONFIG_DESCRIPTIONS_LOCK.acquire()
-  sortedOptions = CONFIG_DESCRIPTIONS.keys()
-  sortedOptions.sort()
+  sorted_options = CONFIG_DESCRIPTIONS.keys()
+  sorted_options.sort()
+
+  tor_version = torTools.get_conn().get_info("version", "")
+  output_file.write("Tor Version %s\n" % tor_version)
 
-  torVersion = torTools.getConn().getInfo("version", "")
-  outputFile.write("Tor Version %s\n" % torVersion)
-  for i in range(len(sortedOptions)):
-    manEntry = getConfigDescription(sortedOptions[i])
-    outputFile.write("%s\nindex: %i\n%s\n%s\n%s\n" % (manEntry.category, manEntry.index, manEntry.option, manEntry.argUsage, manEntry.description))
-    if i != len(sortedOptions) - 1: outputFile.write(PERSIST_ENTRY_DIVIDER)
+  for i in range(len(sorted_options)):
+    man_entry = get_config_description(sorted_options[i])
+    output_file.write("%s\nindex: %i\n%s\n%s\n%s\n" % (man_entry.category, man_entry.index, man_entry.option, man_entry.arg_usage, man_entry.description))
 
-  outputFile.close()
+    if i != len(sorted_options) - 1:
+      output_file.write(PERSIST_ENTRY_DIVIDER)
+
+  output_file.close()
   CONFIG_DESCRIPTIONS_LOCK.release()
 
-def getConfigSummary(option):
+
+def get_config_summary(option):
   """
   Provides a short summary description of the configuration option. If none is
   known then this proivdes None.
@@ -308,7 +365,8 @@ def getConfigSummary(option):
 
   return CONFIG.get("torrc.summary.%s" % option.lower())
 
-def isImportant(option):
+
+def is_important(option):
   """
   Provides True if the option has the 'important' flag in the configuration,
   False otherwise.
@@ -319,7 +377,8 @@ def isImportant(option):
 
   return option.lower() in CONFIG["torrc.important"]
 
-def getConfigDescription(option):
+
+def get_config_description(option):
   """
   Provides ManPageEntry instances populated with information fetched from the
   tor man page. This provides None if no such option has been loaded. If the
@@ -333,13 +392,15 @@ def getConfigDescription(option):
   CONFIG_DESCRIPTIONS_LOCK.acquire()
 
   if option.lower() in CONFIG_DESCRIPTIONS:
-    returnVal = CONFIG_DESCRIPTIONS[option.lower()]
-  else: returnVal = None
+    return_val = CONFIG_DESCRIPTIONS[option.lower()]
+  else:
+    return_val = None
 
   CONFIG_DESCRIPTIONS_LOCK.release()
-  return returnVal
+  return return_val
 
-def getConfigOptions():
+
+def get_config_options():
   """
   Provides the configuration options from the loaded man page. This is an empty
   list if no man page has been loaded.
@@ -347,29 +408,33 @@ def getConfigOptions():
 
   CONFIG_DESCRIPTIONS_LOCK.acquire()
 
-  returnVal = [CONFIG_DESCRIPTIONS[opt].option for opt in CONFIG_DESCRIPTIONS]
+  return_val = [CONFIG_DESCRIPTIONS[opt].option for opt in CONFIG_DESCRIPTIONS]
 
   CONFIG_DESCRIPTIONS_LOCK.release()
-  return returnVal
+  return return_val
+
 
-def getConfigLocation():
+def get_config_location():
   """
   Provides the location of the torrc, raising an IOError with the reason if the
   path can't be determined.
   """
 
-  conn = torTools.getConn()
-  configLocation = conn.getInfo("config-file", None)
-  torPid, torPrefix = conn.controller.get_pid(None), CONFIG['tor.chroot']
-  if not configLocation: raise IOError("unable to query the torrc location")
+  conn = torTools.get_conn()
+  config_location = conn.get_info("config-file", None)
+  tor_pid, tor_prefix = conn.controller.get_pid(None), CONFIG['tor.chroot']
+
+  if not config_location:
+    raise IOError("unable to query the torrc location")
 
   try:
-    torCwd = system.get_cwd(torPid)
-    return torPrefix + system.expand_path(configLocation, torCwd)
-  except IOError, exc:
+    tor_cwd = system.get_cwd(tor_pid)
+    return tor_prefix + system.expand_path(config_location, tor_cwd)
+  except IOError as exc:
     raise IOError("querying tor's pwd failed because %s" % exc)
 
-def getMultilineParameters():
+
+def get_multiline_parameters():
   """
   Provides parameters that can be defined multiple times in the torrc without
   overwriting the value.
@@ -377,38 +442,44 @@ def getMultilineParameters():
 
   # fetches config options with the LINELIST (aka 'LineList'), LINELIST_S (aka
   # 'Dependent'), and LINELIST_V (aka 'Virtual') types
+
   global MULTILINE_PARAM
-  if MULTILINE_PARAM == None:
-    conn, multilineEntries = torTools.getConn(), []
-
-    configOptionQuery = conn.getInfo("config/names", None)
-    if configOptionQuery:
-      for line in configOptionQuery.strip().split("\n"):
-        confOption, confType = line.strip().split(" ", 1)
-        if confType in ("LineList", "Dependant", "Virtual"):
-          multilineEntries.append(confOption)
+
+  if MULTILINE_PARAM is None:
+    conn, multiline_entries = torTools.get_conn(), []
+
+    config_option_query = conn.get_info("config/names", None)
+
+    if config_option_query:
+      for line in config_option_query.strip().split("\n"):
+        conf_option, conf_type = line.strip().split(" ", 1)
+
+        if conf_type in ("LineList", "Dependant", "Virtual"):
+          multiline_entries.append(conf_option)
     else:
       # unable to query tor connection, so not caching results
       return ()
 
-    MULTILINE_PARAM = multilineEntries
+    MULTILINE_PARAM = multiline_entries
 
   return tuple(MULTILINE_PARAM)
 
-def getCustomOptions(includeValue = False):
+
+def get_custom_options(include_value = False):
   """
   Provides the torrc parameters that differ from their defaults.
 
   Arguments:
-    includeValue - provides the current value with results if true, otherwise
+    include_value - provides the current value with results if true, otherwise
                    this just contains the options
   """
 
-  configText = torTools.getConn().getInfo("config-text", "").strip()
-  configLines = configText.split("\n")
+  config_text = torTools.get_conn().get_info("config-text", "").strip()
+  config_lines = config_text.split("\n")
 
   # removes any duplicates
-  configLines = list(set(configLines))
+
+  config_lines = list(set(config_lines))
 
   # The "GETINFO config-text" query only provides options that differ
   # from Tor's defaults with the exception of its Log and Nickname entries
@@ -419,19 +490,28 @@ def getCustomOptions(includeValue = False):
   # due to special patching applied to it, as per:
   # https://trac.torproject.org/projects/tor/ticket/4602
 
-  try: configLines.remove("Log notice stdout")
-  except ValueError: pass
+  try:
+    config_lines.remove("Log notice stdout")
+  except ValueError:
+    pass
+
+  try:
+    config_lines.remove("Log notice file /var/log/tor/log")
+  except ValueError:
+    pass
 
-  try: configLines.remove("Log notice file /var/log/tor/log")
-  except ValueError: pass
+  try:
+    config_lines.remove("Nickname %s" % socket.gethostname())
+  except ValueError:
+    pass
 
-  try: configLines.remove("Nickname %s" % socket.gethostname())
-  except ValueError: pass
+  if include_value:
+    return config_lines
+  else:
+    return [line[:line.find(" ")] for line in config_lines]
 
-  if includeValue: return configLines
-  else: return [line[:line.find(" ")] for line in configLines]
 
-def saveConf(destination = None, contents = None):
+def save_conf(destination = None, contents = None):
   """
   Saves the configuration to the given path. If this is equivilant to
   issuing a SAVECONF (the contents and destination match what tor's using)
@@ -446,13 +526,17 @@ def saveConf(destination = None, contents = None):
   if destination:
     destination = os.path.abspath(destination)
 
-  # fills default config values, and sets isSaveconf to false if they differ
+  # fills default config values, and sets is_saveconf to false if they differ
   # from the arguments
-  isSaveconf, startTime = True, time.time()
 
-  currentConfig = getCustomOptions(True)
-  if not contents: contents = currentConfig
-  else: isSaveconf &= contents == currentConfig
+  is_saveconf, start_time = True, time.time()
+
+  current_config = get_custom_options(True)
+
+  if not contents:
+    contents = current_config
+  else:
+    is_saveconf &= contents == current_config
 
   # The "GETINFO config-text" option was introduced in Tor version 0.2.2.7. If
   # we're writing custom contents then this is fine, but if we're trying to
@@ -464,51 +548,70 @@ def saveConf(destination = None, contents = None):
     # double check that "GETINFO config-text" is unavailable rather than just
     # giving an empty result
 
-    if torTools.getConn().getInfo("config-text", None) == None:
+    if torTools.get_conn().get_info("config-text", None) is None:
       raise IOError("determining the torrc requires Tor version 0.2.2.7")
 
-  currentLocation = None
+  current_location = None
+
   try:
-    currentLocation = getConfigLocation()
-    if not destination: destination = currentLocation
-    else: isSaveconf &= destination == currentLocation
-  except IOError: pass
+    current_location = get_config_location()
+
+    if not destination:
+      destination = current_location
+    else:
+      is_saveconf &= destination == current_location
+  except IOError:
+    pass
+
+  if not destination:
+    raise IOError("unable to determine the torrc's path")
 
-  if not destination: raise IOError("unable to determine the torrc's path")
-  logMsg = "Saved config by %%s to %s (runtime: %%0.4f)" % destination
+  log_msg = "Saved config by %%s to %s (runtime: %%0.4f)" % destination
 
   # attempts SAVECONF if we're updating our torrc with the current state
-  if isSaveconf:
+
+  if is_saveconf:
     try:
-      torTools.getConn().saveConf()
+      torTools.get_conn().save_conf()
 
-      try: getTorrc().load()
-      except IOError: pass
+      try:
+        get_torrc().load()
+      except IOError:
+        pass
 
-      log.debug(logMsg % ("SAVECONF", time.time() - startTime))
-      return # if successful then we're done
+      log.debug(log_msg % ("SAVECONF", time.time() - start_time))
+      return  # if successful then we're done
     except:
       pass
 
   # if the SAVECONF fails or this is a custom save then write contents directly
+
   try:
     # make dir if the path doesn't already exist
-    baseDir = os.path.dirname(destination)
-    if not os.path.exists(baseDir): os.makedirs(baseDir)
+
+    base_dir = os.path.dirname(destination)
+
+    if not os.path.exists(base_dir):
+      os.makedirs(base_dir)
 
     # saves the configuration to the file
-    configFile = open(destination, "w")
-    configFile.write("\n".join(contents))
-    configFile.close()
-  except (IOError, OSError), exc:
+
+    config_file = open(destination, "w")
+    config_file.write("\n".join(contents))
+    config_file.close()
+  except (IOError, OSError) as exc:
     raise IOError(exc)
 
   # reloads the cached torrc if overwriting it
-  if destination == currentLocation:
-    try: getTorrc().load()
-    except IOError: pass
 
-  log.debug(logMsg % ("directly writing", time.time() - startTime))
+  if destination == current_location:
+    try:
+      get_torrc().load()
+    except IOError:
+      pass
+
+  log.debug(log_msg % ("directly writing", time.time() - start_time))
+
 
 def validate(contents = None):
   """
@@ -520,139 +623,168 @@ def validate(contents = None):
     contents - torrc contents
   """
 
-  conn = torTools.getConn()
-  customOptions = getCustomOptions()
-  issuesFound, seenOptions = [], []
+  conn = torTools.get_conn()
+  custom_options = get_custom_options()
+  issues_found, seen_options = [], []
 
   # Strips comments and collapses multiline multi-line entries, for more
   # information see:
   # https://trac.torproject.org/projects/tor/ticket/1929
-  strippedContents, multilineBuffer = [], ""
-  for line in _stripComments(contents):
-    if not line: strippedContents.append("")
+
+  stripped_contents, multiline_buffer = [], ""
+
+  for line in _strip_comments(contents):
+    if not line:
+      stripped_contents.append("")
     else:
-      line = multilineBuffer + line
-      multilineBuffer = ""
+      line = multiline_buffer + line
+      multiline_buffer = ""
 
       if line.endswith("\\"):
-        multilineBuffer = line[:-1]
-        strippedContents.append("")
+        multiline_buffer = line[:-1]
+        stripped_contents.append("")
       else:
-        strippedContents.append(line.strip())
+        stripped_contents.append(line.strip())
+
+  for line_number in range(len(stripped_contents) - 1, -1, -1):
+    line_text = stripped_contents[line_number]
 
-  for lineNumber in range(len(strippedContents) - 1, -1, -1):
-    lineText = strippedContents[lineNumber]
-    if not lineText: continue
+    if not line_text:
+      continue
 
-    lineComp = lineText.split(None, 1)
-    if len(lineComp) == 2: option, value = lineComp
-    else: option, value = lineText, ""
+    line_comp = line_text.split(None, 1)
+
+    if len(line_comp) == 2:
+      option, value = line_comp
+    else:
+      option, value = line_text, ""
 
     # Tor is case insensetive when parsing its torrc. This poses a bit of an
     # issue for us because we want all of our checks to be case insensetive
     # too but also want messages to match the normal camel-case conventions.
     #
-    # Using the customOptions to account for this. It contains the tor reported
+    # Using the custom_options to account for this. It contains the tor reported
     # options (camel case) and is either a matching set or the following defaut
     # value check will fail. Hence using that hash to correct the case.
     #
     # TODO: when refactoring for stem make this less confusing...
 
-    for customOpt in customOptions:
-      if customOpt.lower() == option.lower():
-        option = customOpt
+    for custom_opt in custom_options:
+      if custom_opt.lower() == option.lower():
+        option = custom_opt
         break
 
     # if an aliased option then use its real name
+
     if option in CONFIG["torrc.alias"]:
       option = CONFIG["torrc.alias"][option]
 
     # most parameters are overwritten if defined multiple times
-    if option in seenOptions and not option in getMultilineParameters():
-      issuesFound.append((lineNumber, ValidationError.DUPLICATE, option))
+
+    if option in seen_options and not option in get_multiline_parameters():
+      issues_found.append((line_number, ValidationError.DUPLICATE, option))
       continue
-    else: seenOptions.append(option)
+    else:
+      seen_options.append(option)
 
     # checks if the value isn't necessary due to matching the defaults
-    if not option in customOptions:
-      issuesFound.append((lineNumber, ValidationError.IS_DEFAULT, option))
+
+    if not option in custom_options:
+      issues_found.append((line_number, ValidationError.IS_DEFAULT, option))
 
     # replace aliases with their recognized representation
+
     if option in CONFIG["torrc.alias"]:
       option = CONFIG["torrc.alias"][option]
 
     # tor appears to replace tabs with a space, for instance:
     # "accept\t*:563" is read back as "accept *:563"
+
     value = value.replace("\t", " ")
 
     # parse value if it's a size or time, expanding the units
-    value, valueType = _parseConfValue(value)
+
+    value, value_type = _parse_conf_value(value)
 
     # issues GETCONF to get the values tor's currently configured to use
-    torValues = conn.getOption(option, [], True)
+
+    tor_values = conn.get_option(option, [], True)
 
     # multiline entries can be comma separated values (for both tor and conf)
-    valueList = [value]
-    if option in getMultilineParameters():
-      valueList = [val.strip() for val in value.split(",")]
-
-      fetchedValues, torValues = torValues, []
-      for fetchedValue in fetchedValues:
-        for fetchedEntry in fetchedValue.split(","):
-          fetchedEntry = fetchedEntry.strip()
-          if not fetchedEntry in torValues:
-            torValues.append(fetchedEntry)
-
-    for val in valueList:
+
+    value_list = [value]
+
+    if option in get_multiline_parameters():
+      value_list = [val.strip() for val in value.split(",")]
+
+      fetched_values, tor_values = tor_values, []
+      for fetched_value in fetched_values:
+        for fetched_entry in fetched_value.split(","):
+          fetched_entry = fetched_entry.strip()
+
+          if not fetched_entry in tor_values:
+            tor_values.append(fetched_entry)
+
+    for val in value_list:
       # checks if both the argument and tor's value are empty
-      isBlankMatch = not val and not torValues
 
-      if not isBlankMatch and not val in torValues:
+      is_blank_match = not val and not tor_values
+
+      if not is_blank_match and not val in tor_values:
         # converts corrections to reader friedly size values
-        displayValues = torValues
-        if valueType == ValueType.SIZE:
-          displayValues = [str_tools.get_size_label(int(val)) for val in torValues]
-        elif valueType == ValueType.TIME:
-          displayValues = [str_tools.get_time_label(int(val)) for val in torValues]
 
-        issuesFound.append((lineNumber, ValidationError.MISMATCH, ", ".join(displayValues)))
+        display_values = tor_values
+
+        if value_type == ValueType.SIZE:
+          display_values = [str_tools.get_size_label(int(val)) for val in tor_values]
+        elif value_type == ValueType.TIME:
+          display_values = [str_tools.get_time_label(int(val)) for val in tor_values]
+
+        issues_found.append((line_number, ValidationError.MISMATCH, ", ".join(display_values)))
 
   # checks if any custom options are missing from the torrc
-  for option in customOptions:
+
+  for option in custom_options:
     # In new versions the 'DirReqStatistics' option is true by default and
     # disabled on startup if geoip lookups are unavailable. If this option is
     # missing then that's most likely the reason.
     #
     # https://trac.torproject.org/projects/tor/ticket/4237
 
-    if option == "DirReqStatistics": continue
+    if option == "DirReqStatistics":
+      continue
+
+    if not option in seen_options:
+      issues_found.append((None, ValidationError.MISSING, option))
 
-    if not option in seenOptions:
-      issuesFound.append((None, ValidationError.MISSING, option))
+  return issues_found
 
-  return issuesFound
 
-def _parseConfValue(confArg):
+def _parse_conf_value(conf_arg):
   """
   Converts size or time values to their lowest units (bytes or seconds) which
   is what GETCONF calls provide. The returned is a tuple of the value and unit
   type.
 
   Arguments:
-    confArg - torrc argument
+    conf_arg - torrc argument
   """
 
-  if confArg.count(" ") == 1:
-    val, unit = confArg.lower().split(" ", 1)
-    if not val.isdigit(): return confArg, ValueType.UNRECOGNIZED
-    mult, multType = _getUnitType(unit)
+  if conf_arg.count(" ") == 1:
+    val, unit = conf_arg.lower().split(" ", 1)
+
+    if not val.isdigit():
+      return conf_arg, ValueType.UNRECOGNIZED
+
+    mult, mult_type = _get_unit_type(unit)
 
-    if mult != None:
-      return str(int(val) * mult), multType
+    if mult is not None:
+      return str(int(val) * mult), mult_type
 
-  return confArg, ValueType.UNRECOGNIZED
+  return conf_arg, ValueType.UNRECOGNIZED
 
-def _getUnitType(unit):
+
+def _get_unit_type(unit):
   """
   Provides the type and multiplier for an argument's unit. The multiplier is
   None if the unit isn't recognized.
@@ -671,7 +803,8 @@ def _getUnitType(unit):
 
   return None, ValueType.UNRECOGNIZED
 
-def _stripComments(contents):
+
+def _strip_comments(contents):
   """
   Removes comments and extra whitespace from the given torrc contents.
 
@@ -679,11 +812,16 @@ def _stripComments(contents):
     contents - torrc contents
   """
 
-  strippedContents = []
+  stripped_contents = []
+
   for line in contents:
-    if line and "#" in line: line = line[:line.find("#")]
-    strippedContents.append(line.strip())
-  return strippedContents
+    if line and "#" in line:
+      line = line[:line.find("#")]
+
+    stripped_contents.append(line.strip())
+
+  return stripped_contents
+
 
 class Torrc():
   """
@@ -692,76 +830,76 @@ class Torrc():
 
   def __init__(self):
     self.contents = None
-    self.configLocation = None
-    self.valsLock = threading.RLock()
+    self.config_location = None
+    self.vals_lock = threading.RLock()
 
     # cached results for the current contents
-    self.displayableContents = None
-    self.strippedContents = None
+    self.displayable_contents = None
+    self.stripped_contents = None
     self.corrections = None
 
     # flag to indicate if we've given a load failure warning before
-    self.isLoadFailWarned = False
+    self.is_foad_fail_warned = False
 
-  def load(self, logFailure = False):
+  def load(self, log_failure = False):
     """
     Loads or reloads the torrc contents, raising an IOError if there's a
     problem.
 
     Arguments:
-      logFailure - if the torrc fails to load and we've never provided a
+      log_failure - if the torrc fails to load and we've never provided a
                    warning for this before then logs a warning
     """
 
-    self.valsLock.acquire()
+    self.vals_lock.acquire()
 
     # clears contents and caches
-    self.contents, self.configLocation = None, None
-    self.displayableContents = None
-    self.strippedContents = None
+    self.contents, self.config_location = None, None
+    self.displayable_contents = None
+    self.stripped_contents = None
     self.corrections = None
 
     try:
-      self.configLocation = getConfigLocation()
-      configFile = open(self.configLocation, "r")
-      self.contents = configFile.readlines()
-      configFile.close()
-    except IOError, exc:
-      if logFailure and not self.isLoadFailWarned:
+      self.config_location = get_config_location()
+      config_file = open(self.config_location, "r")
+      self.contents = config_file.readlines()
+      config_file.close()
+    except IOError as exc:
+      if log_failure and not self.is_foad_fail_warned:
         log.warn("Unable to load torrc (%s)" % exc.strerror)
-        self.isLoadFailWarned = True
+        self.is_foad_fail_warned = True
 
-      self.valsLock.release()
+      self.vals_lock.release()
       raise exc
 
-    self.valsLock.release()
+    self.vals_lock.release()
 
-  def isLoaded(self):
+  def is_loaded(self):
     """
     Provides true if there's loaded contents, false otherwise.
     """
 
-    return self.contents != None
+    return self.contents is not None
 
-  def getConfigLocation(self):
+  def get_config_location(self):
     """
     Provides the location of the loaded configuration contents. This may be
     available, even if the torrc failed to be loaded.
     """
 
-    return self.configLocation
+    return self.config_location
 
-  def getContents(self):
+  def get_contents(self):
     """
     Provides the contents of the configuration file.
     """
 
-    self.valsLock.acquire()
-    returnVal = list(self.contents) if self.contents else None
-    self.valsLock.release()
-    return returnVal
+    self.vals_lock.acquire()
+    return_val = list(self.contents) if self.contents else None
+    self.vals_lock.release()
+    return return_val
 
-  def getDisplayContents(self, strip = False):
+  def get_display_contents(self, strip = False):
     """
     Provides the contents of the configuration file, formatted in a rendering
     frindly fashion:
@@ -774,183 +912,194 @@ class Torrc():
       strip - removes comments and extra whitespace if true
     """
 
-    self.valsLock.acquire()
+    self.vals_lock.acquire()
 
-    if not self.isLoaded(): returnVal = None
+    if not self.is_loaded():
+      return_val = None
     else:
-      if self.displayableContents == None:
+      if self.displayable_contents is None:
         # restricts contents to displayable characters
-        self.displayableContents = []
+        self.displayable_contents = []
 
-        for lineNum in range(len(self.contents)):
-          lineText = self.contents[lineNum]
-          lineText = lineText.replace("\t", "   ")
-          lineText = uiTools.getPrintable(lineText)
-          self.displayableContents.append(lineText)
+        for line_number in range(len(self.contents)):
+          line_text = self.contents[line_number]
+          line_text = line_text.replace("\t", "   ")
+          line_text = uiTools.get_printable(line_text)
+          self.displayable_contents.append(line_text)
 
       if strip:
-        if self.strippedContents == None:
-          self.strippedContents = _stripComments(self.displayableContents)
+        if self.stripped_contents is None:
+          self.stripped_contents = _strip_comments(self.displayable_contents)
 
-        returnVal = list(self.strippedContents)
-      else: returnVal = list(self.displayableContents)
+        return_val = list(self.stripped_contents)
+      else:
+        return_val = list(self.displayable_contents)
 
-    self.valsLock.release()
-    return returnVal
+    self.vals_lock.release()
+    return return_val
 
-  def getCorrections(self):
+  def get_corrections(self):
     """
     Performs validation on the loaded contents and provides back the
     corrections. If validation is disabled then this won't provide any
     results.
     """
 
-    self.valsLock.acquire()
+    self.vals_lock.acquire()
 
-    if not self.isLoaded(): returnVal = None
+    if not self.is_loaded():
+      return_val = None
     else:
-      torVersion = torTools.getConn().getVersion()
-      skipValidation = not CONFIG["features.torrc.validate"]
-      skipValidation |= (torVersion is None or not torVersion >= stem.version.Requirement.GETINFO_CONFIG_TEXT)
+      tor_version = torTools.get_conn().get_version()
+      skip_validation = not CONFIG["features.torrc.validate"]
+      skip_validation |= (tor_version is None or not tor_version >= stem.version.Requirement.GETINFO_CONFIG_TEXT)
 
-      if skipValidation:
+      if skip_validation:
         log.info("Skipping torrc validation (requires tor 0.2.2.7-alpha)")
-        returnVal = {}
+        return_val = {}
       else:
-        if self.corrections == None:
+        if self.corrections is None:
           self.corrections = validate(self.contents)
 
-        returnVal = list(self.corrections)
+        return_val = list(self.corrections)
 
-    self.valsLock.release()
-    return returnVal
+    self.vals_lock.release()
+    return return_val
 
-  def getLock(self):
+  def get_lock(self):
     """
     Provides the lock governing concurrent access to the contents.
     """
 
-    return self.valsLock
+    return self.vals_lock
 
-  def logValidationIssues(self):
+  def log_validation_issues(self):
     """
     Performs validation on the loaded contents, and logs warnings for issues
     that are found.
     """
 
-    corrections = self.getCorrections()
+    corrections = self.get_corrections()
 
     if corrections:
-      duplicateOptions, defaultOptions, mismatchLines, missingOptions = [], [], [], []
+      duplicate_options, default_options, mismatch_lines, missing_options = [], [], [], []
 
-      for lineNum, issue, msg in corrections:
+      for line_number, issue, msg in corrections:
         if issue == ValidationError.DUPLICATE:
-          duplicateOptions.append("%s (line %i)" % (msg, lineNum + 1))
+          duplicate_options.append("%s (line %i)" % (msg, line_number + 1))
         elif issue == ValidationError.IS_DEFAULT:
-          defaultOptions.append("%s (line %i)" % (msg, lineNum + 1))
-        elif issue == ValidationError.MISMATCH: mismatchLines.append(lineNum + 1)
-        elif issue == ValidationError.MISSING: missingOptions.append(msg)
+          default_options.append("%s (line %i)" % (msg, line_number + 1))
+        elif issue == ValidationError.MISMATCH:
+          mismatch_lines.append(line_number + 1)
+        elif issue == ValidationError.MISSING:
+          missing_options.append(msg)
 
-      if duplicateOptions or defaultOptions:
+      if duplicate_options or default_options:
         msg = "Unneeded torrc entries found. They've been highlighted in blue on the torrc page."
 
-        if duplicateOptions:
-          if len(duplicateOptions) > 1:
+        if duplicate_options:
+          if len(duplicate_options) > 1:
             msg += "\n- entries ignored due to having duplicates: "
           else:
             msg += "\n- entry ignored due to having a duplicate: "
 
-          duplicateOptions.sort()
-          msg += ", ".join(duplicateOptions)
+          duplicate_options.sort()
+          msg += ", ".join(duplicate_options)
 
-        if defaultOptions:
-          if len(defaultOptions) > 1:
+        if default_options:
+          if len(default_options) > 1:
             msg += "\n- entries match their default values: "
           else:
             msg += "\n- entry matches its default value: "
 
-          defaultOptions.sort()
-          msg += ", ".join(defaultOptions)
+          default_options.sort()
+          msg += ", ".join(default_options)
 
         log.notice(msg)
 
-      if mismatchLines or missingOptions:
+      if mismatch_lines or missing_options:
         msg = "The torrc differs from what tor's using. You can issue a sighup to reload the torrc values by pressing x."
 
-        if mismatchLines:
-          if len(mismatchLines) > 1:
+        if mismatch_lines:
+          if len(mismatch_lines) > 1:
             msg += "\n- torrc values differ on lines: "
           else:
             msg += "\n- torrc value differs on line: "
 
-          mismatchLines.sort()
-          msg += ", ".join([str(val + 1) for val in mismatchLines])
+          mismatch_lines.sort()
+          msg += ", ".join([str(val + 1) for val in mismatch_lines])
 
-        if missingOptions:
-          if len(missingOptions) > 1:
+        if missing_options:
+          if len(missing_options) > 1:
             msg += "\n- configuration values are missing from the torrc: "
           else:
             msg += "\n- configuration value is missing from the torrc: "
 
-          missingOptions.sort()
-          msg += ", ".join(missingOptions)
+          missing_options.sort()
+          msg += ", ".join(missing_options)
 
         log.warn(msg)
 
-def _testConfigDescriptions():
+
+def _test_config_descriptions():
   """
-  Tester for the loadOptionDescriptions function, fetching the man page
+  Tester for the load_option_descriptions function, fetching the man page
   contents and dumping its parsed results.
   """
 
-  loadOptionDescriptions()
-  sortedOptions = CONFIG_DESCRIPTIONS.keys()
-  sortedOptions.sort()
+  load_option_descriptions()
+  sorted_options = CONFIG_DESCRIPTIONS.keys()
+  sorted_options.sort()
 
-  for i in range(len(sortedOptions)):
-    option = sortedOptions[i]
-    argument, description = getConfigDescription(option)
-    optLabel = "OPTION: \"%s\"" % option
-    argLabel = "ARGUMENT: \"%s\"" % argument
+  for i in range(len(sorted_options)):
+    option = sorted_options[i]
+    argument, description = get_config_description(option)
+    opt_label = "OPTION: \"%s\"" % option
+    arg_label = "ARGUMENT: \"%s\"" % argument
 
-    print "     %-45s %s" % (optLabel, argLabel)
+    print "     %-45s %s" % (opt_label, arg_label)
     print "\"%s\"" % description
-    if i != len(sortedOptions) - 1: print "-" * 80
 
-def isRootNeeded(torrcPath):
+    if i != len(sorted_options) - 1:
+      print "-" * 80
+
+
+def is_root_needed(torrc_path):
   """
   Returns True if the given torrc needs root permissions to be ran, False
   otherwise. This raises an IOError if the torrc can't be read.
 
   Arguments:
-    torrcPath - torrc to be checked
+    torrc_path - torrc to be checked
   """
 
   try:
-    torrcFile = open(torrcPath, "r")
-    torrcLines = torrcFile.readlines()
-    torrcFile.close()
+    torrc_file = open(torrc_path, "r")
+    torrc_lines = torrc_file.readlines()
+    torrc_file.close()
 
-    for line in torrcLines:
+    for line in torrc_lines:
       line = line.strip()
 
-      isPortOpt = False
+      is_port_opt = False
+
       for opt in PORT_OPT:
         if line.startswith(opt):
-          isPortOpt = True
+          is_port_opt = True
           break
 
-      if isPortOpt and " " in line:
+      if is_port_opt and " " in line:
         arg = line.split(" ")[1]
 
         if arg.isdigit() and int(arg) <= 1024 and int(arg) != 0:
           return True
 
     return False
-  except Exception, exc:
+  except Exception as exc:
     raise IOError(exc)
 
-def renderTorrc(template, options, commentIndent = 30):
+
+def render_torrc(template, options, comment_indent = 30):
   """
   Uses the given template to generate a nicely formatted torrc with the given
   options. The tempating language this recognizes is a simple one, recognizing
@@ -969,51 +1118,59 @@ def renderTorrc(template, options, commentIndent = 30):
     template      - torrc template lines used to generate the results
     options       - mapping of keywords to their given values, with values
                     being booleans or strings (possibly multi-line)
-    commentIndent - minimum column that comments align on
+    comment_indent - minimum column that comments align on
   """
 
   results = []
-  templateIter = iter(template)
-  commentLineFormat = "%%-%is%%s" % commentIndent
+  template_iter = iter(template)
+  comment_line_format = "%%-%is%%s" % comment_indent
 
   try:
     while True:
-      line = templateIter.next().strip()
+      line = template_iter.next().strip()
 
       if line.startswith("[IF ") and line.endswith("]"):
         # checks if any of the conditional options are true or a non-empty string
-        evaluatesTrue = False
+
+        evaluates_true = False
+
         for cond in line[4:-1].split("|"):
-          isInverse = False
+          is_inverse = False
+
           if cond.startswith("NOT "):
-            isInverse = True
+            is_inverse = True
             cond = cond[4:]
 
-          if isInverse != bool(options.get(cond.strip())):
-            evaluatesTrue = True
+          if is_inverse != bool(options.get(cond.strip())):
+            evaluates_true = True
             break
 
-        if evaluatesTrue:
+        if evaluates_true:
           continue
         else:
           # skips lines until we come to an else or the end of the block
           depth = 0
 
           while depth != -1:
-            line = templateIter.next().strip()
-
-            if line.startswith("[IF ") and line.endswith("]"): depth += 1
-            elif line == "[END IF]": depth -= 1
-            elif depth == 0 and line == "[ELSE]": depth -= 1
+            line = template_iter.next().strip()
+
+            if line.startswith("[IF ") and line.endswith("]"):
+              depth += 1
+            elif line == "[END IF]":
+              depth -= 1
+            elif depth == 0 and line == "[ELSE]":
+              depth -= 1
       elif line == "[ELSE]":
         # an else block we aren't using - skip to the end of it
         depth = 0
 
         while depth != -1:
-          line = templateIter.next().strip()
+          line = template_iter.next().strip()
 
-          if line.startswith("[IF "): depth += 1
-          elif line == "[END IF]": depth -= 1
+          if line.startswith("[IF "):
+            depth += 1
+          elif line == "[END IF]":
+            depth -= 1
       elif line == "[NEWLINE]":
         # explicit newline
         results.append("")
@@ -1022,41 +1179,54 @@ def renderTorrc(template, options, commentIndent = 30):
         results.append(line)
       elif line.startswith("[") and line.endswith("]"):
         # completely dynamic entry
-        optValue = options.get(line[1:-1])
-        if optValue: results.append(optValue)
+
+        opt_value = options.get(line[1:-1])
+
+        if opt_value:
+          results.append(opt_value)
       else:
         # torrc option line
+
         option, arg, comment = "", "", ""
-        parsedLine = line
+        parsed_line = line
 
-        if "#" in parsedLine:
-          parsedLine, comment = parsedLine.split("#", 1)
-          parsedLine = parsedLine.strip()
+        if "#" in parsed_line:
+          parsed_line, comment = parsed_line.split("#", 1)
+          parsed_line = parsed_line.strip()
           comment = "# %s" % comment.strip()
 
         # parses the argument from the option
-        if " " in parsedLine.strip():
-          option, arg = parsedLine.split(" ", 1)
+
+        if " " in parsed_line.strip():
+          option, arg = parsed_line.split(" ", 1)
           option = option.strip()
         else:
           log.info("torrc template option lacks an argument: '%s'" % line)
           continue
 
         # inputs dynamic arguments
+
         if arg.startswith("[") and arg.endswith("]"):
           arg = options.get(arg[1:-1])
 
         # skips argument if it's false or an empty string
-        if not arg: continue
 
-        torrcEntry = "%s %s" % (option, arg)
-        if comment: results.append(commentLineFormat % (torrcEntry + " ", comment))
-        else: results.append(torrcEntry)
-  except StopIteration: pass
+        if not arg:
+          continue
+
+        torrc_entry = "%s %s" % (option, arg)
+
+        if comment:
+          results.append(comment_line_format % (torrc_entry + " ", comment))
+        else:
+          results.append(torrc_entry)
+  except StopIteration:
+    pass
 
   return "\n".join(results)
 
-def loadConfigurationDescriptions(pathPrefix):
+
+def load_configuration_descriptions(path_prefix):
   """
   Attempts to load descriptions for tor's configuration options, fetching them
   from the man page and persisting them to a file to speed future startups.
@@ -1067,58 +1237,65 @@ def loadConfigurationDescriptions(pathPrefix):
   # why... curses must mess the terminal in a way that's important to man).
 
   if CONFIG["features.config.descriptions.enabled"]:
-    isConfigDescriptionsLoaded = False
+    is_config_descriptions_loaded = False
 
     # determines the path where cached descriptions should be persisted (left
     # undefined if caching is disabled)
-    descriptorPath = None
+
+    descriptor_path = None
+
     if CONFIG["features.config.descriptions.persist"]:
-      dataDir = CONFIG["startup.dataDirectory"]
-      if not dataDir.endswith("/"): dataDir += "/"
+      data_dir = CONFIG["startup.data_directory"]
 
-      descriptorPath = os.path.expanduser(dataDir + "cache/") + CONFIG_DESC_FILENAME
+      if not data_dir.endswith("/"):
+        data_dir += "/"
+
+      descriptor_path = os.path.expanduser(data_dir + "cache/") + CONFIG_DESC_FILENAME
 
     # attempts to load configuration descriptions cached in the data directory
-    if descriptorPath:
+
+    if descriptor_path:
       try:
-        loadStartTime = time.time()
-        loadOptionDescriptions(descriptorPath)
-        isConfigDescriptionsLoaded = True
+        load_start_time = time.time()
+        load_option_descriptions(descriptor_path)
+        is_config_descriptions_loaded = True
 
-        log.info(DESC_LOAD_SUCCESS_MSG % (descriptorPath, time.time() - loadStartTime))
-      except IOError, exc:
+        log.info(DESC_LOAD_SUCCESS_MSG % (descriptor_path, time.time() - load_start_time))
+      except IOError as exc:
         log.info(DESC_LOAD_FAILED_MSG % exc.strerror)
 
     # fetches configuration options from the man page
-    if not isConfigDescriptionsLoaded:
+
+    if not is_config_descriptions_loaded:
       try:
-        loadStartTime = time.time()
-        loadOptionDescriptions()
-        isConfigDescriptionsLoaded = True
+        load_start_time = time.time()
+        load_option_descriptions()
+        is_config_descriptions_loaded = True
 
-        log.info(DESC_READ_MAN_SUCCESS_MSG % (time.time() - loadStartTime))
-      except IOError, exc:
+        log.info(DESC_READ_MAN_SUCCESS_MSG % (time.time() - load_start_time))
+      except IOError as exc:
         log.notice(DESC_READ_MAN_FAILED_MSG % exc.strerror)
 
       # persists configuration descriptions
-      if isConfigDescriptionsLoaded and descriptorPath:
+
+      if is_config_descriptions_loaded and descriptor_path:
         try:
-          loadStartTime = time.time()
-          saveOptionDescriptions(descriptorPath)
-          log.info(DESC_SAVE_SUCCESS_MSG % (descriptorPath, time.time() - loadStartTime))
-        except IOError, exc:
+          load_start_time = time.time()
+          save_option_descriptions(descriptor_path)
+          log.info(DESC_SAVE_SUCCESS_MSG % (descriptor_path, time.time() - load_start_time))
+        except IOError as exc:
           log.notice(DESC_SAVE_FAILED_MSG % exc.strerror)
-        except OSError, exc:
+        except OSError as exc:
           log.notice(DESC_SAVE_FAILED_MSG % exc)
 
     # finally fall back to the cached descriptors provided with arm (this is
     # often the case for tbb and manual builds)
-    if not isConfigDescriptionsLoaded:
+
+    if not is_config_descriptions_loaded:
       try:
-        loadStartTime = time.time()
-        loadedVersion = loadOptionDescriptions("%sresources/%s" % (pathPrefix, CONFIG_DESC_FILENAME), False)
-        isConfigDescriptionsLoaded = True
-        log.notice(DESC_INTERNAL_LOAD_SUCCESS_MSG % loadedVersion)
-      except IOError, exc:
+        load_start_time = time.time()
+        loaded_version = load_option_descriptions("%sresources/%s" % (path_prefix, CONFIG_DESC_FILENAME), False)
+        is_config_descriptions_loaded = True
+        log.notice(DESC_INTERNAL_LOAD_SUCCESS_MSG % loaded_version)
+      except IOError as exc:
         log.error(DESC_INTERNAL_LOAD_FAILED_MSG % exc.strerror)
-
diff --git a/arm/util/torTools.py b/arm/util/torTools.py
index 3749972..a7945fd 100644
--- a/arm/util/torTools.py
+++ b/arm/util/torTools.py
@@ -13,18 +13,22 @@ import stem.control
 
 from stem.util import log, proc, system
 
-CONTROLLER = None # singleton Controller instance
+CONTROLLER = None  # singleton Controller instance
 
 UNDEFINED = "<Undefined_ >"
 
-def getConn():
+
+def get_conn():
   """
   Singleton constructor for a Controller. Be aware that this starts as being
   uninitialized, needing a stem Controller before it's fully functional.
   """
 
   global CONTROLLER
-  if CONTROLLER == None: CONTROLLER = Controller()
+
+  if CONTROLLER is None:
+    CONTROLLER = Controller()
+
   return CONTROLLER
 
 
@@ -37,14 +41,14 @@ class Controller:
 
   def __init__(self):
     self.controller = None
-    self.connLock = threading.RLock()
-    self._fingerprintMappings = None    # mappings of ip -> [(port, fingerprint), ...]
-    self._fingerprintLookupCache = {}   # lookup cache with (ip, port) -> fingerprint mappings
-    self._nicknameLookupCache = {}      # lookup cache with fingerprint -> nickname mappings
-    self._addressLookupCache = {}       # lookup cache with fingerprint -> (ip address, or port) mappings
-    self._consensusLookupCache = {}     # lookup cache with network status entries
-    self._descriptorLookupCache = {}    # lookup cache with relay descriptors
-    self._lastNewnym = 0                # time we last sent a NEWNYM signal
+    self.conn_lock = threading.RLock()
+    self._fingerprint_mappings = None     # mappings of ip -> [(port, fingerprint), ...]
+    self._fingerprint_lookup_cache = {}   # lookup cache with (ip, port) -> fingerprint mappings
+    self._nickname_lookup_cache = {}      # lookup cache with fingerprint -> nickname mappings
+    self._address_lookup_cache = {}       # lookup cache with fingerprint -> (ip address, or port) mappings
+    self._consensus_lookup_cache = {}     # lookup cache with network status entries
+    self._descriptor_lookup_cache = {}    # lookup cache with relay descriptors
+    self._last_newnym = 0                 # time we last sent a NEWNYM signal
 
   def init(self, controller):
     """
@@ -59,9 +63,11 @@ class Controller:
     # re-attached. This is a point of regression until we do... :(
 
     if controller.is_alive() and controller != self.controller:
-      self.connLock.acquire()
+      self.conn_lock.acquire()
+
+      if self.controller:
+        self.close()  # shut down current connection
 
-      if self.controller: self.close() # shut down current connection
       self.controller = controller
       log.info("Stem connected to tor version %s" % self.controller.get_version())
 
@@ -70,48 +76,55 @@ class Controller:
       self.controller.add_event_listener(self.new_desc_event, stem.control.EventType.NEWDESC)
 
       # reset caches for ip -> fingerprint lookups
-      self._fingerprintMappings = None
-      self._fingerprintLookupCache = {}
-      self._nicknameLookupCache = {}
-      self._addressLookupCache = {}
-      self._consensusLookupCache = {}
-      self._descriptorLookupCache = {}
+
+      self._fingerprint_mappings = None
+      self._fingerprint_lookup_cache = {}
+      self._nickname_lookup_cache = {}
+      self._address_lookup_cache = {}
+      self._consensus_lookup_cache = {}
+      self._descriptor_lookup_cache = {}
 
       # time that we sent our last newnym signal
-      self._lastNewnym = 0
 
-      self.connLock.release()
+      self._last_newnym = 0
+
+      self.conn_lock.release()
 
   def close(self):
     """
     Closes the current stem instance and notifies listeners.
     """
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
+
     if self.controller:
       self.controller.close()
-    self.connLock.release()
 
-  def getController(self):
+    self.conn_lock.release()
+
+  def get_controller(self):
     return self.controller
 
-  def isAlive(self):
+  def is_alive(self):
     """
     Returns True if this has been initialized with a working stem instance,
     False otherwise.
     """
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
     result = False
+
     if self.controller:
-      if self.controller.is_alive(): result = True
-      else: self.close()
+      if self.controller.is_alive():
+        result = True
+      else:
+        self.close()
 
-    self.connLock.release()
+    self.conn_lock.release()
     return result
 
-  def getInfo(self, param, default = UNDEFINED):
+  def get_info(self, param, default = UNDEFINED):
     """
     Queries the control port for the given GETINFO option, providing the
     default if the response is undefined or fails for any reason (error
@@ -122,10 +135,10 @@ class Controller:
       default - result if the query fails
     """
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
     try:
-      if not self.isAlive():
+      if not self.is_alive():
         if default != UNDEFINED:
           return default
         else:
@@ -135,13 +148,13 @@ class Controller:
         return self.controller.get_info(param, default)
       else:
         return self.controller.get_info(param)
-    except stem.SocketClosed, exc:
+    except stem.SocketClosed as exc:
       self.close()
       raise exc
     finally:
-      self.connLock.release()
+      self.conn_lock.release()
 
-  def getOption(self, param, default = UNDEFINED, multiple = False):
+  def get_option(self, param, default = UNDEFINED, multiple = False):
     """
     Queries the control port for the given configuration option, providing the
     default if the response is undefined or fails for any reason. If multiple
@@ -155,10 +168,10 @@ class Controller:
                   this just provides the first result
     """
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
     try:
-      if not self.isAlive():
+      if not self.is_alive():
         if default != UNDEFINED:
           return default
         else:
@@ -168,13 +181,13 @@ class Controller:
         return self.controller.get_conf(param, default, multiple)
       else:
         return self.controller.get_conf(param, multiple = multiple)
-    except stem.SocketClosed, exc:
+    except stem.SocketClosed as exc:
       self.close()
       raise exc
     finally:
-      self.connLock.release()
+      self.conn_lock.release()
 
-  def setOption(self, param, value = None):
+  def set_option(self, param, value = None):
     """
     Issues a SETCONF to set the given option/value pair. An exeptions raised
     if it fails to be set. If no value is provided then this sets the option to
@@ -186,67 +199,69 @@ class Controller:
               list of strings)
     """
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
     try:
-      if not self.isAlive():
+      if not self.is_alive():
         raise stem.SocketClosed()
 
       self.controller.set_conf(param, value)
-    except stem.SocketClosed, exc:
+    except stem.SocketClosed as exc:
       self.close()
       raise exc
     finally:
-      self.connLock.release()
+      self.conn_lock.release()
 
-  def saveConf(self):
+  def save_conf(self):
     """
     Calls tor's SAVECONF method.
     """
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
-    if self.isAlive():
+    if self.is_alive():
       self.controller.save_conf()
 
-    self.connLock.release()
+    self.conn_lock.release()
 
-  def sendNewnym(self):
+  def send_newnym(self):
     """
     Sends a newnym request to Tor. These are rate limited so if it occures
     more than once within a ten second window then the second is delayed.
     """
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
-    if self.isAlive():
-      self._lastNewnym = time.time()
+    if self.is_alive():
+      self._last_newnym = time.time()
       self.controller.signal(stem.Signal.NEWNYM)
 
-    self.connLock.release()
+    self.conn_lock.release()
 
-  def isNewnymAvailable(self):
+  def is_newnym_available(self):
     """
     True if Tor will immediately respect a newnym request, false otherwise.
     """
 
-    if self.isAlive():
-      return self.getNewnymWait() == 0
-    else: return False
+    if self.is_alive():
+      return self.get_newnym_wait() == 0
+    else:
+      return False
 
-  def getNewnymWait(self):
+  def get_newnym_wait(self):
     """
     Provides the number of seconds until a newnym signal would be respected.
     """
 
     # newnym signals can occure at the rate of one every ten seconds
     # TODO: this can't take other controllers into account :(
-    return max(0, math.ceil(self._lastNewnym + 10 - time.time()))
 
-  def getCircuits(self, default = []):
+    return max(0, math.ceil(self._last_newnym + 10 - time.time()))
+
+  def get_circuits(self, default = []):
     """
     This provides a list with tuples of the form:
-    (circuitID, status, purpose, (fingerprint1, fingerprint2...))
+    (circuit_id, status, purpose, (fingerprint1, fingerprint2...))
 
     Arguments:
       default - value provided back if unable to query the circuit-status
@@ -262,10 +277,10 @@ class Controller:
 
       for fp, nickname in entry.path:
         if not fp:
-          consensusEntry = self.controller.get_network_status(nickname, None)
+          consensus_entry = self.controller.get_network_status(nickname, None)
 
-          if consensusEntry:
-            fp = consensusEntry.fingerprint
+          if consensus_entry:
+            fp = consensus_entry.fingerprint
 
           # It shouldn't be possible for this lookup to fail, but we
           # need to fill something (callers won't expect our own client
@@ -285,7 +300,7 @@ class Controller:
     else:
       return default
 
-  def getHiddenServicePorts(self, default = []):
+  def get_hidden_service_ports(self, default = []):
     """
     Provides the target ports hidden services are configured to use.
 
@@ -326,7 +341,7 @@ class Controller:
     else:
       return default
 
-  def getMyBandwidthRate(self, default = None):
+  def get_my_bandwidth_rate(self, default = None):
     """
     Provides the effective relaying bandwidth rate of this relay. Currently
     this doesn't account for SETCONF events.
@@ -337,21 +352,25 @@ class Controller:
 
     # effective relayed bandwidth is the minimum of BandwidthRate,
     # MaxAdvertisedBandwidth, and RelayBandwidthRate (if set)
-    effectiveRate = int(self.getOption("BandwidthRate", None))
 
-    relayRate = self.getOption("RelayBandwidthRate", None)
-    if relayRate and relayRate != "0":
-      effectiveRate = min(effectiveRate, int(relayRate))
+    effective_rate = int(self.get_option("BandwidthRate", None))
+
+    relay_rate = self.get_option("RelayBandwidthRate", None)
 
-    maxAdvertised = self.getOption("MaxAdvertisedBandwidth", None)
-    if maxAdvertised: effectiveRate = min(effectiveRate, int(maxAdvertised))
+    if relay_rate and relay_rate != "0":
+      effective_rate = min(effective_rate, int(relay_rate))
 
-    if effectiveRate is not None:
-      return effectiveRate
+    max_advertised = self.get_option("MaxAdvertisedBandwidth", None)
+
+    if max_advertised:
+      effective_rate = min(effective_rate, int(max_advertised))
+
+    if effective_rate is not None:
+      return effective_rate
     else:
       return default
 
-  def getMyBandwidthBurst(self, default = None):
+  def get_my_bandwidth_burst(self, default = None):
     """
     Provides the effective bandwidth burst rate of this relay. Currently this
     doesn't account for SETCONF events.
@@ -361,19 +380,19 @@ class Controller:
     """
 
     # effective burst (same for BandwidthBurst and RelayBandwidthBurst)
-    effectiveBurst = int(self.getOption("BandwidthBurst", None))
+    effective_burst = int(self.get_option("BandwidthBurst", None))
 
-    relayBurst = self.getOption("RelayBandwidthBurst", None)
+    relay_burst = self.get_option("RelayBandwidthBurst", None)
 
-    if relayBurst and relayBurst != "0":
-      effectiveBurst = min(effectiveBurst, int(relayBurst))
+    if relay_burst and relay_burst != "0":
+      effective_burst = min(effective_burst, int(relay_burst))
 
-    if effectiveBurst is not None:
-      return effectiveBurst
+    if effective_burst is not None:
+      return effective_burst
     else:
       return default
 
-  def getMyBandwidthObserved(self, default = None):
+  def get_my_bandwidth_observed(self, default = None):
     """
     Provides the relay's current observed bandwidth (the throughput determined
     from historical measurements on the client side). This is used in the
@@ -385,17 +404,17 @@ class Controller:
       default - result if the query fails
     """
 
-    myFingerprint = self.getInfo("fingerprint", None)
+    my_fingerprint = self.get_info("fingerprint", None)
 
-    if myFingerprint:
-      myDescriptor = self.controller.get_server_descriptor(myFingerprint)
+    if my_fingerprint:
+      my_descriptor = self.controller.get_server_descriptor(my_fingerprint)
 
-      if myDescriptor:
-        return myDescriptor.observed_bandwidth
+      if my_descriptor:
+        return my_descriptor.observed_bandwidth
 
     return default
 
-  def getMyBandwidthMeasured(self, default = None):
+  def get_my_bandwidth_measured(self, default = None):
     """
     Provides the relay's current measured bandwidth (the throughput as noted by
     the directory authorities and used by clients for relay selection). This is
@@ -412,17 +431,17 @@ class Controller:
     # actually looks to be v3. This needs to be sorted out between stem
     # and tor.
 
-    myFingerprint = self.getInfo("fingerprint", None)
+    my_fingerprint = self.get_info("fingerprint", None)
 
-    if myFingerprint:
-      myStatusEntry = self.controller.get_network_status(myFingerprint)
+    if my_fingerprint:
+      my_status_entry = self.controller.get_network_status(my_fingerprint)
 
-      if myStatusEntry and hasattr(myStatusEntry, 'bandwidth'):
-        return myStatusEntry.bandwidth
+      if my_status_entry and hasattr(my_status_entry, 'bandwidth'):
+        return my_status_entry.bandwidth
 
     return default
 
-  def getMyFlags(self, default = None):
+  def get_my_flags(self, default = None):
     """
     Provides the flags held by this relay.
 
@@ -430,23 +449,23 @@ class Controller:
       default - result if the query fails or this relay isn't a part of the consensus yet
     """
 
-    myFingerprint = self.getInfo("fingerprint", None)
+    my_fingerprint = self.get_info("fingerprint", None)
 
-    if myFingerprint:
-      myStatusEntry = self.controller.get_network_status(myFingerprint)
+    if my_fingerprint:
+      my_status_entry = self.controller.get_network_status(my_fingerprint)
 
-      if myStatusEntry:
-        return myStatusEntry.flags
+      if my_status_entry:
+        return my_status_entry.flags
 
     return default
 
-  def getVersion(self):
+  def get_version(self):
     """
     Provides the version of our tor instance, this is None if we don't have a
     connection.
     """
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
     try:
       return self.controller.get_version()
@@ -456,20 +475,20 @@ class Controller:
     except:
       return None
     finally:
-      self.connLock.release()
+      self.conn_lock.release()
 
-  def isGeoipUnavailable(self):
+  def is_geoip_unavailable(self):
     """
     Provides true if we've concluded that our geoip database is unavailable,
     false otherwise.
     """
 
-    if self.isAlive():
+    if self.is_alive():
       return self.controller.is_geoip_unavailable()
     else:
       return False
 
-  def getMyUser(self):
+  def get_my_user(self):
     """
     Provides the user this process is running under. If unavailable this
     provides None.
@@ -477,7 +496,7 @@ class Controller:
 
     return self.controller.get_user(None)
 
-  def getMyFileDescriptorUsage(self):
+  def get_my_file_descriptor_usage(self):
     """
     Provides the number of file descriptors currently being used by this
     process. This returns None if this can't be determined.
@@ -487,21 +506,24 @@ class Controller:
     # http://linuxshellaccount.blogspot.com/2008/06/finding-number-of-open-file-descriptors.html
     # I'm not sure about other platforms (like BSD) so erroring out there.
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
     result = None
-    if self.isAlive() and proc.is_available():
-      myPid = self.controller.get_pid(None)
 
-      if myPid:
-        try: result = len(os.listdir("/proc/%s/fd" % myPid))
-        except: pass
+    if self.is_alive() and proc.is_available():
+      my_pid = self.controller.get_pid(None)
+
+      if my_pid:
+        try:
+          result = len(os.listdir("/proc/%s/fd" % my_pid))
+        except:
+          pass
 
-    self.connLock.release()
+    self.conn_lock.release()
 
     return result
 
-  def getMyFileDescriptorLimit(self):
+  def get_my_file_descriptor_limit(self):
     """
     Provides the maximum number of file descriptors this process can have.
     Only the Tor process itself reliably knows this value, and the option for
@@ -514,33 +536,33 @@ class Controller:
     """
 
     # provides -1 if the query fails
-    queriedLimit = self.getInfo("process/descriptor-limit", None)
+    queried_limit = self.get_info("process/descriptor-limit", None)
 
-    if queriedLimit != None and queriedLimit != "-1":
-      return (int(queriedLimit), False)
+    if queried_limit is not None and queried_limit != "-1":
+      return (int(queried_limit), False)
 
-    torUser = self.getMyUser()
+    tor_user = self.get_my_user()
 
     # This is guessing the open file limit. Unfortunately there's no way
     # (other than "/usr/proc/bin/pfiles pid | grep rlimit" under Solaris)
     # to get the file descriptor limit for an arbitrary process.
 
-    if torUser == "debian-tor":
+    if tor_user == "debian-tor":
       # probably loaded via /etc/init.d/tor which changes descriptor limit
       return (8192, True)
     else:
       # uses ulimit to estimate (-H is for hard limit, which is what tor uses)
-      ulimitResults = system.call("ulimit -Hn")
+      ulimit_results = system.call("ulimit -Hn")
 
-      if ulimitResults:
-        ulimit = ulimitResults[0].strip()
+      if ulimit_results:
+        ulimit = ulimit_results[0].strip()
 
         if ulimit.isdigit():
           return (int(ulimit), True)
 
     return (None, None)
 
-  def getStartTime(self):
+  def get_start_time(self):
     """
     Provides the unix time for when the tor process first started. If this
     can't be determined then this provides None.
@@ -551,98 +573,104 @@ class Controller:
     except:
       return None
 
-  def isExitingAllowed(self, ipAddress, port):
+  def is_exiting_allowed(self, ip_address, port):
     """
     Checks if the given destination can be exited to by this relay, returning
     True if so and False otherwise.
     """
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
     result = False
-    if self.isAlive():
+
+    if self.is_alive():
       # If we allow any exiting then this could be relayed DNS queries,
       # otherwise the policy is checked. Tor still makes DNS connections to
       # test when exiting isn't allowed, but nothing is relayed over them.
       # I'm registering these as non-exiting to avoid likely user confusion:
       # https://trac.torproject.org/projects/tor/ticket/965
 
-      our_policy = self.getExitPolicy()
+      our_policy = self.get_exit_policy()
 
-      if our_policy and our_policy.is_exiting_allowed() and port == "53": result = True
-      else: result = our_policy and our_policy.can_exit_to(ipAddress, port)
+      if our_policy and our_policy.is_exiting_allowed() and port == "53":
+        result = True
+      else:
+        result = our_policy and our_policy.can_exit_to(ip_address, port)
 
-    self.connLock.release()
+    self.conn_lock.release()
 
     return result
 
-  def getExitPolicy(self):
+  def get_exit_policy(self):
     """
     Provides an ExitPolicy instance for the head of this relay's exit policy
     chain. If there's no active connection then this provides None.
     """
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
     result = None
-    if self.isAlive():
+
+    if self.is_alive():
       try:
         result = self.controller.get_exit_policy(None)
       except:
         pass
 
-    self.connLock.release()
+    self.conn_lock.release()
 
     return result
 
-  def getConsensusEntry(self, relayFingerprint):
+  def get_consensus_entry(self, relay_fingerprint):
     """
     Provides the most recently available consensus information for the given
     relay. This is none if no such information exists.
 
     Arguments:
-      relayFingerprint - fingerprint of the relay
+      relay_fingerprint - fingerprint of the relay
     """
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
     result = None
-    if self.isAlive():
-      if not relayFingerprint in self._consensusLookupCache:
-        nsEntry = self.getInfo("ns/id/%s" % relayFingerprint, None)
-        self._consensusLookupCache[relayFingerprint] = nsEntry
 
-      result = self._consensusLookupCache[relayFingerprint]
+    if self.is_alive():
+      if not relay_fingerprint in self._consensus_lookup_cache:
+        ns_entry = self.get_info("ns/id/%s" % relay_fingerprint, None)
+        self._consensus_lookup_cache[relay_fingerprint] = ns_entry
 
-    self.connLock.release()
+      result = self._consensus_lookup_cache[relay_fingerprint]
+
+    self.conn_lock.release()
 
     return result
 
-  def getDescriptorEntry(self, relayFingerprint):
+  def get_descriptor_entry(self, relay_fingerprint):
     """
     Provides the most recently available descriptor information for the given
     relay. Unless FetchUselessDescriptors is set this may frequently be
     unavailable. If no such descriptor is available then this returns None.
 
     Arguments:
-      relayFingerprint - fingerprint of the relay
+      relay_fingerprint - fingerprint of the relay
     """
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
     result = None
-    if self.isAlive():
-      if not relayFingerprint in self._descriptorLookupCache:
-        descEntry = self.getInfo("desc/id/%s" % relayFingerprint, None)
-        self._descriptorLookupCache[relayFingerprint] = descEntry
 
-      result = self._descriptorLookupCache[relayFingerprint]
+    if self.is_alive():
+      if not relay_fingerprint in self._descriptor_lookup_cache:
+        desc_entry = self.get_info("desc/id/%s" % relay_fingerprint, None)
+        self._descriptor_lookup_cache[relay_fingerprint] = desc_entry
+
+      result = self._descriptor_lookup_cache[relay_fingerprint]
 
-    self.connLock.release()
+    self.conn_lock.release()
 
     return result
 
-  def getRelayFingerprint(self, relayAddress, relayPort = None, getAllMatches = False):
+  def get_relay_fingerprint(self, relay_address, relay_port = None, get_all_matches = False):
     """
     Provides the fingerprint associated with the given address. If there's
     multiple potential matches or the mapping is unknown then this returns
@@ -651,69 +679,72 @@ class Controller:
     we have a connection with.
 
     Arguments:
-      relayAddress  - address of relay to be returned
-      relayPort     - orport of relay (to further narrow the results)
-      getAllMatches - ignores the relayPort and provides all of the
+      relay_address  - address of relay to be returned
+      relay_port     - orport of relay (to further narrow the results)
+      get_all_matches - ignores the relay_port and provides all of the
                       (port, fingerprint) tuples matching the given
                       address
     """
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
     result = None
-    if self.isAlive():
-      if getAllMatches:
+
+    if self.is_alive():
+      if get_all_matches:
         # populates the ip -> fingerprint mappings if not yet available
-        if self._fingerprintMappings == None:
-          self._fingerprintMappings = self._getFingerprintMappings()
+        if self._fingerprint_mappings is None:
+          self._fingerprint_mappings = self._get_fingerprint_mappings()
 
-        if relayAddress in self._fingerprintMappings:
-          result = self._fingerprintMappings[relayAddress]
-        else: result = []
+        if relay_address in self._fingerprint_mappings:
+          result = self._fingerprint_mappings[relay_address]
+        else:
+          result = []
       else:
         # query the fingerprint if it isn't yet cached
-        if not (relayAddress, relayPort) in self._fingerprintLookupCache:
-          relayFingerprint = self._getRelayFingerprint(relayAddress, relayPort)
-          self._fingerprintLookupCache[(relayAddress, relayPort)] = relayFingerprint
+        if not (relay_address, relay_port) in self._fingerprint_lookup_cache:
+          relay_fingerprint = self._get_relay_fingerprint(relay_address, relay_port)
+          self._fingerprint_lookup_cache[(relay_address, relay_port)] = relay_fingerprint
 
-        result = self._fingerprintLookupCache[(relayAddress, relayPort)]
+        result = self._fingerprint_lookup_cache[(relay_address, relay_port)]
 
-    self.connLock.release()
+    self.conn_lock.release()
 
     return result
 
-  def getRelayNickname(self, relayFingerprint):
+  def get_relay_nickname(self, relay_fingerprint):
     """
     Provides the nickname associated with the given relay. This provides None
     if no such relay exists, and "Unnamed" if the name hasn't been set.
 
     Arguments:
-      relayFingerprint - fingerprint of the relay
+      relay_fingerprint - fingerprint of the relay
     """
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
     result = None
-    if self.isAlive():
+
+    if self.is_alive():
       # query the nickname if it isn't yet cached
-      if not relayFingerprint in self._nicknameLookupCache:
-        if relayFingerprint == self.getInfo("fingerprint", None):
+      if not relay_fingerprint in self._nickname_lookup_cache:
+        if relay_fingerprint == self.get_info("fingerprint", None):
           # this is us, simply check the config
-          myNickname = self.getOption("Nickname", "Unnamed")
-          self._nicknameLookupCache[relayFingerprint] = myNickname
+          my_nickname = self.get_option("Nickname", "Unnamed")
+          self._nickname_lookup_cache[relay_fingerprint] = my_nickname
         else:
-          nsEntry = self.controller.get_network_status(relayFingerprint, None)
+          ns_entry = self.controller.get_network_status(relay_fingerprint, None)
 
-          if nsEntry:
-            self._nicknameLookupCache[relayFingerprint] = nsEntry.nickname
+          if ns_entry:
+            self._nickname_lookup_cache[relay_fingerprint] = ns_entry.nickname
 
-      result = self._nicknameLookupCache[relayFingerprint]
+      result = self._nickname_lookup_cache[relay_fingerprint]
 
-    self.connLock.release()
+    self.conn_lock.release()
 
     return result
 
-  def getRelayExitPolicy(self, relayFingerprint):
+  def get_relay_exit_policy(self, relay_fingerprint):
     """
     Provides the ExitPolicy instance associated with the given relay. The tor
     consensus entries don't indicate if private addresses are rejected or
@@ -722,89 +753,97 @@ class Controller:
     policy.
 
     Arguments:
-      relayFingerprint - fingerprint of the relay
+      relay_fingerprint - fingerprint of the relay
     """
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
     result = None
-    if self.isAlive():
+
+    if self.is_alive():
       # attempts to fetch the policy via the descriptor
-      descriptor = self.controller.get_server_descriptor(relayFingerprint, None)
+      descriptor = self.controller.get_server_descriptor(relay_fingerprint, None)
 
       if descriptor:
         result = descriptor.exit_policy
 
-    self.connLock.release()
+    self.conn_lock.release()
 
     return result
 
-  def getRelayAddress(self, relayFingerprint, default = None):
+  def get_relay_address(self, relay_fingerprint, default = None):
     """
     Provides the (IP Address, ORPort) tuple for a given relay. If the lookup
     fails then this returns the default.
 
     Arguments:
-      relayFingerprint - fingerprint of the relay
+      relay_fingerprint - fingerprint of the relay
     """
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
     result = default
-    if self.isAlive():
+
+    if self.is_alive():
       # query the address if it isn't yet cached
-      if not relayFingerprint in self._addressLookupCache:
-        if relayFingerprint == self.getInfo("fingerprint", None):
+      if not relay_fingerprint in self._address_lookup_cache:
+        if relay_fingerprint == self.get_info("fingerprint", None):
           # this is us, simply check the config
-          myAddress = self.getInfo("address", None)
-          myOrPort = self.getOption("ORPort", None)
+          my_address = self.get_info("address", None)
+          my_or_port = self.get_option("ORPort", None)
 
-          if myAddress and myOrPort:
-            self._addressLookupCache[relayFingerprint] = (myAddress, myOrPort)
+          if my_address and my_or_port:
+            self._address_lookup_cache[relay_fingerprint] = (my_address, my_or_port)
         else:
           # check the consensus for the relay
-          nsEntry = self.getConsensusEntry(relayFingerprint)
+          ns_entry = self.get_consensus_entry(relay_fingerprint)
 
-          if nsEntry:
-            nsLineComp = nsEntry.split("\n")[0].split(" ")
+          if ns_entry:
+            ns_line_comp = ns_entry.split("\n")[0].split(" ")
 
-            if len(nsLineComp) >= 8:
-              self._addressLookupCache[relayFingerprint] = (nsLineComp[6], nsLineComp[7])
+            if len(ns_line_comp) >= 8:
+              self._address_lookup_cache[relay_fingerprint] = (ns_line_comp[6], ns_line_comp[7])
 
-      result = self._addressLookupCache.get(relayFingerprint, default)
+      result = self._address_lookup_cache.get(relay_fingerprint, default)
 
-    self.connLock.release()
+    self.conn_lock.release()
 
     return result
 
-  def addEventListener(self, listener, *eventTypes):
+  def add_event_listener(self, listener, *event_types):
     """
     Directs further tor controller events to callback functions of the
     listener. If a new control connection is initialized then this listener is
     reattached.
     """
 
-    self.connLock.acquire()
-    if self.isAlive(): self.controller.add_event_listener(listener, *eventTypes)
-    self.connLock.release()
+    self.conn_lock.acquire()
+
+    if self.is_alive():
+      self.controller.add_event_listener(listener, *event_types)
 
-  def removeEventListener(self, listener):
+    self.conn_lock.release()
+
+  def remove_event_listener(self, listener):
     """
     Stops the given event listener from being notified of further events.
     """
 
-    self.connLock.acquire()
-    if self.isAlive(): self.controller.remove_event_listener(listener)
-    self.connLock.release()
+    self.conn_lock.acquire()
+
+    if self.is_alive():
+      self.controller.remove_event_listener(listener)
 
-  def addStatusListener(self, callback):
+    self.conn_lock.release()
+
+  def add_status_listener(self, callback):
     """
     Directs further events related to tor's controller status to the callback
     function.
 
     Arguments:
       callback - functor that'll accept the events, expected to be of the form:
-                 myFunction(controller, eventType)
+                 myFunction(controller, event_type)
     """
 
     self.controller.add_status_listener(callback)
@@ -815,17 +854,17 @@ class Controller:
     internal state to be reset and the torrc reloaded.
     """
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
     try:
-      if self.isAlive():
+      if self.is_alive():
         try:
           self.controller.signal(stem.Signal.RELOAD)
-        except Exception, exc:
+        except Exception as exc:
           # new torrc parameters caused an error (tor's likely shut down)
           raise IOError(str(exc))
     finally:
-      self.connLock.release()
+      self.conn_lock.release()
 
   def shutdown(self, force = False):
     """
@@ -837,12 +876,13 @@ class Controller:
       force - triggers an immediate shutdown for relays if True
     """
 
-    self.connLock.acquire()
+    self.conn_lock.acquire()
+
+    raised_exception = None
 
-    raisedException = None
-    if self.isAlive():
+    if self.is_alive():
       try:
-        isRelay = self.getOption("ORPort", None) != None
+        is_relay = self.get_option("ORPort", None) is not None
 
         if force:
           self.controller.signal(stem.Signal.HALT)
@@ -850,66 +890,79 @@ class Controller:
           self.controller.signal(stem.Signal.SHUTDOWN)
 
         # shuts down control connection if we aren't making a delayed shutdown
-        if force or not isRelay: self.close()
-      except Exception, exc:
-        raisedException = IOError(str(exc))
 
-    self.connLock.release()
+        if force or not is_relay:
+          self.close()
+      except Exception as exc:
+        raised_exception = IOError(str(exc))
+
+    self.conn_lock.release()
 
-    if raisedException: raise raisedException
+    if raised_exception:
+      raise raised_exception
 
   def ns_event(self, event):
-    self._consensusLookupCache = {}
+    self._consensus_lookup_cache = {}
 
   def new_consensus_event(self, event):
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
     # reconstructs consensus based mappings
-    self._fingerprintLookupCache = {}
-    self._nicknameLookupCache = {}
-    self._addressLookupCache = {}
-    self._consensusLookupCache = {}
 
-    if self._fingerprintMappings != None:
-      self._fingerprintMappings = self._getFingerprintMappings(event.desc)
+    self._fingerprint_lookup_cache = {}
+    self._nickname_lookup_cache = {}
+    self._address_lookup_cache = {}
+    self._consensus_lookup_cache = {}
 
-    self.connLock.release()
+    if self._fingerprint_mappings is not None:
+      self._fingerprint_mappings = self._get_fingerprint_mappings(event.desc)
+
+    self.conn_lock.release()
 
   def new_desc_event(self, event):
-    self.connLock.acquire()
+    self.conn_lock.acquire()
 
     desc_fingerprints = [fingerprint for (fingerprint, nickname) in event.relays]
 
     # If we're tracking ip address -> fingerprint mappings then update with
     # the new relays.
-    self._fingerprintLookupCache = {}
-    self._descriptorLookupCache = {}
 
-    if self._fingerprintMappings != None:
+    self._fingerprint_lookup_cache = {}
+    self._descriptor_lookup_cache = {}
+
+    if self._fingerprint_mappings is not None:
       for fingerprint in desc_fingerprints:
         # gets consensus data for the new descriptor
-        try: desc = self.controller.get_network_status(fingerprint)
-        except stem.ControllerError: continue
+
+        try:
+          desc = self.controller.get_network_status(fingerprint)
+        except stem.ControllerError:
+          continue
 
         # updates fingerprintMappings with new data
-        if desc.address in self._fingerprintMappings:
+
+        if desc.address in self._fingerprint_mappings:
           # if entry already exists with the same orport, remove it
-          orportMatch = None
-          for entryPort, entryFingerprint in self._fingerprintMappings[desc.address]:
-            if entryPort == desc.or_port:
-              orportMatch = (entryPort, entryFingerprint)
+
+          orport_match = None
+
+          for entry_port, entry_fingerprint in self._fingerprint_mappings[desc.address]:
+            if entry_port == desc.or_port:
+              orport_match = (entry_port, entry_fingerprint)
               break
 
-          if orportMatch: self._fingerprintMappings[desc.address].remove(orportMatch)
+          if orport_match:
+            self._fingerprint_mappings[desc.address].remove(orport_match)
 
           # add the new entry
-          self._fingerprintMappings[desc.address].append((desc.or_port, desc.fingerprint))
+
+          self._fingerprint_mappings[desc.address].append((desc.or_port, desc.fingerprint))
         else:
-          self._fingerprintMappings[desc.address] = [(desc.or_port, desc.fingerprint)]
+          self._fingerprint_mappings[desc.address] = [(desc.or_port, desc.fingerprint)]
 
-    self.connLock.release()
+    self.conn_lock.release()
 
-  def _getFingerprintMappings(self, descriptors = None):
+  def _get_fingerprint_mappings(self, descriptors = None):
     """
     Provides IP address to (port, fingerprint) tuple mappings for all of the
     currently cached relays.
@@ -919,55 +972,68 @@ class Controller:
     """
 
     results = {}
-    if self.isAlive():
+
+    if self.is_alive():
       # fetch the current network status if not provided
+
       if not descriptors:
-        try: descriptors = self.controller.get_network_statuses()
-        except stem.ControllerError: descriptors = []
+        try:
+          descriptors = self.controller.get_network_statuses()
+        except stem.ControllerError:
+          descriptors = []
 
       # construct mappings of ips to relay data
+
       for desc in descriptors:
         results.setdefault(desc.address, []).append((desc.or_port, desc.fingerprint))
 
     return results
 
-  def _getRelayFingerprint(self, relayAddress, relayPort):
+  def _get_relay_fingerprint(self, relay_address, relay_port):
     """
     Provides the fingerprint associated with the address/port combination.
 
     Arguments:
-      relayAddress - address of relay to be returned
-      relayPort    - orport of relay (to further narrow the results)
+      relay_address - address of relay to be returned
+      relay_port    - orport of relay (to further narrow the results)
     """
 
     # If we were provided with a string port then convert to an int (so
     # lookups won't mismatch based on type).
-    if isinstance(relayPort, str): relayPort = int(relayPort)
+
+    if isinstance(relay_port, str):
+      relay_port = int(relay_port)
 
     # checks if this matches us
-    if relayAddress == self.getInfo("address", None):
-      if not relayPort or relayPort == self.getOption("ORPort", None):
-        return self.getInfo("fingerprint", None)
+
+    if relay_address == self.get_info("address", None):
+      if not relay_port or relay_port == self.get_option("ORPort", None):
+        return self.get_info("fingerprint", None)
 
     # if we haven't yet populated the ip -> fingerprint mappings then do so
-    if self._fingerprintMappings == None:
-      self._fingerprintMappings = self._getFingerprintMappings()
 
-    potentialMatches = self._fingerprintMappings.get(relayAddress)
-    if not potentialMatches: return None # no relay matches this ip address
+    if self._fingerprint_mappings is None:
+      self._fingerprint_mappings = self._get_fingerprint_mappings()
+
+    potential_matches = self._fingerprint_mappings.get(relay_address)
+
+    if not potential_matches:
+      return None  # no relay matches this ip address
 
-    if len(potentialMatches) == 1:
+    if len(potential_matches) == 1:
       # There's only one relay belonging to this ip address. If the port
       # matches then we're done.
-      match = potentialMatches[0]
 
-      if relayPort and match[0] != relayPort: return None
-      else: return match[1]
-    elif relayPort:
+      match = potential_matches[0]
+
+      if relay_port and match[0] != relay_port:
+        return None
+      else:
+        return match[1]
+    elif relay_port:
       # Multiple potential matches, so trying to match based on the port.
-      for entryPort, entryFingerprint in potentialMatches:
-        if entryPort == relayPort:
-          return entryFingerprint
+      for entry_port, entry_fingerprint in potential_matches:
+        if entry_port == relay_port:
+          return entry_fingerprint
 
     return None
-
diff --git a/arm/util/uiTools.py b/arm/util/uiTools.py
index 1eb413a..7a1a601 100644
--- a/arm/util/uiTools.py
+++ b/arm/util/uiTools.py
@@ -13,15 +13,21 @@ from curses.ascii import isprint
 from stem.util import conf, enum, log, system
 
 # colors curses can handle
-COLOR_LIST = {"red": curses.COLOR_RED,        "green": curses.COLOR_GREEN,
-              "yellow": curses.COLOR_YELLOW,  "blue": curses.COLOR_BLUE,
-              "cyan": curses.COLOR_CYAN,      "magenta": curses.COLOR_MAGENTA,
-              "black": curses.COLOR_BLACK,    "white": curses.COLOR_WHITE}
+COLOR_LIST = {
+  "red": curses.COLOR_RED,
+  "green": curses.COLOR_GREEN,
+  "yellow": curses.COLOR_YELLOW,
+  "blue": curses.COLOR_BLUE,
+  "cyan": curses.COLOR_CYAN,
+  "magenta": curses.COLOR_MAGENTA,
+  "black": curses.COLOR_BLACK,
+  "white": curses.COLOR_WHITE,
+}
 
 # boolean for if we have color support enabled, None not yet determined
 COLOR_IS_SUPPORTED = None
 
-# mappings for getColor() - this uses the default terminal color scheme if
+# mappings for get_color() - this uses the default terminal color scheme if
 # color support is unavailable
 COLOR_ATTR_INITIALIZED = False
 COLOR_ATTR = dict([(color, 0) for color in COLOR_LIST])
@@ -29,66 +35,89 @@ COLOR_ATTR = dict([(color, 0) for color in COLOR_LIST])
 Ending = enum.Enum("ELLIPSE", "HYPHEN")
 SCROLL_KEYS = (curses.KEY_UP, curses.KEY_DOWN, curses.KEY_PPAGE, curses.KEY_NPAGE, curses.KEY_HOME, curses.KEY_END)
 
+
 def conf_handler(key, value):
-  if key == "features.colorOverride" and value != "none":
-    try: setColorOverride(value)
-    except ValueError, exc:
+  if key == "features.color_override" and value != "none":
+    try:
+      set_color_override(value)
+    except ValueError as exc:
       log.notice(exc)
 
+
 CONFIG = conf.config_dict("arm", {
-  "features.colorOverride": "none",
+  "features.color_override": "none",
   "features.colorInterface": True,
   "features.acsSupport": True,
 }, conf_handler)
 
-def demoGlyphs():
+
+def demo_glyphs():
   """
   Displays all ACS options with their corresponding representation. These are
   undocumented in the pydocs. For more information see the following man page:
   http://www.mkssoftware.com/docs/man5/terminfo.5.asp
   """
 
-  try: curses.wrapper(_showGlyphs)
-  except KeyboardInterrupt: pass # quit
+  try:
+    curses.wrapper(_show_glyphs)
+  except KeyboardInterrupt:
+    pass  # quit
+
 
-def _showGlyphs(stdscr):
+def _show_glyphs(stdscr):
   """
   Renders a chart with the ACS glyphs.
   """
 
   # allows things like semi-transparent backgrounds
-  try: curses.use_default_colors()
-  except curses.error: pass
+
+  try:
+    curses.use_default_colors()
+  except curses.error:
+    pass
 
   # attempts to make the cursor invisible
-  try: curses.curs_set(0)
-  except curses.error: pass
 
-  acsOptions = [item for item in curses.__dict__.items() if item[0].startswith("ACS_")]
-  acsOptions.sort(key=lambda i: (i[1])) # order by character codes
+  try:
+    curses.curs_set(0)
+  except curses.error:
+    pass
+
+  acs_options = [item for item in curses.__dict__.items() if item[0].startswith("ACS_")]
+  acs_options.sort(key=lambda i: (i[1]))  # order by character codes
 
   # displays a chart with all the glyphs and their representations
+
   height, width = stdscr.getmaxyx()
-  if width < 30: return # not enough room to show a column
+
+  if width < 30:
+    return  # not enough room to show a column
+
   columns = width / 30
 
   # display title
+
   stdscr.addstr(0, 0, "Curses Glyphs:", curses.A_STANDOUT)
 
   x, y = 0, 1
-  while acsOptions:
-    name, keycode = acsOptions.pop(0)
+
+  while acs_options:
+    name, keycode = acs_options.pop(0)
     stdscr.addstr(y, x * 30, "%s (%i)" % (name, keycode))
     stdscr.addch(y, (x * 30) + 25, keycode)
 
     x += 1
+
     if x >= columns:
       x, y = 0, y + 1
-      if y >= height: break
 
-  stdscr.getch() # quit on keyboard input
+      if y >= height:
+        break
+
+  stdscr.getch()  # quit on keyboard input
 
-def getPrintable(line, keepNewlines = True):
+
+def get_printable(line, keep_newlines = True):
   """
   Provides the line back with non-printable characters stripped.
 
@@ -98,18 +127,23 @@ def getPrintable(line, keepNewlines = True):
   """
 
   line = line.replace('\xc2', "'")
-  line = "".join([char for char in line if (isprint(char) or (keepNewlines and char == "\n"))])
+  line = "".join([char for char in line if (isprint(char) or (keep_newlines and char == "\n"))])
+
   return line
 
-def isColorSupported():
+
+def is_color_supported():
   """
   True if the display supports showing color, false otherwise.
   """
 
-  if COLOR_IS_SUPPORTED == None: _initColors()
+  if COLOR_IS_SUPPORTED is None:
+    _init_colors()
+
   return COLOR_IS_SUPPORTED
 
-def getColor(color):
+
+def get_color(color):
   """
   Provides attribute corresponding to a given text color. Supported colors
   include:
@@ -123,12 +157,18 @@ def getColor(color):
     color - name of the foreground color to be returned
   """
 
-  colorOverride = getColorOverride()
-  if colorOverride: color = colorOverride
-  if not COLOR_ATTR_INITIALIZED: _initColors()
+  color_override = get_color_override()
+
+  if color_override:
+    color = color_override
+
+  if not COLOR_ATTR_INITIALIZED:
+    _init_colors()
+
   return COLOR_ATTR[color]
 
-def setColorOverride(color = None):
+
+def set_color_override(color = None):
   """
   Overwrites all requests for color with the given color instead. This raises
   a ValueError if the color is invalid.
@@ -138,22 +178,28 @@ def setColorOverride(color = None):
             coloring
   """
 
-  if color == None:
-    CONFIG["features.colorOverride"] = "none"
+  if color is None:
+    CONFIG["features.color_override"] = "none"
   elif color in COLOR_LIST.keys():
-    CONFIG["features.colorOverride"] = color
-  else: raise ValueError("\"%s\" isn't a valid color" % color)
+    CONFIG["features.color_override"] = color
+  else:
+    raise ValueError("\"%s\" isn't a valid color" % color)
+
 
-def getColorOverride():
+def get_color_override():
   """
   Provides the override color used by the interface, None if it isn't set.
   """
 
-  colorOverride = CONFIG.get("features.colorOverride", "none")
-  if colorOverride == "none": return None
-  else: return colorOverride
+  color_override = CONFIG.get("features.color_override", "none")
 
-def cropStr(msg, size, minWordLen = 4, minCrop = 0, endType = Ending.ELLIPSE, getRemainder = False):
+  if color_override == "none":
+    return None
+  else:
+    return color_override
+
+
+def crop_str(msg, size, min_word_length = 4, min_crop = 0, end_type = Ending.ELLIPSE, get_remainder = False):
   """
   Provides the msg constrained to the given length, truncating on word breaks.
   If the last words is long this truncates mid-word with an ellipse. If there
@@ -162,100 +208,132 @@ def cropStr(msg, size, minWordLen = 4, minCrop = 0, endType = Ending.ELLIPSE, ge
   with a comma or period then it's stripped (unless we're providing the
   remainder back). Examples:
 
-  cropStr("This is a looooong message", 17)
+  crop_str("This is a looooong message", 17)
   "This is a looo..."
 
-  cropStr("This is a looooong message", 12)
+  crop_str("This is a looooong message", 12)
   "This is a..."
 
-  cropStr("This is a looooong message", 3)
+  crop_str("This is a looooong message", 3)
   ""
 
   Arguments:
-    msg          - source text
-    size         - room available for text
-    minWordLen   - minimum characters before which a word is dropped, requires
-                   whole word if None
-    minCrop      - minimum characters that must be dropped if a word's cropped
-    endType      - type of ending used when truncating:
-                   None - blank ending
-                   Ending.ELLIPSE - includes an ellipse
-                   Ending.HYPHEN - adds hyphen when breaking words
-    getRemainder - returns a tuple instead, with the second part being the
-                   cropped portion of the message
+    msg             - source text
+    size            - room available for text
+    min_word_length - minimum characters before which a word is dropped, requires
+                      whole word if None
+    min_crop        - minimum characters that must be dropped if a word's cropped
+    end_type        - type of ending used when truncating:
+                      None - blank ending
+                      Ending.ELLIPSE - includes an ellipse
+                      Ending.HYPHEN - adds hyphen when breaking words
+    get_remainder   - returns a tuple instead, with the second part being the
+                      cropped portion of the message
   """
 
   # checks if there's room for the whole message
+
   if len(msg) <= size:
-    if getRemainder: return (msg, "")
-    else: return msg
+    if get_remainder:
+      return (msg, "")
+    else:
+      return msg
 
   # avoids negative input
+
   size = max(0, size)
-  if minWordLen != None: minWordLen = max(0, minWordLen)
-  minCrop = max(0, minCrop)
+
+  if min_word_length is not None:
+    min_word_length = max(0, min_word_length)
+
+  min_crop = max(0, min_crop)
 
   # since we're cropping, the effective space available is less with an
   # ellipse, and cropping words requires an extra space for hyphens
-  if endType == Ending.ELLIPSE: size -= 3
-  elif endType == Ending.HYPHEN and minWordLen != None: minWordLen += 1
+
+  if end_type == Ending.ELLIPSE:
+    size -= 3
+  elif end_type == Ending.HYPHEN and min_word_length is not None:
+    min_word_length += 1
 
   # checks if there isn't the minimum space needed to include anything
-  lastWordbreak = msg.rfind(" ", 0, size + 1)
 
-  if lastWordbreak == -1:
+  last_wordbreak = msg.rfind(" ", 0, size + 1)
+
+  if last_wordbreak == -1:
     # we're splitting the first word
-    if minWordLen == None or size < minWordLen:
-      if getRemainder: return ("", msg)
-      else: return ""
 
-    includeCrop = True
+    if min_word_length is None or size < min_word_length:
+      if get_remainder:
+        return ("", msg)
+      else:
+        return ""
+
+    include_crop = True
   else:
-    lastWordbreak = len(msg[:lastWordbreak].rstrip()) # drops extra ending whitespaces
-    if (minWordLen != None and size < minWordLen) or (minWordLen == None and lastWordbreak < 1):
-      if getRemainder: return ("", msg)
-      else: return ""
+    last_wordbreak = len(msg[:last_wordbreak].rstrip())  # drops extra ending whitespaces
+
+    if (min_word_length is not None and size < min_word_length) or (min_word_length is None and last_wordbreak < 1):
+      if get_remainder:
+        return ("", msg)
+      else:
+        return ""
 
-    if minWordLen == None: minWordLen = sys.maxint
-    includeCrop = size - lastWordbreak - 1 >= minWordLen
+    if min_word_length is None:
+      min_word_length = sys.maxint
+
+    include_crop = size - last_wordbreak - 1 >= min_word_length
 
   # if there's a max crop size then make sure we're cropping at least that many characters
-  if includeCrop and minCrop:
-    nextWordbreak = msg.find(" ", size)
-    if nextWordbreak == -1: nextWordbreak = len(msg)
-    includeCrop = nextWordbreak - size + 1 >= minCrop
-
-  if includeCrop:
-    returnMsg, remainder = msg[:size], msg[size:]
-    if endType == Ending.HYPHEN:
-      remainder = returnMsg[-1] + remainder
-      returnMsg = returnMsg[:-1].rstrip() + "-"
-  else: returnMsg, remainder = msg[:lastWordbreak], msg[lastWordbreak:]
+
+  if include_crop and min_crop:
+    next_wordbreak = msg.find(" ", size)
+
+    if next_wordbreak == -1:
+      next_wordbreak = len(msg)
+
+    include_crop = next_wordbreak - size + 1 >= min_crop
+
+  if include_crop:
+    return_msg, remainder = msg[:size], msg[size:]
+
+    if end_type == Ending.HYPHEN:
+      remainder = return_msg[-1] + remainder
+      return_msg = return_msg[:-1].rstrip() + "-"
+  else:
+    return_msg, remainder = msg[:last_wordbreak], msg[last_wordbreak:]
 
   # if this is ending with a comma or period then strip it off
-  if not getRemainder and returnMsg and returnMsg[-1] in (",", "."):
-    returnMsg = returnMsg[:-1]
 
-  if endType == Ending.ELLIPSE:
-    returnMsg = returnMsg.rstrip() + "..."
+  if not get_remainder and return_msg and return_msg[-1] in (",", "."):
+    return_msg = return_msg[:-1]
 
-  if getRemainder: return (returnMsg, remainder)
-  else: return returnMsg
+  if end_type == Ending.ELLIPSE:
+    return_msg = return_msg.rstrip() + "..."
 
-def padStr(msg, size, cropExtra = False):
+  if get_remainder:
+    return (return_msg, remainder)
+  else:
+    return return_msg
+
+
+def pad_str(msg, size, crop_extra = False):
   """
   Provides the string padded with whitespace to the given length.
 
   Arguments:
     msg       - string to be padded
     size      - length to be padded to
-    cropExtra - crops string if it's longer than the size if true
+    crop_extra - crops string if it's longer than the size if true
   """
 
-  if cropExtra: msg = msg[:size]
+  if crop_extra:
+    msg = msg[:size]
+
   return ("%%-%is" % size) % msg
 
-def drawBox(panel, top, left, width, height, attr=curses.A_NORMAL):
+
+def draw_box(panel, top, left, width, height, attr=curses.A_NORMAL):
   """
   Draws a box in the panel with the given bounds.
 
@@ -269,19 +347,23 @@ def drawBox(panel, top, left, width, height, attr=curses.A_NORMAL):
   """
 
   # draws the top and bottom
+
   panel.hline(top, left + 1, width - 2, attr)
   panel.hline(top + height - 1, left + 1, width - 2, attr)
 
   # draws the left and right sides
+
   panel.vline(top + 1, left, height - 2, attr)
   panel.vline(top + 1, left + width - 1, height - 2, attr)
 
   # draws the corners
+
   panel.addch(top, left, curses.ACS_ULCORNER, attr)
   panel.addch(top, left + width - 1, curses.ACS_URCORNER, attr)
   panel.addch(top + height - 1, left, curses.ACS_LLCORNER, attr)
 
-def isSelectionKey(key):
+
+def is_selection_key(key):
   """
   Returns true if the keycode matches the enter or space keys.
 
@@ -291,9 +373,10 @@ def isSelectionKey(key):
 
   return key in (curses.KEY_ENTER, 10, ord(' '))
 
-def isScrollKey(key):
+
+def is_scroll_key(key):
   """
-  Returns true if the keycode is recognized by the getScrollPosition function
+  Returns true if the keycode is recognized by the get_scroll_position function
   for scrolling.
 
   Argument:
@@ -302,13 +385,14 @@ def isScrollKey(key):
 
   return key in SCROLL_KEYS
 
-def getScrollPosition(key, position, pageHeight, contentHeight, isCursor = False):
+
+def get_scroll_position(key, position, page_height, content_height, is_cursor = False):
   """
   Parses navigation keys, providing the new scroll possition the panel should
-  use. Position is always between zero and (contentHeight - pageHeight). This
+  use. Position is always between zero and (content_height - page_height). This
   handles the following keys:
   Up / Down - scrolls a position up or down
-  Page Up / Page Down - scrolls by the pageHeight
+  Page Up / Page Down - scrolls by the page_height
   Home - top of the content
   End - bottom of the content
 
@@ -317,24 +401,34 @@ def getScrollPosition(key, position, pageHeight, contentHeight, isCursor = False
   Arguments:
     key           - keycode for the user's input
     position      - starting position
-    pageHeight    - size of a single screen's worth of content
-    contentHeight - total lines of content that can be scrolled
-    isCursor      - tracks a cursor position rather than scroll if true
+    page_height    - size of a single screen's worth of content
+    content_height - total lines of content that can be scrolled
+    is_cursor      - tracks a cursor position rather than scroll if true
   """
 
-  if isScrollKey(key):
+  if is_scroll_key(key):
     shift = 0
-    if key == curses.KEY_UP: shift = -1
-    elif key == curses.KEY_DOWN: shift = 1
-    elif key == curses.KEY_PPAGE: shift = -pageHeight + 1 if isCursor else -pageHeight
-    elif key == curses.KEY_NPAGE: shift = pageHeight - 1 if isCursor else pageHeight
-    elif key == curses.KEY_HOME: shift = -contentHeight
-    elif key == curses.KEY_END: shift = contentHeight
+
+    if key == curses.KEY_UP:
+      shift = -1
+    elif key == curses.KEY_DOWN:
+      shift = 1
+    elif key == curses.KEY_PPAGE:
+      shift = -page_height + 1 if is_cursor else -page_height
+    elif key == curses.KEY_NPAGE:
+      shift = page_height - 1 if is_cursor else page_height
+    elif key == curses.KEY_HOME:
+      shift = -content_height
+    elif key == curses.KEY_END:
+      shift = content_height
 
     # returns the shift, restricted to valid bounds
-    maxLoc = contentHeight - 1 if isCursor else contentHeight - pageHeight
-    return max(0, min(position + shift, maxLoc))
-  else: return position
+
+    max_location = content_height - 1 if is_cursor else content_height - page_height
+    return max(0, min(position + shift, max_location))
+  else:
+    return position
+
 
 class Scroller:
   """
@@ -342,41 +436,43 @@ class Scroller:
   expects that there is a single line displayed per an entry in the contents.
   """
 
-  def __init__(self, isCursorEnabled):
-    self.scrollLoc, self.cursorLoc = 0, 0
-    self.cursorSelection = None
-    self.isCursorEnabled = isCursorEnabled
+  def __init__(self, is_cursor_enabled):
+    self.scroll_location, self.cursor_location = 0, 0
+    self.cursor_selection = None
+    self.is_cursor_enabled = is_cursor_enabled
 
-  def getScrollLoc(self, content, pageHeight):
+  def get_scroll_location(self, content, page_height):
     """
     Provides the scrolling location, taking into account its cursor's location
     content size, and page height.
 
     Arguments:
       content    - displayed content
-      pageHeight - height of the display area for the content
+      page_height - height of the display area for the content
     """
 
-    if content and pageHeight:
-      self.scrollLoc = max(0, min(self.scrollLoc, len(content) - pageHeight + 1))
+    if content and page_height:
+      self.scroll_location = max(0, min(self.scroll_location, len(content) - page_height + 1))
 
-      if self.isCursorEnabled:
-        self.getCursorSelection(content) # resets the cursor location
+      if self.is_cursor_enabled:
+        self.get_cursor_selection(content)  # resets the cursor location
 
         # makes sure the cursor is visible
-        if self.cursorLoc < self.scrollLoc:
-          self.scrollLoc = self.cursorLoc
-        elif self.cursorLoc > self.scrollLoc + pageHeight - 1:
-          self.scrollLoc = self.cursorLoc - pageHeight + 1
+
+        if self.cursor_location < self.scroll_location:
+          self.scroll_location = self.cursor_location
+        elif self.cursor_location > self.scroll_location + page_height - 1:
+          self.scroll_location = self.cursor_location - page_height + 1
 
       # checks if the bottom would run off the content (this could be the
       # case when the content's size is dynamic and entries are removed)
-      if len(content) > pageHeight:
-        self.scrollLoc = min(self.scrollLoc, len(content) - pageHeight)
 
-    return self.scrollLoc
+      if len(content) > page_height:
+        self.scroll_location = min(self.scroll_location, len(content) - page_height)
+
+    return self.scroll_location
 
-  def getCursorSelection(self, content):
+  def get_cursor_selection(self, content):
     """
     Provides the selected item in the content. This is the same entry until
     the cursor moves or it's no longer available (in which case it moves on to
@@ -389,42 +485,51 @@ class Scroller:
     # TODO: needs to handle duplicate entries when using this for the
     # connection panel
 
-    if not self.isCursorEnabled: return None
+    if not self.is_cursor_enabled:
+      return None
     elif not content:
-      self.cursorLoc, self.cursorSelection = 0, None
+      self.cursor_location, self.cursor_selection = 0, None
       return None
 
-    self.cursorLoc = min(self.cursorLoc, len(content) - 1)
-    if self.cursorSelection != None and self.cursorSelection in content:
+    self.cursor_location = min(self.cursor_location, len(content) - 1)
+
+    if self.cursor_selection is not None and self.cursor_selection in content:
       # moves cursor location to track the selection
-      self.cursorLoc = content.index(self.cursorSelection)
+      self.cursor_location = content.index(self.cursor_selection)
     else:
       # select the next closest entry
-      self.cursorSelection = content[self.cursorLoc]
+      self.cursor_selection = content[self.cursor_location]
 
-    return self.cursorSelection
+    return self.cursor_selection
 
-  def handleKey(self, key, content, pageHeight):
+  def handle_key(self, key, content, page_height):
     """
     Moves either the scroll or cursor according to the given input.
 
     Arguments:
       key        - key code of user input
       content    - displayed content
-      pageHeight - height of the display area for the content
+      page_height - height of the display area for the content
     """
 
-    if self.isCursorEnabled:
-      self.getCursorSelection(content) # resets the cursor location
-      startLoc = self.cursorLoc
-    else: startLoc = self.scrollLoc
+    if self.is_cursor_enabled:
+      self.get_cursor_selection(content)  # resets the cursor location
+      start_location = self.cursor_location
+    else:
+      start_location = self.scroll_location
+
+    new_location = get_scroll_position(key, start_location, page_height, len(content), self.is_cursor_enabled)
+
+    if start_location != new_location:
+      if self.is_cursor_enabled:
+        self.cursor_selection = content[new_location]
+      else:
+        self.scroll_location = new_location
 
-    newLoc = getScrollPosition(key, startLoc, pageHeight, len(content), self.isCursorEnabled)
-    if startLoc != newLoc:
-      if self.isCursorEnabled: self.cursorSelection = content[newLoc]
-      else: self.scrollLoc = newLoc
       return True
-    else: return False
+    else:
+      return False
+
 
 def is_wide_characters_supported():
   """
@@ -471,16 +576,19 @@ def is_wide_characters_supported():
 
   return False
 
-def _initColors():
+
+def _init_colors():
   """
   Initializes color mappings usable by curses. This can only be done after
   calling curses.initscr().
   """
 
   global COLOR_ATTR_INITIALIZED, COLOR_IS_SUPPORTED
+
   if not COLOR_ATTR_INITIALIZED:
     # hack to replace all ACS characters with '+' if ACS support has been
     # manually disabled
+
     if not CONFIG["features.acsSupport"]:
       for item in curses.__dict__:
         if item.startswith("ACS_"):
@@ -496,22 +604,25 @@ def _initColors():
 
     COLOR_ATTR_INITIALIZED = True
     COLOR_IS_SUPPORTED = False
-    if not CONFIG["features.colorInterface"]: return
 
-    try: COLOR_IS_SUPPORTED = curses.has_colors()
-    except curses.error: return # initscr hasn't been called yet
+    if not CONFIG["features.colorInterface"]:
+      return
+
+    try:
+      COLOR_IS_SUPPORTED = curses.has_colors()
+    except curses.error:
+      return  # initscr hasn't been called yet
 
     # initializes color mappings if color support is available
     if COLOR_IS_SUPPORTED:
       colorpair = 0
       log.info("Terminal color support detected and enabled")
 
-      for colorName in COLOR_LIST:
-        fgColor = COLOR_LIST[colorName]
-        bgColor = -1 # allows for default (possibly transparent) background
+      for color_name in COLOR_LIST:
+        foreground_color = COLOR_LIST[color_name]
+        background_color = -1  # allows for default (possibly transparent) background
         colorpair += 1
-        curses.init_pair(colorpair, fgColor, bgColor)
-        COLOR_ATTR[colorName] = curses.color_pair(colorpair)
+        curses.init_pair(colorpair, foreground_color, background_color)
+        COLOR_ATTR[color_name] = curses.color_pair(colorpair)
     else:
       log.info("Terminal color support unavailable")
-
diff --git a/test/settings.cfg b/test/settings.cfg
index e3b3b75..f055974 100644
--- a/test/settings.cfg
+++ b/test/settings.cfg
@@ -6,45 +6,6 @@ pep8.ignore E501
 pep8.ignore E251
 pep8.ignore E127
 
-# Files we haven't gotten around to revisiing yet. This list will be going away
-# completely before our next release.
-
-pep8.blacklist ./arm/connections/__init__.py
-pep8.blacklist ./arm/connections/circEntry.py
-pep8.blacklist ./arm/connections/connEntry.py
-pep8.blacklist ./arm/connections/connPanel.py
-pep8.blacklist ./arm/connections/countPopup.py
-pep8.blacklist ./arm/connections/descriptorPopup.py
-pep8.blacklist ./arm/connections/entries.py
-
-pep8.blacklist ./arm/graphing/__init__.py
-pep8.blacklist ./arm/graphing/bandwidthStats.py
-pep8.blacklist ./arm/graphing/connStats.py
-pep8.blacklist ./arm/graphing/graphPanel.py
-pep8.blacklist ./arm/graphing/resourceStats.py
-
-pep8.blacklist ./arm/menu/__init__.py
-pep8.blacklist ./arm/menu/actions.py
-pep8.blacklist ./arm/menu/item.py
-pep8.blacklist ./arm/menu/menu.py
-
-pep8.blacklist ./arm/util/connections.py
-pep8.blacklist ./arm/util/panel.py
-pep8.blacklist ./arm/util/sysTools.py
-pep8.blacklist ./arm/util/textInput.py
-pep8.blacklist ./arm/util/torConfig.py
-pep8.blacklist ./arm/util/torTools.py
-pep8.blacklist ./arm/util/uiTools.py
-
-pep8.blacklist ./arm/__init__.py
-pep8.blacklist ./arm/configPanel.py
-pep8.blacklist ./arm/controller.py
-pep8.blacklist ./arm/headerPanel.py
-pep8.blacklist ./arm/logPanel.py
-pep8.blacklist ./arm/popups.py
-pep8.blacklist ./arm/prereq.py
-pep8.blacklist ./arm/torrcPanel.py
-
 # False positives from pyflakes. These are mappings between the path and the
 # issue.
 





More information about the tor-commits mailing list