Revision eac9b7b8 lib/utils/text.py

b/lib/utils/text.py
654 654
  return [line for line in map(lambda s: s.strip(), text.splitlines())
655 655
          # Ignore empty lines and comments
656 656
          if line and not line.startswith("#")]
657

  
658

  
659
def FormatKeyValue(data):
660
  """Formats a dictionary as "key=value" parameters.
661

  
662
  The keys are sorted to have a stable order.
663

  
664
  @type data: dict
665
  @rtype: list of string
666

  
667
  """
668
  return ["%s=%s" % (key, value) for (key, value) in sorted(data.items())]

Also available in: Unified diff