#NEWLINE# def _get_proxy_windows( types = None ) : #NEWLINE# #INDENT# ret = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( types is None ) : #NEWLINE# #INDENT# types = [ 'http' , 'https' , 'ftp' ] #NEWLINE# #UNINDENT# reg_val = __salt__ [ 'reg.read_value' ] ( 'HKEY_CURRENT_USER' , 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings' , 'ProxyServer' ) #NEWLINE# servers = reg_val [ 'vdata' ] #NEWLINE# if ( '=' in servers ) : #NEWLINE# #INDENT# split = servers . split ( ';' ) #NEWLINE# for s in split : #NEWLINE# #INDENT# if ( len ( s ) == 0 ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( ':' in s ) : #NEWLINE# #INDENT# ( server_type , port ) = s . split ( ':' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# server_type = s #NEWLINE# port = None #NEWLINE# #UNINDENT# ( proxy_type , server ) = server_type . split ( '=' ) #NEWLINE# ret [ proxy_type ] = { #NEWLINE# #INDENT# 'server' : server , #NEWLINE# 'port' : port , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# #UNINDENT# if ( len ( types ) == 1 ) : #NEWLINE# #INDENT# return ret [ enabled [ 0 ] ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for key in ret . keys ( ) : #NEWLINE# #INDENT# if ( key not in types ) : #NEWLINE# #INDENT# del ret [ key ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# reg_val = __salt__ [ 'reg.read_value' ] ( 'HKEY_CURRENT_USER' , 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings' , 'ProxyEnable' ) #NEWLINE# enabled = reg_val . get ( 'vdata' , 0 ) #NEWLINE# ret [ 'enabled' ] = ( True if ( enabled == 1 ) else False ) #NEWLINE# return ret