Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

* python/mushin/common/app.py:

	  Use kwargs more.
  • Loading branch information...
commit 603b5534b8c4a2231251fb3e4cb32fe98a2c5f7f 1 parent 5e1120e
Thomas Vander Stichele authored

Showing 2 changed files with 21 additions and 22 deletions. Show diff stats Hide diff stats

  1. +5 0 ChangeLog
  2. +16 22 python/mushin/common/app.py
5 ChangeLog
... ... @@ -1,5 +1,10 @@
1 1 2012-09-02 Thomas Vander Stichele <thomas at apestaart dot org>
2 2
  3 + * python/mushin/common/app.py:
  4 + Use kwargs more.
  5 +
  6 +2012-09-02 Thomas Vander Stichele <thomas at apestaart dot org>
  7 +
3 8 * python/mushin/command/main.py:
4 9 Clean up whitespace.
5 10
38 python/mushin/common/app.py
@@ -63,7 +63,7 @@ def _getThingsByDue(self, which, factory, limit=None, include_docs=True):
63 63 dayend = daystart + datetime.timedelta(days=1)
64 64
65 65 options = {'include_docs': include_docs}
66   -
  66 +
67 67 # FIXME: due dates, and hence keys, can possibly end with Z
68 68 startkey = endkey = None
69 69
@@ -84,7 +84,7 @@ def _getThingsByDue(self, which, factory, limit=None, include_docs=True):
84 84 options['startkey'] = startkey
85 85 if endkey:
86 86 options['endkey'] = endkey
87   -
  87 +
88 88 # FIXME: dbName
89 89 view = views.View(self._couch, self._dbName, 'mushin',
90 90 'open-things-due', factory, **options)
@@ -167,13 +167,11 @@ def _getThingsByStatus(self, status, factory, include_docs=True):
167 167
168 168 @param status: one of 'waitingfor', 'nextaction'
169 169 """
170   - args = 'include_docs=%s' % (
171   - include_docs and 'true' or 'false')
172   -
173 170 view = views.View(self._couch, self._dbName, 'mushin',
174   - 'by-status?%s&startkey=["%s"]&endkey=["%s","9"]' % (
175   - args, status, status),
176   - factory)
  171 + 'by-status', factory,
  172 + include_docs=include_docs,
  173 + startkey=[status, ],
  174 + endkey=[status, "9"])
177 175 self.debug('getThingsByStatus: view %r' % view)
178 176
179 177 d = view.queryView()
@@ -237,7 +235,7 @@ def getProjects(self):
237 235 @rtype: L{defer.Deferred} of generator
238 236 """
239 237 view = views.View(self._couch, self._dbName, 'mushin',
240   - 'projects?group=true', Project)
  238 + 'projects', Project, group=True)
241 239 self.debug('getProjects: view %r' % view)
242 240
243 241 d = view.queryView()
@@ -250,7 +248,7 @@ def getStatuses(self):
250 248 @rtype: L{defer.Deferred} of generator
251 249 """
252 250 view = views.View(self._couch, self._dbName, 'mushin',
253   - 'statuses?group=true', Status)
  251 + 'statuses', Status, group=True)
254 252 self.debug('getStatuses: view %r' % view)
255 253
256 254 d = view.queryView()
@@ -262,13 +260,11 @@ def _getThingsByProject(self, project, factory, include_docs=True):
262 260
263 261 @param project: the project
264 262 """
265   - args = 'include_docs=%s' % (
266   - include_docs and 'true' or 'false')
267   -
268 263 view = views.View(self._couch, self._dbName, 'mushin',
269   - 'by-project?%s&startkey=["%s"]&endkey=["%s","9"]' % (
270   - args, project, project),
271   - factory)
  264 + 'by-project', factory,
  265 + include_docs=include_docs,
  266 + startkey=[project, ],
  267 + endkey=[project, "9"])
272 268 self.debug('getThingsByProject: view %r' % view)
273 269
274 270 d = view.queryView()
@@ -294,13 +290,11 @@ def _getThingsByContext(self, context, factory, include_docs=True):
294 290
295 291 @param context: the context
296 292 """
297   - args = 'include_docs=%s' % (
298   - include_docs and 'true' or 'false')
299   -
300 293 view = views.View(self._couch, self._dbName, 'mushin',
301   - 'by-context?%s&startkey=["%s"]&endkey=["%s","9"]' % (
302   - args, context, context),
303   - factory)
  294 + 'by-context', factory,
  295 + include_docs=include_docs,
  296 + startkey=[context, ],
  297 + endkey=[context, "9"])
304 298 self.debug('getThingsByContext: view %r' % view)
305 299
306 300 d = view.queryView()

0 comments on commit 603b553

Please sign in to comment.
Something went wrong with that request. Please try again.