Mercurial > hg > MPIWGWeb
comparison MPIWGRoot.py @ 84:faaded775a8a
styles for feature and feature archive.
author | casties |
---|---|
date | Mon, 13 May 2013 22:16:04 +0200 |
parents | df56982ecb03 |
children | 77f2478ae971 |
comparison
equal
deleted
inserted
replaced
83:ff0657e34ab4 | 84:faaded775a8a |
---|---|
165 if num is not None: | 165 if num is not None: |
166 # take only the last num elements | 166 # take only the last num elements |
167 items = items[-num:] | 167 items = items[-num:] |
168 return items | 168 return items |
169 | 169 |
170 | |
171 def getFeatureAuthorMap(self): | |
172 """Return a map of authors of features. | |
173 | |
174 Returns a dict with author names and a list of feature numbers. | |
175 """ | |
176 features = self.getFeatures() | |
177 authors = {} | |
178 # build dict of unique authors and features | |
179 fno = 0 | |
180 for f in features: | |
181 author = f.getAuthor() | |
182 fno += 1 | |
183 if author: | |
184 for a in author.split(';'): | |
185 a = a.strip() | |
186 if a in authors: | |
187 authors[a].append(fno) | |
188 else: | |
189 authors[a] = [fno] | |
190 | |
191 return authors | |
192 | |
170 | 193 |
171 def getDepartments(self): | 194 def getDepartments(self): |
172 """returns a list of the Departments""" | 195 """returns a list of the Departments""" |
173 dir = getattr(self, 'departments', None) | 196 dir = getattr(self, 'departments', None) |
174 if dir is None: | 197 if dir is None: |