macro pour mettre le ssh dans le wiki
darcs-hash:20060411192947-f46e9-0589d409b9de5668f5bfa8a7c712f1941cc3b324.gz
This commit is contained in:
parent
b53c7336fe
commit
7523008509
1 changed files with 49 additions and 0 deletions
49
wiki/macro/TerminalSsh.py
Normal file
49
wiki/macro/TerminalSsh.py
Normal file
|
@ -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'<param name="%s" value="%s">' % (key, value))
|
||||
return u'\n'.join(html)
|
||||
|
||||
def __init__(self, args):
|
||||
self.parseArgs(args)
|
||||
|
||||
def run(self):
|
||||
html = [
|
||||
u'<p>',
|
||||
u'<applet code=com.mindbright.application.MindTerm.class width=667 height=481 archive="%s">' % self.appletLocation,
|
||||
self.formatParams(),
|
||||
u'</applet>',
|
||||
u'</p>',
|
||||
]
|
||||
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()
|
Loading…
Add table
Add a link
Reference in a new issue