Skip to content

Instantly share code, notes, and snippets.

Created Jan 25, 2012
What would you like to do?
import thor
import sys
class Thor:
def get_host(self):
arg = sys.argv[1]
if arg in Thor.hosts:
return Thor.hosts[arg]
raise KeyError("Unknown host")
## user defined crap
Thor.hosts = {
'foo': '',
'bar': ''
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