Permalink
Browse files

refactoring

  • Loading branch information...
1 parent 8ba14b1 commit 75a597305ed9d0b8f19b802dfd3350c03ce47d59 @AndreCharbonneau AndreCharbonneau committed Apr 10, 2013
Showing with 45 additions and 29 deletions.
  1. +45 −29 wsgi/services/base.py
View
@@ -56,6 +56,51 @@ def _parseISOTimestamp(self, timestamp):
converted = datetime.datetime.strptime(timestamp, "%Y-%m-%dT%H:%M:%S")
return converted
+ def _connectRoutes(self, d):
+ """
+ Call this method to register the URL routes.
+ This method will register the following URIs:
+
+ <base>/service/info
+ <base>/service/stats
+ <base>/service/doc
+ <base>/service/releasenotes
+ <base>/service/support
+ <base>/service/source
+ <base>/service/tryme
+
+ """
+ d.connect(self.__class__.__name__ + '-info',
+ '/%s/service/info' % (self._getUrlBase()), controller = self, action = 'info')
+ d.connect(self.__class__.__name__ + '-stats',
+ '/%s/service/stats' % (self._getUrlBase()), controller = self, action = 'stats')
+ d.connect(self.__class__.__name__ + '-doc',
+ '/%s/service/doc' % (self._getUrlBase()), controller = self, action = 'doc')
+ d.connect(self.__class__.__name__ + '-releasenotes',
+ '/%s/service/releasenotes' % (self._getUrlBase()), controller = self, action = 'releasenotes')
+ d.connect(self.__class__.__name__ + '-support',
+ '/%s/service/support' % (self._getUrlBase()), controller = self, action = 'support')
+ d.connect(self.__class__.__name__ + '-source',
+ '/%s/service/source' % (self._getUrlBase()), controller = self, action = 'source')
+ d.connect(self.__class__.__name__ + '-tryme',
+ '/%s/service/tryme' % (self._getUrlBase()), controller = self, action = 'tryme')
+
+
+ def _getUrlBase(self):
+ return self._getFromConfig('url_base', self.getName().lower())
+
+
+ def _getXmlRpcServer(self):
+ return self._getFromConfig('xmlrpc_server')
+
+
+
+
+
+
+
+
+
#
# URL routes handlers.
# The following route handlers will be called when specific URLs are visited.
@@ -236,35 +281,6 @@ def tryme(self):
- def _connectRoutes(self, d):
- """
- Call this method to register the URL routes.
- This method will register the following URIs:
-
- <base>/service/info
- <base>/service/stats
- <base>/service/doc
- <base>/service/releasenotes
- <base>/service/support
- <base>/service/source
- <base>/service/tryme
-
- """
- d.connect(self.__class__.__name__ + '-info', '/%s/service/info' % (self._getUrlBase()), controller = self, action = 'info')
- d.connect(self.__class__.__name__ + '-stats', '/%s/service/stats' % (self._getUrlBase()), controller = self, action = 'stats')
- d.connect(self.__class__.__name__ + '-doc', '/%s/service/doc' % (self._getUrlBase()), controller = self, action = 'doc')
- d.connect(self.__class__.__name__ + '-releasenotes', '/%s/service/releasenotes' % (self._getUrlBase()), controller = self, action = 'releasenotes')
- d.connect(self.__class__.__name__ + '-support', '/%s/service/support' % (self._getUrlBase()), controller = self, action = 'support')
- d.connect(self.__class__.__name__ + '-source', '/%s/service/source' % (self._getUrlBase()), controller = self, action = 'source')
- d.connect(self.__class__.__name__ + '-tryme', '/%s/service/tryme' % (self._getUrlBase()), controller = self, action = 'tryme')
-
-
- def _getUrlBase(self):
- return self._getFromConfig('url_base', self.getName().lower())
-
-
- def _getXmlRpcServer(self):
- return self._getFromConfig('xmlrpc_server')

0 comments on commit 75a5973

Please sign in to comment.