Permalink
Browse files

bugfixes

  • Loading branch information...
1 parent 39192eb commit f130d03e53162cd255c089c78773255367e4afd7 @AndreCharbonneau AndreCharbonneau committed Apr 10, 2013
Showing with 14 additions and 11 deletions.
  1. +14 −11 wsgi/services/base.py
View
@@ -103,9 +103,12 @@ def info(self):
d['version'] = self.getVersion()
d['institution'] = self.getInstitution()
dt = self.getReleaseTime()
- if (dt.tzinfo != None) and (dt.utcoffset() != None):
- dt = dt.astimezone(pytz.utc)
- d['releaseTime'] = dt.strftime('%a %b %d %Y %H:%M:%S')
+ if dt != None:
+ if (dt.tzinfo != None) and (dt.utcoffset() != None):
+ dt = dt.astimezone(pytz.utc)
+ d['releaseTime'] = dt.strftime('%a %b %d %Y %H:%M:%S')
+ else:
+ d['releaseTime'] = ''
if acceptHeader == 'application/json':
return json.dumps(d)
@@ -281,19 +284,19 @@ def getName(self):
return self._getFromConfig('name', self.__class__.__name__)
def getSynopsis(self):
- return self._getFromConfig('synopsis')
+ return self._getFromConfig('synopsis', '')
def getVersion(self):
- return self._getFromConfig('version')
+ return self._getFromConfig('version', '')
def getInstitution(self):
- return self._getFromConfig('institution')
+ return self._getFromConfig('institution', '')
def getReleaseTime(self):
return self._parseISOTimestamp(self._getFromConfig('release_time'))
def getInvocations(self):
- return self._getFromConfig('invocations')
+ return self._getFromConfig('invocations', '')
def getLastReset(self):
"""
@@ -302,17 +305,17 @@ def getLastReset(self):
return self._parseISOTimestamp(self._getFromConfig('last_reset'))
def getDoc(self):
- return self._getFromConfig('documentation')
+ return self._getFromConfig('documentation', '')
def getReleaseNotes(self):
- return self._getFromConfig('release_notes')
+ return self._getFromConfig('release_notes', '')
def getSupport(self):
- return self._getFromConfig('support')
+ return self._getFromConfig('support', '')
def getSource(self):
# Defaults to 'No Content' if not implemented in subclass.
- source = self._getFromConfig('support')
+ source = self._getFromConfig('source')
if source == None:
cherrypy.response.status = 204
else:

0 comments on commit f130d03

Please sign in to comment.