Index: wicd2nm/wicd2nm.py
===================================================================
--- wicd2nm/wicd2nm.py	(revision 173)
+++ wicd2nm/wicd2nm.py	(revision 174)
@@ -38,7 +38,6 @@
 wicd_config='/etc/wicd/wireless-settings.conf'
 nm_config_dir='/etc/NetworkManager/system-connections'
 
-
 def parse_wicd():
     Connections=[]
     my_parser = ConfigParser.ConfigParser()
@@ -71,7 +70,6 @@
     for con in conexiones:
         my_parser=ConfigParser.RawConfigParser()
         my_parser.add_section('connection')       
-        my_parser.add_section('802-11-wireless-security')
         my_parser.add_section('ipv4')
         my_parser.add_section('ipv6')
         my_parser.add_section('802-11-wireless')
@@ -79,7 +77,7 @@
         my_parser.set('connection','timestamp','1305878385')        
         my_parser.set('connection','type','802-11-wireless')
         my_parser.set('802-11-wireless','mode','infrastructure')
-        my_parser.set('802-11-wireless','security','802-11-wireless-security')        
+                
         my_parser.set('ipv4','method','auto')
         my_parser.set('ipv6','method','ignore')
         
@@ -90,25 +88,33 @@
             my_parser.set('802-11-wireless','ssid',string2ascii(con['essid']))
             if 'passphrase' in con.keys():
                 contras=con['passphrase']
+            elif 'key' in con.keys():
+                contras=con['key']
             else:
-                contras=con['key']        
+                contras=None
             
-            if con['enctype'] == 'wep-passphrase' or con['enctype'] == 'wep-hex':
-                my_parser.set('802-11-wireless-security','key-mgmt','none')
-                my_parser.set('802-11-wireless-security','auth-alg','open')
-                my_parser.set('802-11-wireless-security','wep-key0',contras) 
-                if con['enctype'] == 'wep-passphrase':
-                    tipo=2
-                else:
-                    tipo=1
-                my_parser.set('802-11-wireless-security','wep-key-type',tipo)                
+            if 'enctype' in con.keys():
+                my_parser.set('802-11-wireless','security','802-11-wireless-security')
+                my_parser.add_section('802-11-wireless-security')
+                if con['enctype'] == 'wep-passphrase' or con['enctype'] == 'wep-hex':
+                    my_parser.set('802-11-wireless-security','key-mgmt','none')
+                    my_parser.set('802-11-wireless-security','auth-alg','open')
+                    my_parser.set('802-11-wireless-security','wep-key0',contras) 
+                    if con['enctype'] == 'wep-passphrase':
+                        tipo=2
+                    else:
+                        tipo=1
+                    my_parser.set('802-11-wireless-security','wep-key-type',tipo)                
 
-            elif con['enctype'] == 'wpa-psk' or con['enctype'] == 'wpa':
-                my_parser.set('802-11-wireless-security','key-mgmt','wpa-psk')
-                my_parser.set('802-11-wireless-security','psk',contras) 
+                elif con['enctype'] == 'wpa-psk' or con['enctype'] == 'wpa':
+                    my_parser.set('802-11-wireless-security','key-mgmt','wpa-psk')
+                    my_parser.set('802-11-wireless-security','psk',contras) 
 
-            else:
-                continue #caso no contemplado
+                else:
+                    continue #caso no contemplado
+            else: #autenticación sin contraseña
+                pass #no necesita '802-11-wireless-security'
+            
                 
             configfile=open(os.path.join(nm_config_dir,id), 'wb')
             my_parser.write(configfile)
@@ -117,8 +123,6 @@
                          
             
         except:
-            #import pdb
-            #pdb.set_trace()
             continue #hay algún dato mal en la configuración, así que tomamos la siguiente
 
 
@@ -127,4 +131,4 @@
     conn=parse_wicd()
     crea_nm_configs(conn)
     #creamos archivo vacío de testigo de haber ejecutado el script
-    if not os.path.exists('/var/wicd2nm'): open('/var/wicd2nm', 'w').close() 
+    if not os.path.exists('/var/wicd2nm2'): open('/var/wicd2nm2', 'w').close() 
