commit 73bebec689998cea7c9307bbeed9af04849e1524
parent a0e86a951adbe862c48edca9a1b4fdc02fab08c5
Author: lash <dev@holbrook.no>
Date: Mon, 7 Nov 2022 09:07:49 +0000
Make finished optional in list, add PROPOSED state
Diffstat:
4 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/piknik/basket.py b/piknik/basket.py
@@ -37,6 +37,7 @@ class Basket:
def add(self, issue):
issue_id = str(issue.id)
self.state.put(issue_id, contents=str(issue))
+ self.__tags.put(issue_id)
return issue_id
@@ -45,7 +46,7 @@ class Basket:
o = Issue.from_str(r)
return o
-
+
def list(self, category=None):
if category == None:
category = self.state.BACKLOG
@@ -91,7 +92,7 @@ class Basket:
def states(self):
- return self.state.all(pure=True)
+ return self.state.all(pure=True, bit_order=True)
def tag(self, issue_id, tag):
diff --git a/piknik/runnable/list.py b/piknik/runnable/list.py
@@ -9,6 +9,7 @@ from piknik.store import FileStoreFactory
argp = argparse.ArgumentParser()
argp.add_argument('-d', type=str, help='Data directory')
argp.add_argument('-s', '--state', type=str, action='append', default=[], help='Include state in list')
+argp.add_argument('--show-finished', dest='show_finished', action='store_true', help='Include finished issues')
argp.add_argument('-r', '--renderer', type=str, default='ini', help='Renderer module for output')
arg = argp.parse_args(sys.argv[1:])
@@ -17,12 +18,16 @@ basket = Basket(store_factory)
def render_ini(b, r):
- for k in r.keys():
+ for k in basket.states():
+ if k == 'FINISHED' and not arg.show_finished:
+ continue
+
print('[' + k + ']')
for v in r[k]:
o = b.get(v)
- print('{}\t{}'.format(o.title, v))
+ t = b.tags(v)
+ print('{}\t{}\t{}'.format(o.title, ','.join(t), v))
print()
@@ -35,6 +40,7 @@ def main():
l = len(states)
for s in basket.states():
+
if results.get(s) == None:
results[s] = []
diff --git a/piknik/store/__init__.py b/piknik/store/__init__.py
@@ -14,7 +14,7 @@ class FileStoreFactory:
def create_states(self, logger=None, default_state=None, verifier=None):
factory = SimpleFileStoreFactory(self.directory).add
- return PersistedState(factory, 7, logger=logger, verifier=verifier, default_state=default_state)
+ return PersistedState(factory, 6, logger=logger, verifier=verifier, default_state=default_state)
def create_tags(self, logger=None, default_state=None, verifier=None):
diff --git a/tests/common.py b/tests/common.py
@@ -14,7 +14,7 @@ def debug_out(self, k, v):
class TestStates:
def create_states(*args, **kwargs):
- return shep.State(6, *args, event_callback=debug_out, **kwargs)
+ return shep.State(7, *args, event_callback=debug_out, **kwargs)
def create_tags(*args, **kwargs):