Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
Use linbreaks in multirow column.
Browse files Browse the repository at this point in the history
  • Loading branch information
toirl committed Aug 28, 2017
1 parent 51332b0 commit 2853601
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions contrib/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,32 +40,36 @@ def print_fieldnames(config, args):
else:
print "\n".join(out)


def _render_options(options):
out = []
for o in options:
out.append(u"{}) {}".format(o[1], o[0]))
return u' | '.join(out)
return u"\n".join(out)


def _render_renderer(field):
if field.renderer:
return field.renderer.type
return ""


def _render_rules(field):
out = []
for r in field.get_rules():
if r.required or r.desired:
continue
out.append(u"{},{},{}".format(r._expression, r.msg, r.triggers))
return u" | ".join(out)
return u"\n".join(out)


def _render_conditions(config, field):
out = []
for cond in config.get_elements('if'):
for cond_field in cond.findall('field'):
if cond_field.attrib.get("ref") == field.id:
out.append(cond.attrib.get("expr"))
return u" | ".join(out)
return u"\n".join(out)


def print_fields(config, args):
Expand Down

0 comments on commit 2853601

Please sign in to comment.