commit 9f2286c45aed7065deecf8cf10dc6e4be906ad85
parent 2c393392f4db6dcf6017665c4c072e29a50ebe24
Author: lash <dev@holbrook.no>
Date: Sat, 3 Dec 2022 17:34:18 +0000
Add issue state to standalone plain render
Diffstat:
4 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
@@ -1,6 +1,7 @@
- 0.2.1
* Render browsable HTML version of board, issues and issue logs
* Add sender identity in email on signature
+ * Auto-assign issue creator as owner
- 0.2.0
* GPG signing of issue messages.
* Use visitor pattern for messages verifier
diff --git a/piknik/render/plain.py b/piknik/render/plain.py
@@ -61,37 +61,40 @@ class Renderer(BaseRenderer):
def apply_issue_standalone(self, state, issue, tags, accumulator=None):
s = """title: {}
-tags: {}
id: {}
-
+state: {}
+tags: {}
""".format(
- issue.id,
issue.title,
+ issue.id,
+ state,
', '.join(tags),
)
self.add(s, accumulator=accumulator)
assigned = issue.get_assigned()
+ assigns = []
+ s = 'assigned to: '
if len(assigned) == 0:
- self.add('(not assigned)\n', accumulator=accumulator)
-
+ assigns.append('(not assigned)')
else:
- self.add('assigned to:\n', accumulator=accumulator)
owner = issue.owner()
for v in assigned:
o = v[0]
- s = o.id()
+ ss = o.id()
if o == owner:
- s += ' (owner)'
- s = '\t' + str(s) + '\n'
- self.add(s, accumulator=accumulator)
+ ss += ' (owner)'
+ #s = '\t' + str(s) + '\n'
+ assigns.append(ss)
+ s += ', '.join(assigns) + '\n'
+ self.add(s, accumulator=accumulator)
super(Renderer, self).apply_issue(state, issue, tags, accumulator=accumulator)
def apply_message(self, state, issue, tags, envelope, message, message_id, message_date, accumulator=None):
- s = '\nmessage {} from {} {} - {}\n\n'.format(
+ s = '\nmessage {} from {} {} - {}\n'.format(
message_date,
envelope.sender,
envelope.valid,
diff --git a/piknik/runnable/mod.py b/piknik/runnable/mod.py
@@ -14,8 +14,8 @@ argp.add_argument('--finish', action='store_true', help='Set issue as finished (
argp.add_argument('-s', '--state', type=str, help='Move to state')
argp.add_argument('-t', '--tag', type=str, action='append', default=[], help='Add tag to issue')
argp.add_argument('-u', '--untag', type=str, action='append', default=[], help='Remove tag from issue')
-argp.add_argument('-f', '--file', type=str, action='append', help='Add message file part')
-argp.add_argument('-m', '--message', type=str, action='append', default=[], help='Add message text part')
+#argp.add_argument('-f', '--file', type=str, action='append', help='Add message file part')
+#argp.add_argument('-m', '--message', type=str, action='append', default=[], help='Add message text part')
argp.add_argument('-a', '--assign', type=str, action='append', default=[], help='Assign given identity to issue')
argp.add_argument('--unassign', type=str, action='append', default=[], help='Unassign given identity from issue')
argp.add_argument('-o', '--owner', type=str, help='Set given identity as owner of issue')
diff --git a/piknik/runnable/show.py b/piknik/runnable/show.py
@@ -80,7 +80,6 @@ def reset_accumulator():
def main():
-
issues = []
if arg.issue_id:
issues.append(arg.issue_id)