piknik

Unnamed repository; edit this file 'description' to name the repository.
Info | Log | Files | Refs | README | LICENSE

commit 276540d5d93f6478713b6c70cf42ef561df0c71b
parent 462297d9159e12292af4576575b59df652565b0a
Author: lash <dev@holbrook.no>
Date:   Sat,  3 Dec 2022 18:23:46 +0000

Correct order of multipart content in message

Diffstat:
Mpiknik/render/html.py | 26++++++++++++++------------
Mpiknik/wrap.py | 2+-
2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/piknik/render/html.py b/piknik/render/html.py @@ -21,6 +21,7 @@ class Accumulator: self.category = ul(_id='state_list') self.issue = None self.msg = None + self.envelope = None self.w = w self.issues = [] @@ -29,6 +30,8 @@ class Accumulator: if w == None: w = self.w if len(v) == 0: + if self.envelope != None: + self.msg.add(self.envelope) self.doc.add(self.category) if self.msg != None: self.doc.add(self.msg) @@ -52,9 +55,11 @@ class Accumulator: self.msg = ol(_id='message_list') self.issues.append(v_id[2:]) elif v_id[:2] == 'm_': - self.msg.add(li(v)) + if self.envelope != None: + self.msg.add(self.envelope) + self.envelope = li(v) elif v_id[:4] == 'd_m_': - self.msg.add(v) + self.envelope.add(v) else: self.doc = v @@ -95,16 +100,13 @@ class Renderer(BaseRenderer): s.add(dd(state)) s.add(dt('tags')) - r_d = dd() - r_r = ul() - for i, v in enumerate(tags): - if v == '(UNTAGGED)': - r_d.add(dd(v)) - continue - else: - r_r.add(li(v)) - r_d.add(r_r) - s.add(r_d) + if len(tags) == 1 and tags[0] == '(UNTAGGED)': + s.add(dd(tags[0])) + else: + r_d = ul() + for v in tags: + r_d.add(li(v)) + s.add(dd(r_d)) assigned = issue.get_assigned() s.add(dt('assigned to')) diff --git a/piknik/wrap.py b/piknik/wrap.py @@ -88,6 +88,6 @@ class Wrapper: def pop(self): try: - return self.content_buffer.pop() + return self.content_buffer.pop(0) except IndexError: return None