Initial novacoin support
[electrum-nvc.git] / gui / qt / console.py
index 9ff94d2..c0b08c5 100644 (file)
@@ -4,7 +4,7 @@ import sys, os, re
 import traceback, platform
 from PyQt4 import QtCore
 from PyQt4 import QtGui
-from electrum import util
+from electrum_nvc import util
 
 
 if platform.system() == 'Windows':
@@ -39,6 +39,8 @@ class Console(QtGui.QPlainTextEdit):
     def run_script(self, filename):
         with open(filename) as f:
             script = f.read()
+
+        # eval is generally considered bad practice. use it wisely!
         result = eval(script, self.namespace, self.namespace)
 
 
@@ -209,6 +211,7 @@ class Console(QtGui.QPlainTextEdit):
             sys.stdout = stdoutProxy(self.appendPlainText)
             try:
                 try:
+                    # eval is generally considered bad practice. use it wisely!
                     result = eval(command, self.namespace, self.namespace)
                     if result != None:
                         if self.is_json:
@@ -216,10 +219,11 @@ class Console(QtGui.QPlainTextEdit):
                         else:
                             self.appendPlainText(repr(result))
                 except SyntaxError:
+                    # exec is generally considered bad practice. use it wisely!
                     exec command in self.namespace
             except SystemExit:
                 self.close()
-            except:
+            except Exception:
                 traceback_lines = traceback.format_exc().split('\n')
                 # Remove traceback mentioning this file, and a linebreak
                 for i in (3,2,1,-1):