Browse Source

Convert WPS NFC python scripts from using wpactrl to wpaspy

Signed-hostap: Jouni Malinen <j@w1.fi>
Jouni Malinen 12 years ago
parent
commit
c3aa4da94d
2 changed files with 6 additions and 8 deletions
  1. 3 4
      hostapd/wps-ap-nfc.py
  2. 3 4
      wpa_supplicant/examples/wps-nfc.py

+ 3 - 4
hostapd/wps-ap-nfc.py

@@ -18,7 +18,7 @@ import nfc.handover
 import logging
 logging.basicConfig()
 
-import wpactrl
+import wpaspy
 
 wpas_ctrl = '/var/run/hostapd'
 
@@ -37,10 +37,9 @@ def wpas_connect():
 
     for ctrl in ifaces:
         try:
-            wpas = wpactrl.WPACtrl(ctrl)
+            wpas = wpaspy.Ctrl(ctrl)
             return wpas
-        except wpactrl.error, error:
-            print "Error: ", error
+        except Exception, e:
             pass
     return None
 

+ 3 - 4
wpa_supplicant/examples/wps-nfc.py

@@ -20,7 +20,7 @@ import nfc.handover
 import logging
 logging.basicConfig()
 
-import wpactrl
+import wpaspy
 
 wpas_ctrl = '/var/run/wpa_supplicant'
 
@@ -39,10 +39,9 @@ def wpas_connect():
 
     for ctrl in ifaces:
         try:
-            wpas = wpactrl.WPACtrl(ctrl)
+            wpas = wpaspy.Ctrl(ctrl)
             return wpas
-        except wpactrl.error, error:
-            print "Error: ", error
+        except Exception, e:
             pass
     return None