def initRpc(config):
 rpc_data = {'connect': '127.0.0.1', 'port': '8336', 'user': 'PLACEHOLDER', 'password': 'PLACEHOLDER', 'clienttimeout': '900'}
 try:
  fptr = open(config, 'r')
  lines = fptr.readlines()
  fptr.close()
 except:
  return None
 for line in lines:
  if (not line.startswith('rpc')):
   continue
  key_val = line.split(None, 1)[0]
  (key, val) = key_val.split('=', 1)
  if ((not key) or (not val)):
   continue
  rpc_data[key[3:]] = val
 url = ('http://%(user)s:%(password)s@%(connect)s:%(port)s' % rpc_data)
 return (url, int(rpc_data['clienttimeout']))

def initRpc ( config ) : rpc_data = { 'connect' : '127.0.0.1' , 'port' : '8336' , 'user' : 'PLACEHOLDER' , 'password' : 'PLACEHOLDER' , 'clienttimeout' : '900' } try : fptr = open ( config , 'r' ) lines = fptr . readlines ( ) fptr . close ( ) except : return None for line in lines : if ( not line . startswith ( 'rpc' ) ) : continue key_val = line . split ( None , 1 ) [ 0 ] ( key , val ) = key_val . split ( '=' , 1 ) if ( ( not key ) or ( not val ) ) : continue rpc_data [ key [ 3 : ] ] = val url = ( 'http://%(user)s:%(password)s@%(connect)s:%(port)s' % rpc_data ) return ( url , int ( rpc_data [ 'clienttimeout' ] ) )
initialize namecoin rpc .