[svn r57538] re-apply few fixes to make experimental gateway path basically work again.
--HG-- branch : trunk
This commit is contained in:
		
							parent
							
								
									37a41ed0b7
								
							
						
					
					
						commit
						c0d524139e
					
				|  | @ -25,7 +25,7 @@ class PathServer: | |||
| 
 | ||||
|     def command_GET(self, id, spec): | ||||
|         path = self.C2P[id] | ||||
|         self.channel.send(path.get(spec)) | ||||
|         self.channel.send(path._getbyspec(spec)) | ||||
| 
 | ||||
|     def command_READ(self, id): | ||||
|         path = self.C2P[id] | ||||
|  | @ -53,7 +53,7 @@ class PathServer: | |||
| if __name__ == '__main__': | ||||
|     import py | ||||
|     gw = py.execnet.PopenGateway() | ||||
|     channel = gw.channelfactory.new() | ||||
|     channel = gw._channelfactory.new() | ||||
|     srv = PathServer(channel) | ||||
|     c = gw.remote_exec(""" | ||||
|         import remotepath | ||||
|  |  | |||
|  | @ -13,8 +13,9 @@ channel.send(srv.p2c(py.path.local("/tmp"))) | |||
| 
 | ||||
| #gw = py.execnet.SshGateway('codespeak.net') | ||||
| gw = py.execnet.PopenGateway() | ||||
| c = gw.remote_exec(SRC) | ||||
| subchannel = gw.channelfactory.new() | ||||
| gw.remote_init_threads(5) | ||||
| c = gw.remote_exec(SRC, stdout=py.std.sys.stdout, stderr=py.std.sys.stderr) | ||||
| subchannel = gw._channelfactory.new() | ||||
| c.send(subchannel) | ||||
| 
 | ||||
| p = RemotePath(subchannel, c.receive()) | ||||
|  |  | |||
|  | @ -33,7 +33,7 @@ class RemotePath(common.FSPathBase): | |||
|         self._channel.send(('JOIN', self._id, id) + args) | ||||
|         return RemotePath(self._channel, id) | ||||
| 
 | ||||
|     def get(self, spec): | ||||
|     def _getbyspec(self, spec): | ||||
|         parts = spec.split(',') | ||||
|         ask = [x for x in parts  if x not in self._specs] | ||||
|         if ask: | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue