X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=pdm%2Fcli.py;h=7cfa2635fd5d60a369f44bd9bf764fa14a8f8b5c;hb=3e02e6b54c766318d60405e16c556d8fcaff4143;hp=0b316823ef8cddc23728b85b1f2bb4c434d5e21e;hpb=c58b1ad8cc6658ea46ed049f6909b4ce05906b57;p=pdm.git diff --git a/pdm/cli.py b/pdm/cli.py index 0b31682..7cfa263 100644 --- a/pdm/cli.py +++ b/pdm/cli.py @@ -19,16 +19,21 @@ def resolve(spec): return spec sk = None try: - if "/" in spec: + if ":" in spec: + p = spec.rindex(":") + first, second = spec[:p], spec[p + 1:] + if "/" in second: + from . import sshsock + sk = sshsock.sshsocket(first, second) + else: + sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sk.connect((first, second)) + elif "/" in spec: sk = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sk.connect(spec) elif spec.isdigit(): sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sk.connect(("localhost", int(spec))) - elif ":" in spec: - sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - p = spec.rindex(":") - sk.connect((spec[:p], int(spec[p + 1:]))) else: raise Exception("Unknown target specification %r" % spec) rv = sk @@ -319,7 +324,7 @@ class perfclient(client): used by the server process. The proxy objects returned by this function are cached and the - same object are returned the next time the same name is + same object is returned the next time the same name is requested, which means that they are kept live until the client connection is closed. """