[tor-commits] [arm/master] Error due to moved popup import

atagar at torproject.org atagar at torproject.org
Mon Sep 23 22:02:56 UTC 2013


commit 780aa8a3ed64cd35c4480de0ded6f5638065a0fa
Author: Damian Johnson <atagar at torproject.org>
Date:   Mon Sep 23 12:34:08 2013 -0700

    Error due to moved popup import
    
    Oops, fixing an error from rearanging our imports. This came up when pressing
    'e' to get the logging popup...
    
    Traceback (most recent call last):
      File "runner.py", line 3, in <module>
        arm.starter.main()
      File "/home/atagar/Desktop/arm/arm/starter.py", line 398, in main
        arm.controller.start_arm(start_time)
      File "/home/atagar/Desktop/arm/arm/controller.py", line 549, in start_arm
        curses.wrapper(drawTorMonitor, start_time)
      File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
        return func(stdscr, *args, **kwds)
      File "/home/atagar/Desktop/arm/arm/controller.py", line 654, in drawTorMonitor
        isKeystrokeConsumed = panelImpl.handleKey(key)
      File "/home/atagar/Desktop/arm/arm/logPanel.py", line 879, in handleKey
        self.showEventSelectionPrompt()
      File "/home/atagar/Desktop/arm/arm/logPanel.py", line 756, in showEventSelectionPrompt
        popup, width, height = popups.init(11, 80)
    NameError: global name 'popups' is not defined
---
 arm/logPanel.py |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/arm/logPanel.py b/arm/logPanel.py
index b5ee962..f020c57 100644
--- a/arm/logPanel.py
+++ b/arm/logPanel.py
@@ -737,7 +737,7 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
     Prompts the user to add a new regex filter.
     """
 
-    regexInput = popups.inputPrompt("Regular expression: ")
+    regexInput = arm.popups.inputPrompt("Regular expression: ")
 
     if regexInput:
       try:
@@ -745,7 +745,7 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
         if regexInput in self.filterOptions: self.filterOptions.remove(regexInput)
         self.filterOptions.insert(0, regexInput)
       except re.error, exc:
-        popups.showMsg("Unable to compile expression: %s" % exc, 2)
+        arm.popups.showMsg("Unable to compile expression: %s" % exc, 2)
 
   def showEventSelectionPrompt(self):
     """
@@ -753,7 +753,7 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
     """
 
     # allow user to enter new types of events to log - unchanged if left blank
-    popup, width, height = popups.init(11, 80)
+    popup, width, height = arm.popups.init(11, 80)
 
     if popup:
       try:
@@ -767,27 +767,27 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
 
         popup.win.refresh()
 
-        userInput = popups.inputPrompt("Events to log: ")
+        userInput = arm.popups.inputPrompt("Events to log: ")
         if userInput:
           userInput = userInput.replace(' ', '') # strips spaces
           try: self.setLoggedEvents(expandEvents(userInput))
           except ValueError, exc:
-            popups.showMsg("Invalid flags: %s" % str(exc), 2)
-      finally: popups.finalize()
+            arm.popups.showMsg("Invalid flags: %s" % str(exc), 2)
+      finally: arm.popups.finalize()
 
   def showSnapshotPrompt(self):
     """
     Lets user enter a path to take a snapshot, canceling if left blank.
     """
 
-    pathInput = popups.inputPrompt("Path to save log snapshot: ")
+    pathInput = arm.popups.inputPrompt("Path to save log snapshot: ")
 
     if pathInput:
       try:
         self.saveSnapshot(pathInput)
-        popups.showMsg("Saved: %s" % pathInput, 2)
+        arm.popups.showMsg("Saved: %s" % pathInput, 2)
       except IOError, exc:
-        popups.showMsg("Unable to save snapshot: %s" % exc.strerror, 2)
+        arm.popups.showMsg("Unable to save snapshot: %s" % exc.strerror, 2)
 
   def clear(self):
     """
@@ -849,7 +849,7 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
       self.valsLock.release()
     elif key == ord('c') or key == ord('C'):
       msg = "This will clear the log. Are you sure (c again to confirm)?"
-      keyPress = popups.showMsg(msg, attr = curses.A_BOLD)
+      keyPress = arm.popups.showMsg(msg, attr = curses.A_BOLD)
       if keyPress 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:
@@ -861,7 +861,7 @@ class LogPanel(panel.Panel, threading.Thread, logging.Handler):
       # new filters
       panel.CURSES_LOCK.acquire()
       try:
-        selection = popups.showMenu("Log Filter:", options, oldSelection)
+        selection = arm.popups.showMenu("Log Filter:", options, oldSelection)
 
         # applies new setting
         if selection == 0:





More information about the tor-commits mailing list