diff --git a/wiki/macro/TerminalSsh.py b/wiki/macro/TerminalSsh.py new file mode 100644 index 00000000..0adf3bd0 --- /dev/null +++ b/wiki/macro/TerminalSsh.py @@ -0,0 +1,49 @@ +Dependencies = ["Time"] + +class ssh: + settings = { + 'protocol' : "ssh2", + 'server' : 'ssh.crans.org', + 'port' : '22', + "auth-method" : "keyboard-interactive", + "bg-color" : "black", + "fg-color" : "white", + "cursor-color" : "yellow", + } + + appletLocation = "https://ssh.crans.org/mindterm.jar" + + def parseArgs(self, args): + argList = args.split(u',') + + for anArg in argList: + try: + key = anArg.split(u'=')[0] + value = anArg.split(u'=')[1] + self.settings[key] = value + except:pass + + def formatParams(self): + html = [] + for key, value in self.settings.items(): + html.append(u'' % (key, value)) + return u'\n'.join(html) + + def __init__(self, args): + self.parseArgs(args) + + def run(self): + html = [ + u'

', + u'' % self.appletLocation, + self.formatParams(), + u'', + u'

', + ] + return u'\n'.join(html) + +def execute(macro, args): +# return macro.formatter.text("I got these args from a macro %s: %s" % +# (str(macro), args)) + o = ssh(args) + return o.run() \ No newline at end of file