[web2py] How to load processed values in same page as form exists ?

2014-04-13 Thread Ramesh Aj
I have created a form that takes server ip, username and password. I use pexpect to ssh into remote server, run a particular command and get basic data related to that server. I am creating the form using controller and also doing ssh in same controller and returning both form and processed

[web2py] gluon.rocket.SocketTimeout'(Socket timed out before request Error

2014-04-03 Thread Ramesh Aj
The Following code is giving gluon.rocket.SocketTimeout'(Socket timed out before request error {{extend 'layout.html'}} {{import xml.etree.ElementTree as ET}} h1 This is a Stations detail page /h1 {{ filename = xmlfile with open(filename, mode=r) as fp: for line in fp: print line

[web2py] JSON data in HTML web page

2014-04-03 Thread Ramesh Aj
I am reading data from remote machine and converting it into dictionary format like {IP: [192.111.111.111, 222.222.222.222, 333.333.333.333], MAC: [aa:aa:aa:aa, bb:bb:bb:bb, cc:cc:cc:cc], conn: [wireless, wireless, wireless]} I am sending this dictionary to view which is index.html where I

[web2py] Exception in importing pexpect

2014-04-02 Thread Ramesh Aj
I am trying to spawn a shell to remote machine in web2py and I am getting following exception Cannot import module 'pexpect' -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

[web2py] Exception seen for controller in web2py

2014-04-02 Thread Ramesh Aj
I have controller in web2py as below # coding: utf8 # try something like #!/usr/local/python2.7 def index(): import pexpect import sys import time import cgi, cgitb import getpass import urllib3 import elementtree.ElementTree as ET ssh_cmd = 'ssh -t'