File: util.py

package info (click to toggle)
mako 1.0.6%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,556 kB
  • ctags: 1,495
  • sloc: python: 11,807; makefile: 167
file content (7 lines) | stat: -rw-r--r-- 216 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
import re

def flatten_result(result):
    return re.sub(r'[\s\r\n]+', ' ', result).strip()

def result_lines(result):
    return [x.strip() for x in re.split(r'\r?\n', re.sub(r' +', ' ', result)) if x.strip() != '']