Skip to content

Instantly share code, notes, and snippets.

@tantalor
Created January 25, 2012 17:46
Show Gist options
  • Save tantalor/1677548 to your computer and use it in GitHub Desktop.
Save tantalor/1677548 to your computer and use it in GitHub Desktop.
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