# HG changeset patch # User Sylvain Thénault # Date 1489158845 -3600 # Node ID c16c1805e973dd9f077ca463f8ecc3a4c9202183 # Parent 92da3e6cb1049e70c546768bde4c7739c83f5e21 [cleanup] Drop no more used parse_repo_uri function diff -r 92da3e6cb104 -r c16c1805e973 cubicweb/repoapi.py --- a/cubicweb/repoapi.py Fri Mar 10 14:07:15 2017 +0100 +++ b/cubicweb/repoapi.py Fri Mar 10 16:14:05 2017 +0100 @@ -23,7 +23,6 @@ from logilab.common.deprecation import class_deprecated -from cubicweb.utils import parse_repo_uri from cubicweb import AuthenticationError from cubicweb.server.session import Connection diff -r 92da3e6cb104 -r c16c1805e973 cubicweb/test/unittest_utils.py --- a/cubicweb/test/unittest_utils.py Fri Mar 10 14:07:15 2017 +0100 +++ b/cubicweb/test/unittest_utils.py Fri Mar 10 16:14:05 2017 +0100 @@ -33,7 +33,7 @@ from cubicweb import Binary, Unauthorized from cubicweb.devtools.testlib import CubicWebTC from cubicweb.utils import (make_uid, UStringIO, RepeatList, HTMLHead, - QueryCache, parse_repo_uri) + QueryCache) from cubicweb.entity import Entity try: @@ -59,18 +59,6 @@ d.add(uid) -class TestParseRepoUri(TestCase): - - def test_parse_repo_uri(self): - self.assertEqual(('inmemory', None, 'myapp'), - parse_repo_uri('myapp')) - self.assertEqual(('inmemory', None, 'myapp'), - parse_repo_uri('inmemory://myapp')) - with self.assertRaises(NotImplementedError): - parse_repo_uri('foo://bar') - - - class TestQueryCache(TestCase): def test_querycache(self): c = QueryCache(ceiling=20) diff -r 92da3e6cb104 -r c16c1805e973 cubicweb/utils.py --- a/cubicweb/utils.py Fri Mar 10 14:07:15 2017 +0100 +++ b/cubicweb/utils.py Fri Mar 10 16:14:05 2017 +0100 @@ -37,7 +37,6 @@ from logging import getLogger from six import text_type -from six.moves.urllib.parse import urlparse from logilab.mtconverter import xml_escape from logilab.common.deprecation import deprecated @@ -585,21 +584,6 @@ return 'javascript: ' + PERCENT_IN_URLQUOTE_RE.sub(r'%25', javascript_code) -def parse_repo_uri(uri): - """ transform a command line uri into a (protocol, hostport, appid), e.g: - -> 'inmemory', None, '' - inmemory:// -> 'inmemory', None, '' - """ - parseduri = urlparse(uri) - scheme = parseduri.scheme - if scheme == '': - return ('inmemory', None, parseduri.path) - if scheme == 'inmemory': - return (scheme, None, parseduri.netloc) - raise NotImplementedError('URI protocol not implemented for `%s`' % uri) - - - logger = getLogger('cubicweb.utils') class QueryCache(object):