def _process_info_installed_output(out, filter_attrs):
 ret = {}
 name = None
 attrs = {}
 attr = None
 for line in salt.utils.itertools.split(out, '\n'):
  if (line and (line[0] == ' ')):
   if ((filter_attrs is None) or (attr in filter_attrs)):
    line = line.strip()
    if len(attrs[attr]):
     attrs[attr] += '\n'
    attrs[attr] += line
   continue
  line = line.strip()
  if (not line):
   if name:
    ret[name] = attrs
   name = None
   attrs = {}
   attr = None
   continue
  (key, value) = line.split(':', 1)
  value = value.lstrip()
  attr = _convert_to_standard_attr(key)
  if (attr == 'name'):
   name = value
  elif ((filter_attrs is None) or (attr in filter_attrs)):
   attrs[attr] = value
 if name:
  ret[name] = attrs
 return ret

def _process_info_installed_output ( out , filter_attrs ) : ret = { } name = None attrs = { } attr = None for line in salt . utils . itertools . split ( out , '\n' ) : if ( line and ( line [ 0 ] == ' ' ) ) : if ( ( filter_attrs is None ) or ( attr in filter_attrs ) ) : line = line . strip ( ) if len ( attrs [ attr ] ) : attrs [ attr ] += '\n' attrs [ attr ] += line continue line = line . strip ( ) if ( not line ) : if name : ret [ name ] = attrs name = None attrs = { } attr = None continue ( key , value ) = line . split ( ':' , 1 ) value = value . lstrip ( ) attr = _convert_to_standard_attr ( key ) if ( attr == 'name' ) : name = value elif ( ( filter_attrs is None ) or ( attr in filter_attrs ) ) : attrs [ attr ] = value if name : ret [ name ] = attrs return ret
helper function for info_installed() processes stdout output from a single invocation of opkg status .