605 |
605 |
606 def parse_repo_uri(uri): |
606 def parse_repo_uri(uri): |
607 """ transform a command line uri into a (protocol, hostport, appid), e.g: |
607 """ transform a command line uri into a (protocol, hostport, appid), e.g: |
608 <myapp> -> 'inmemory', None, '<myapp>' |
608 <myapp> -> 'inmemory', None, '<myapp>' |
609 inmemory://<myapp> -> 'inmemory', None, '<myapp>' |
609 inmemory://<myapp> -> 'inmemory', None, '<myapp>' |
610 zmqpickle://[host][:port] -> 'zmqpickle', 'host:port', None |
|
611 """ |
610 """ |
612 parseduri = urlparse(uri) |
611 parseduri = urlparse(uri) |
613 scheme = parseduri.scheme |
612 scheme = parseduri.scheme |
614 if scheme == '': |
613 if scheme == '': |
615 return ('inmemory', None, parseduri.path) |
614 return ('inmemory', None, parseduri.path) |
616 if scheme == 'inmemory': |
615 if scheme == 'inmemory': |
617 return (scheme, None, parseduri.netloc) |
616 return (scheme, None, parseduri.netloc) |
618 if scheme.startswith('zmqpickle-'): |
|
619 return (scheme, parseduri.netloc, parseduri.path) |
|
620 raise NotImplementedError('URI protocol not implemented for `%s`' % uri) |
617 raise NotImplementedError('URI protocol not implemented for `%s`' % uri) |
621 |
618 |
622 |
619 |
623 |
620 |
624 logger = getLogger('cubicweb.utils') |
621 logger = getLogger('cubicweb.utils') |