Created
November 23, 2012 09:00
-
-
Save axw/4134627 to your computer and use it in GitHub Desktop.
Locally import a remote package with Pushy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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