install instructions for zbar. fixes #610
[electrum-nvc.git] / plugins / qrscanner.py
index d76742d..d0e5d14 100644 (file)
@@ -23,7 +23,7 @@ class Plugin(BasePlugin):
 
     def fullname(self): return 'QR scans'
 
-    def description(self): return "QR Scans.\nInstall the zbar package (http://zbar.sourceforge.net/download.html) to enable this plugin"
+    def description(self): return "QR Scans.\nInstall the zbar package to enable this plugin.\nOn linux, type: 'apt-get install python-zbar'"
 
     def __init__(self, gui, name):
         BasePlugin.__init__(self, gui, name)
@@ -76,7 +76,7 @@ class Plugin(BasePlugin):
         while True:
             try:
                 proc.process_one()
-            except:
+            except Exception:
                 # User closed the preview window
                 return {}
 
@@ -99,18 +99,18 @@ class Plugin(BasePlugin):
 
         try:
             amount = self.gui.main_window.read_amount(unicode( self.gui.main_window.amount_e.text()))
-        except:
+        except Exception:
             QMessageBox.warning(self.gui.main_window, _('Error'), _('Invalid Amount'), _('OK'))
             return
         try:
             fee = self.gui.main_window.read_amount(unicode( self.gui.main_window.fee_e.text()))
-        except:
+        except Exception:
             QMessageBox.warning(self.gui.main_window, _('Error'), _('Invalid Fee'), _('OK'))
             return
 
         try:
             tx = self.gui.main_window.wallet.mktx( [(to_address, amount)], None, fee)
-        except BaseException, e:
+        except Exception as e:
             self.gui.main_window.show_message(str(e))
             return
 
@@ -126,13 +126,13 @@ class Plugin(BasePlugin):
     
             input_info = []
 
-        except BaseException, e:
+        except Exception as e:
             self.gui.main_window.show_message(str(e))
 
         try:
             json_text = json.dumps(tx.as_dict()).replace(' ', '')
             self.show_tx_qrcode(json_text, 'Unsigned Transaction')
-        except BaseException, e:
+        except Exception as e:
             self.gui.main_window.show_message(str(e))
 
     def show_tx_qrcode(self, data, title):
@@ -235,7 +235,7 @@ class Plugin(BasePlugin):
             self.gui.main_window.wallet.signrawtransaction(tx, input_info, [], password)
             txtext = json.dumps(tx.as_dict()).replace(' ', '')
             self.show_tx_qrcode(txtext, 'Signed Transaction')
-        except BaseException, e:
+        except Exception as e:
             self.gui.main_window.show_message(str(e))
 
 
@@ -350,10 +350,10 @@ def parse_uri(uri):
     uri = urlparse(uri)
     result = {'address': uri.netloc} 
     
-    if uri.path.startswith('?'):
-        params = parse_qs(uri.path[1:])
+    if uri.query.startswith('?'):
+        params = parse_qs(uri.query[1:])
     else:
-        params = parse_qs(uri.path)    
+        params = parse_qs(uri.query)    
 
     for k,v in params.items():
         if k in ('amount', 'label', 'message'):