def format_for_columns(pkgs, options):
 running_outdated = options.outdated
 if running_outdated:
  header = ['Package', 'Version', 'Latest', 'Type']
 else:
  header = ['Package', 'Version']
 data = []
 if any((dist_is_editable(x) for x in pkgs)):
  header.append('Location')
 for proj in pkgs:
  row = [proj.project_name, proj.version]
  if running_outdated:
   row.append(proj.latest_version)
   row.append(proj.latest_filetype)
  if dist_is_editable(proj):
   row.append(proj.location)
  data.append(row)
 return (data, header)

def format_for_columns ( pkgs , options ) : running_outdated = options . outdated if running_outdated : header = [ 'Package' , 'Version' , 'Latest' , 'Type' ] else : header = [ 'Package' , 'Version' ] data = [ ] if any ( ( dist_is_editable ( x ) for x in pkgs ) ) : header . append ( 'Location' ) for proj in pkgs : row = [ proj . project_name , proj . version ] if running_outdated : row . append ( proj . latest_version ) row . append ( proj . latest_filetype ) if dist_is_editable ( proj ) : row . append ( proj . location ) data . append ( row ) return ( data , header )
convert the package data into something usable by output_package_listing_columns .