commit 52c64ce772833b46af4db51ec426a84a921ff226 Author: Damian Johnson atagar@torproject.org Date: Sat Jun 1 19:23:22 2013 -0700
Accounting for moved to_camel_case() util
Prior to stem's release I decided that the to_camel_case() function in the str_tools util wasn't something that I want to vend to stem users. This in turn broke our menu...
Traceback (most recent call last): File "./src/starter.py", line 478, in <module> cli.controller.startTorMonitor(time.time() - initTime) File "/home/atagar/Desktop/arm/src/cli/controller.py", line 564, in startTorMonitor curses.wrapper(drawTorMonitor, startTime) File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper return func(stdscr, *args, **kwds) File "/home/atagar/Desktop/arm/src/cli/controller.py", line 635, in drawTorMonitor cli.menu.menu.showMenu() File "/home/atagar/Desktop/arm/src/cli/menu/menu.py", line 80, in showMenu menu = cli.menu.actions.makeMenu() File "/home/atagar/Desktop/arm/src/cli/menu/actions.py", line 27, in makeMenu baseMenu.add(makeViewMenu()) File "/home/atagar/Desktop/arm/src/cli/menu/actions.py", line 93, in makeViewMenu label = " / ".join([str_tools.to_camel_case(panel.getName()) for panel in pagePanels]) AttributeError: 'module' object has no attribute 'to_camel_case'
Swapping arm to use stem's private method. This is, of course, bad since stem may change it in the future but this'll do the trick at least until we come up with a more permanent solution while rewriting arm. --- src/cli/menu/actions.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/cli/menu/actions.py b/src/cli/menu/actions.py index 77357c9..8cc265b 100644 --- a/src/cli/menu/actions.py +++ b/src/cli/menu/actions.py @@ -90,7 +90,7 @@ def makeViewMenu():
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]) + label = " / ".join([str_tools._to_camel_case(panel.getName()) for panel in pagePanels])
viewMenu.add(cli.menu.item.SelectionMenuItem(label, pageGroup, i))
@@ -101,7 +101,7 @@ def makeViewMenu(): colorMenu.add(cli.menu.item.SelectionMenuItem("All", colorGroup, None))
for color in uiTools.COLOR_LIST: - colorMenu.add(cli.menu.item.SelectionMenuItem(str_tools.to_camel_case(color), colorGroup, color)) + colorMenu.add(cli.menu.item.SelectionMenuItem(str_tools._to_camel_case(color), colorGroup, color))
viewMenu.add(colorMenu)
@@ -141,7 +141,7 @@ def makeGraphMenu(graphPanel): availableStats.sort()
for statKey in ["None"] + availableStats: - label = str_tools.to_camel_case(statKey, divider = " ") + label = str_tools._to_camel_case(statKey, divider = " ") statKey = None if statKey == "None" else statKey graphMenu.add(cli.menu.item.SelectionMenuItem(label, statGroup, statKey))
@@ -154,7 +154,7 @@ def makeGraphMenu(graphPanel):
for i in range(len(cli.graphing.graphPanel.UPDATE_INTERVALS)): label = cli.graphing.graphPanel.UPDATE_INTERVALS[i][0] - label = str_tools.to_camel_case(label, divider = " ") + label = str_tools._to_camel_case(label, divider = " ") intervalMenu.add(cli.menu.item.SelectionMenuItem(label, intervalGroup, i))
graphMenu.add(intervalMenu)
tor-commits@lists.torproject.org