Move _get_dburi into staticmethod get_dburi and keep backward compatibility

This commit is contained in:
Cédric Krier committed 2009-04-30 17:41:38 +02:00
1 parent e04f32e815
commit aff08f1d0b
1 file changed
+5 -1
+5 -1
View File
@@ -140,13 +140,17 @@ class TrytonDAVInterface(iface.dav_interface):
self.baseuri = '%s://%s:%s/' % (protocol, interface or socket.gethostname(), port)
self.verbose = False
def _get_dburi(self, uri):
@staticmethod
def get_dburi(uri):
uri = urlparse.urlsplit(uri)[2]
if uri[0] == '/':
uri = uri[1:]
dbname, uri = (uri.split('/', 1) + [None])[0:2]
return dbname, uri
def _get_dburi(self, uri):
return TrytonDAVInterface.get_dburi(uri)
def get_childs(self, uri):
res = []
dbname, dburi = self._get_dburi(uri)