Skip to content

Commit

Permalink
make codeclimate happy
Browse files Browse the repository at this point in the history
  • Loading branch information
meeuw authored and pazz committed Jan 2, 2024
1 parent 27c2db7 commit 2c5dc0d
Showing 1 changed file with 70 additions and 69 deletions.
139 changes: 70 additions & 69 deletions extra/theme_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,74 +22,72 @@ def as_attr(t, colourmode, name):
return [f"{name}: ".rjust(WIDTH), (attr, "A B C")]


def get_text(t):
txt = []
for colourmode in (1, 16, 256):
txt += [f"\nColourmode: {colourmode}\n"]
for i, name in enumerate(
(
"global.footer",
"global.body",
"global.notify_error",
"global.notify_normal",
"global.prompt",
"global.tag",
"global.tag_focus",
"help.text",
"help.section",
"help.title",
"bufferlist.line_focus",
"bufferlist.line_even",
"bufferlist.line_odd",
"taglist.line_focus",
"taglist.line_even",
"taglist.line_odd",
"namedqueries.line_focus",
"namedqueries.line_even",
"namedqueries.line_odd",
"thread.arrow_heads",
"thread.arrow_bars",
"thread.attachment",
"thread.attachment_focus",
"thread.body",
"thread.body_focus",
"thread.header",
"thread.header_key",
"thread.header_value",
"thread.summary.even",
"thread.summary.odd",
"thread.summary.focus",
"envelope.body",
"envelope.header",
"envelope.header_key",
"envelope.header_value",
"search.threadline.normal",
"search.threadline.focus",
"search.threadline.parts",
"search.threadline.date.normal",
"search.threadline.date.focus",
"search.threadline.mailcount.normal",
"search.threadline.mailcount.focus",
"search.threadline.tags.normal",
"search.threadline.tags.focus",
"search.threadline.authors.normal",
"search.threadline.authors.focus",
"search.threadline.subject.normal",
"search.threadline.subject.focus",
"search.threadline.content.normal",
"search.threadline.content.focus",
"search.threadline-unread.normal",
"search.threadline-unread.date.normal",
"search.threadline-unread.mailcount.normal",
"search.threadline-unread.tags.normal",
"search.threadline-unread.authors.normal",
"search.threadline-unread.subject.normal",
"search.threadline-unread.content.normal",
)
):
txt += as_attr(t, colourmode, name)
if i % 4 == 0:
txt.append("\n")
def get_text(t, colourmode):
txt = [f"\nColourmode: {colourmode}\n"]
for i, name in enumerate(
(
"global.footer",
"global.body",
"global.notify_error",
"global.notify_normal",
"global.prompt",
"global.tag",
"global.tag_focus",
"help.text",
"help.section",
"help.title",
"bufferlist.line_focus",
"bufferlist.line_even",
"bufferlist.line_odd",
"taglist.line_focus",
"taglist.line_even",
"taglist.line_odd",
"namedqueries.line_focus",
"namedqueries.line_even",
"namedqueries.line_odd",
"thread.arrow_heads",
"thread.arrow_bars",
"thread.attachment",
"thread.attachment_focus",
"thread.body",
"thread.body_focus",
"thread.header",
"thread.header_key",
"thread.header_value",
"thread.summary.even",
"thread.summary.odd",
"thread.summary.focus",
"envelope.body",
"envelope.header",
"envelope.header_key",
"envelope.header_value",
"search.threadline.normal",
"search.threadline.focus",
"search.threadline.parts",
"search.threadline.date.normal",
"search.threadline.date.focus",
"search.threadline.mailcount.normal",
"search.threadline.mailcount.focus",
"search.threadline.tags.normal",
"search.threadline.tags.focus",
"search.threadline.authors.normal",
"search.threadline.authors.focus",
"search.threadline.subject.normal",
"search.threadline.subject.focus",
"search.threadline.content.normal",
"search.threadline.content.focus",
"search.threadline-unread.normal",
"search.threadline-unread.date.normal",
"search.threadline-unread.mailcount.normal",
"search.threadline-unread.tags.normal",
"search.threadline-unread.authors.normal",
"search.threadline-unread.subject.normal",
"search.threadline-unread.content.normal",
)
):
txt += as_attr(t, colourmode, name)
if i % 4 == 0:
txt.append("\n")
return txt


Expand All @@ -104,7 +102,10 @@ def main():
with open(theme_filename, encoding="utf8") as f:
t = theme.Theme(f)

fill = urwid.Filler(urwid.Text(get_text(t)), "top")
txt = []
for colourmode in (1, 16, 256):
txt += get_text(t, colourmode)
fill = urwid.Filler(urwid.Text(txt), "top")

loop = urwid.MainLoop(fill)
loop.run()
Expand Down

0 comments on commit 2c5dc0d

Please sign in to comment.