Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* python/mushin/common/app.py:

	  Use kwargs more.
  • Loading branch information...
commit 603b5534b8c4a2231251fb3e4cb32fe98a2c5f7f 1 parent 5e1120e
Thomas Vander Stichele authored
Showing with 21 additions and 22 deletions.
  1. +5 −0 ChangeLog
  2. +16 −22 python/mushin/common/app.py
View
5 ChangeLog
@@ -1,5 +1,10 @@
2012-09-02 Thomas Vander Stichele <thomas at apestaart dot org>
+ * python/mushin/common/app.py:
+ Use kwargs more.
+
+2012-09-02 Thomas Vander Stichele <thomas at apestaart dot org>
+
* python/mushin/command/main.py:
Clean up whitespace.
View
38 python/mushin/common/app.py
@@ -63,7 +63,7 @@ def _getThingsByDue(self, which, factory, limit=None, include_docs=True):
dayend = daystart + datetime.timedelta(days=1)
options = {'include_docs': include_docs}
-
+
# FIXME: due dates, and hence keys, can possibly end with Z
startkey = endkey = None
@@ -84,7 +84,7 @@ def _getThingsByDue(self, which, factory, limit=None, include_docs=True):
options['startkey'] = startkey
if endkey:
options['endkey'] = endkey
-
+
# FIXME: dbName
view = views.View(self._couch, self._dbName, 'mushin',
'open-things-due', factory, **options)
@@ -167,13 +167,11 @@ def _getThingsByStatus(self, status, factory, include_docs=True):
@param status: one of 'waitingfor', 'nextaction'
"""
- args = 'include_docs=%s' % (
- include_docs and 'true' or 'false')
-
view = views.View(self._couch, self._dbName, 'mushin',
- 'by-status?%s&startkey=["%s"]&endkey=["%s","9"]' % (
- args, status, status),
- factory)
+ 'by-status', factory,
+ include_docs=include_docs,
+ startkey=[status, ],
+ endkey=[status, "9"])
self.debug('getThingsByStatus: view %r' % view)
d = view.queryView()
@@ -237,7 +235,7 @@ def getProjects(self):
@rtype: L{defer.Deferred} of generator
"""
view = views.View(self._couch, self._dbName, 'mushin',
- 'projects?group=true', Project)
+ 'projects', Project, group=True)
self.debug('getProjects: view %r' % view)
d = view.queryView()
@@ -250,7 +248,7 @@ def getStatuses(self):
@rtype: L{defer.Deferred} of generator
"""
view = views.View(self._couch, self._dbName, 'mushin',
- 'statuses?group=true', Status)
+ 'statuses', Status, group=True)
self.debug('getStatuses: view %r' % view)
d = view.queryView()
@@ -262,13 +260,11 @@ def _getThingsByProject(self, project, factory, include_docs=True):
@param project: the project
"""
- args = 'include_docs=%s' % (
- include_docs and 'true' or 'false')
-
view = views.View(self._couch, self._dbName, 'mushin',
- 'by-project?%s&startkey=["%s"]&endkey=["%s","9"]' % (
- args, project, project),
- factory)
+ 'by-project', factory,
+ include_docs=include_docs,
+ startkey=[project, ],
+ endkey=[project, "9"])
self.debug('getThingsByProject: view %r' % view)
d = view.queryView()
@@ -294,13 +290,11 @@ def _getThingsByContext(self, context, factory, include_docs=True):
@param context: the context
"""
- args = 'include_docs=%s' % (
- include_docs and 'true' or 'false')
-
view = views.View(self._couch, self._dbName, 'mushin',
- 'by-context?%s&startkey=["%s"]&endkey=["%s","9"]' % (
- args, context, context),
- factory)
+ 'by-context', factory,
+ include_docs=include_docs,
+ startkey=[context, ],
+ endkey=[context, "9"])
self.debug('getThingsByContext: view %r' % view)
d = view.queryView()
Please sign in to comment.
Something went wrong with that request. Please try again.