def get_account_info(env, app, swift_source=None):
 (version, account, _junk, _junk) = split_path(env['PATH_INFO'], 2, 4, True)
 info = _get_info_from_caches(app, env, account)
 if (not info):
  env.setdefault('swift.infocache', {})
  req = _prepare_pre_auth_info_request(env, ('/%s/%s' % (version, account)), (swift_source or 'GET_ACCOUNT_INFO'))
  resp = req.get_response(app)
  info = _get_info_from_infocache(env, account)
  if (info is None):
   info = set_info_cache(app, env, account, None, resp)
 if info:
  info = info.copy()
 else:
  info = headers_to_account_info({}, 0)
 for field in ('container_count', 'bytes', 'total_object_count'):
  if (info.get(field) is None):
   info[field] = 0
  else:
   info[field] = int(info[field])
 return info

def get_account_info ( env , app , swift_source = None ) : ( version , account , _junk , _junk ) = split_path ( env [ 'PATH_INFO' ] , 2 , 4 , True ) info = _get_info_from_caches ( app , env , account ) if ( not info ) : env . setdefault ( 'swift.infocache' , { } ) req = _prepare_pre_auth_info_request ( env , ( '/%s/%s' % ( version , account ) ) , ( swift_source or 'GET_ACCOUNT_INFO' ) ) resp = req . get_response ( app ) info = _get_info_from_infocache ( env , account ) if ( info is None ) : info = set_info_cache ( app , env , account , None , resp ) if info : info = info . copy ( ) else : info = headers_to_account_info ( { } , 0 ) for field in ( 'container_count' , 'bytes' , 'total_object_count' ) : if ( info . get ( field ) is None ) : info [ field ] = 0 else : info [ field ] = int ( info [ field ] ) return info
get the info structure for an account .