Skip to content

Instantly share code, notes, and snippets.

@tantalor tantalor/ssh.py
Created Jan 25, 2012

Embed
What would you like to do?
import thor
thor.ssh()
import sys
class Thor:
def get_host(self):
arg = sys.argv[1]
if arg in Thor.hosts:
return Thor.hosts[arg]
else:
raise KeyError("Unknown host")
## user defined crap
Thor.hosts = {
'foo': 'foo.example.com',
'bar': 'bar.example.com'
}
class ssh(Thor):
def __init__(self):
host = self.get_host()
print "host is %s" % host
print "implement me"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.