[Getan-commits] [PATCH] Fix setting workpackage of project if description is None
Wald Commits
scm-commit at wald.intevation.org
Fri Mar 7 16:02:11 CET 2014
# HG changeset patch
# User Björn Ricks <bjoern.ricks at intevation.de>
# Date 1394204527 -3600
# Node ID 8b44243b799a96a2a609646327c5fe84922c6261
# Parent f4dcfbede99b62650c65a456733ec36b3a521eb1
Fix setting workpackage of project if description is None
diff -r f4dcfbede99b -r 8b44243b799a getan/project.py
--- a/getan/project.py Mon Mar 03 15:57:54 2014 +0100
+++ b/getan/project.py Fri Mar 07 16:02:07 2014 +0100
@@ -90,6 +90,7 @@
self.start = start
self.end = end
self.desc = desc
+ self.workpackage = "-"
# carefully handle non unicode string
# urwid seems to have some issue with plain str
@@ -97,13 +98,12 @@
self.desc = unicode(self.desc, locale.getpreferredencoding())
c = self.desc
- m = self.WORKPACKAGE.match(c)
- if m:
- self.workpackage = m.group(1)
- c = c[m.end():].strip()
- else:
- self.workpackage = "-"
- c = c.replace('\x1b', '')
+ if c:
+ m = self.WORKPACKAGE.match(c)
+ if m:
+ self.workpackage = m.group(1)
+ c = c[m.end():].strip()
+ c = c.replace('\x1b', '')
self.comment = c
def get_workpackage(self):
More information about the Getan-commits
mailing list