def del_connection_info(user=True):
 (section, keypath) = reg_info(user)
 try:
  hive = _winreg.ConnectRegistry(None, section)
  key = _winreg.OpenKey(hive, keypath)
  _winreg.DeleteKey(key, 'api')
  _winreg.CloseKey(key)
 except WindowsError:
  if user:
   del_connection_info(user=False)
  pass
 finally:
  _winreg.CloseKey(hive)

def del_connection_info ( user = True ) : ( section , keypath ) = reg_info ( user ) try : hive = _winreg . ConnectRegistry ( None , section ) key = _winreg . OpenKey ( hive , keypath ) _winreg . DeleteKey ( key , 'api' ) _winreg . CloseKey ( key ) except WindowsError : if user : del_connection_info ( user = False ) pass finally : _winreg . CloseKey ( hive )
remove api info from register .