Download:
child 48:ab4996533232
parent 46:d89076c15b35
47:cd38f08d1b6a
Anton Shestakov <av6@dwimlabs.net>, Sat, 06 Feb 2016 20:46:27 +0800
viewer: move marks-selecting code to getmarks()

1 файлов изменено, 12 вставок(+), 8 удалений(-) [+]
viewer.py file | annotate | diff | comparison | revisions
--- a/viewer.py Mon Sep 28 01:56:59 2015 +0800
+++ b/viewer.py Sat Feb 06 20:46:27 2016 +0800
@@ -69,6 +69,17 @@
repomt = os.stat(changelog).st_mtime
return 'W/"{},{}"'.format(dbmt, repomt)
+ def getmarks(self):
+ chosen = self.get_argument('marks', '')
+ if chosen:
+ chosen = chosen.split(',')
+ marks = OrderedDict((mark, MARKS[mark]) for mark in chosen if mark in MARKS)
+ moremarks = OrderedDict((mark, desc) for mark, desc in MARKS.items() if mark not in chosen)
+ else:
+ marks = MARKS
+ moremarks = {}
+ return marks, moremarks
+
def getchangesets(self):
rev = self.get_argument('rev', 'tip')
revcount = 120
@@ -211,14 +222,7 @@
def results_html(self):
changesets = self.getchangesets()
- showmarks = self.get_argument('marks', '')
- if showmarks:
- showmarks = showmarks.split(',')
- marks = OrderedDict((mark, MARKS[mark]) for mark in showmarks if mark in MARKS)
- moremarks = OrderedDict((mark, desc) for mark, desc in MARKS.items() if mark not in showmarks)
- else:
- marks = MARKS
- moremarks = {}
+ marks, moremarks = self.getmarks()
local = self.get_argument('local', False)
results, colormap = self.getresults(changesets, marks=marks, local=local)
context = {