diff options
author | Arturo FilastoĢ <hellais@torproject.org> | 2011-08-17 19:38:47 +0200 |
---|---|---|
committer | Arturo FilastoĢ <hellais@torproject.org> | 2011-08-17 19:38:47 +0200 |
commit | e14cf93e2c93e94c00d55d51ffc8ca26e063377c (patch) | |
tree | 3566a2d7eda080fd376d88d274b2af5eb6f3006a /packages/torouter-web/src/tui/controllers/old/wizard.py | |
parent | 4a55d3546be8f0444b12d634ccf01c5a107d46eb (diff) | |
parent | 57e54f969b840546925d16ceceb130a0f3927140 (diff) | |
download | torouter-e14cf93e2c93e94c00d55d51ffc8ca26e063377c.tar.gz torouter-e14cf93e2c93e94c00d55d51ffc8ca26e063377c.zip |
Merge branch 'master' of ssh://git-rw.torproject.org/torouter
Diffstat (limited to 'packages/torouter-web/src/tui/controllers/old/wizard.py')
-rw-r--r-- | packages/torouter-web/src/tui/controllers/old/wizard.py | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/packages/torouter-web/src/tui/controllers/old/wizard.py b/packages/torouter-web/src/tui/controllers/old/wizard.py new file mode 100644 index 0000000..7b82df2 --- /dev/null +++ b/packages/torouter-web/src/tui/controllers/old/wizard.py @@ -0,0 +1,81 @@ +import web + +from web import form +from config import view + +class step: + cur_step = 1 + next_step = 2 + wiztext = [] + wizform = [] + + wiztext.append("Tor Configuration") + wizform.append(form.Form( + form.Textbox('Nickname', + form.notnull, description="Relay Nickname"), + form.Textbox('RelayBandwidthRate', + form.notnull, description="Relay Bandwidth Rate"), + form.Textbox('RelayBandwidthBurst', + form.notnull, description="Relay Bandwidth Burst"), + form.Textbox('ContactInfo', + form.notnull, description="Contact Info"), + form.Textbox('ExitPolicy', + form.notnull, description="Exit Policy"), + form.Button('Next Step') + )) + + wiztext.append("Wireless setup") + wizform.append(form.Form( + form.Textbox('essid', + form.notnull, description="Wireless ESSID"), + form.Textbox('mac', + form.notnull, description="MAC address"), + form.Textbox('whatever', + form.notnull, description="Wireless ESSID"), + form.Button('Next Step') + )) + + wiztext.append("") + wizform.append(form.Form( + form.Textbox('essid', + form.notnull, description="Wireless ESSID"), + form.Textbox('mac', + form.notnull, description="MAC address"), + form.Textbox('whatever', + form.notnull, description="Wireless ESSID"), + form.Button('Next Step') + )) + + wiztext.append("") + wizform.append(form.Form( + form.Textbox('essid', + form.notnull, description="Wireless ESSID"), + form.Textbox('mac', + form.notnull, description="MAC address"), + form.Textbox('whatever', + form.notnull, description="Wireless ESSID"), + form.Button('Next Step') + )) + + def GET(self, step): + if step: + self.cur_step = int(step) + self.next_step = int(step) + 1 + else: + self.cur_step = 1 + self.next_step = 2 + if len(self.wizform) < int(self.cur_step): + return "Done!" + return view.wizard(self.wizform[self.cur_step-1], self.wiztext[self.cur_step-1], self.cur_step, self.next_step) + + def POST(self, step): + x = web.input() + self.cur_step = int(step) + self.next_step = int(step) + 1 + if len(self.wizform) < int(self.cur_step): + return "Done!" + return view.wizard(self.wizform[self.cur_step-1], self.wiztext[self.cur_step-1], self.cur_step, self.next_step) + + + + |