Skip to content

Instantly share code, notes, and snippets.

@axw
Created November 23, 2012 09:00
Show Gist options
  • Save axw/4134627 to your computer and use it in GitHub Desktop.
Save axw/4134627 to your computer and use it in GitHub Desktop.
Locally import a remote package with Pushy
import pushy
import sys
with pushy.connect("ssh:remotehost") as conn:
whatever = conn.modules.whatever
loader = conn.modules.pushy.client.PushyPackageLoader()
packages = loader.load(whatever)
importer = pushy.client.InMemoryImporter(*packages)
sys.meta_path.insert(0, importer)
import whatever
print whatever.hostname()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment