[web2py] redirecting python console output to web browser page

2011-12-29 Thread blackshirt
i have a little programming with web2py, with import some library from python-apt... i want to show output from some command/function from that library to the web page.. Output from that script showing on console, not showing on web page, but only result on return value (True / false) send to web p

[web2py] Re: redirecting python console output to web browser page

2012-01-01 Thread blackshirt
e > > Pseudo-code: > > on controller start > > # create obj > # send all stdout to obj > # return dict with obj content as message or another name to be > processed by a web2py view > > On Dec 30, 12:21 am, blackshirt wrote: > > > > > > > >

[web2py] Re: redirecting python console output to web browser page

2012-01-01 Thread blackshirt
python subprocess module to run the code is a > separate process. The popen function has the ability to capture the > output. > > On Dec 29, 9:21 pm, blackshirt wrote: > > > > > > > > > i have a little programming with web2py, with import some library fro

[web2py] Re: redirecting python console output to web browser page

2012-01-01 Thread blackshirt
Okey Ross, if we using popen, can we doing it for real time (i mean, streaming output) ? On Jan 2, 12:20 am, Ross Peoples wrote: > I use subprocess.Popen a lot to run shell commands from Python. There is no > need for a specific web2py feature. > > This is the method I use whenever I need to call

[web2py] Re: redirecting python console output to web browser page

2012-01-09 Thread blackshirt
like hard to implement.. i want simple approach for them On Jan 3, 3:17 am, Paolo Caruccio wrote: > There is another HTML5 technology to push stream from server to client : > EventSource aka Sent-Server Events (http://dev.w3.org/html5/eventsource/). > Its behaviour is like ajax long polling. > I'

[web2py] Re: redirecting python console output to web browser page

2012-01-09 Thread blackshirt
i'm still pretty newbie for them.. but i'll try to search. On Jan 2, 11:42 pm, Ross Peoples wrote: > Yes, you can, though it's much more difficult to stream it live to a web > page. You would need to use JavaScript (comet or polling) to get the output > as it is generated and display it in the br

[web2py] Re: redirecting python console output to web browser page

2012-01-09 Thread blackshirt
Ross, i think i don't want to use external script, like my_script.py ... On Jan 2, 12:20 am, Ross Peoples wrote: > I use subprocess.Popen a lot to run shell commands from Python. There is no > need for a specific web2py feature. > > This is the method I use whenever I need to call something: > >

[web2py] web2py iteration output

2012-01-09 Thread blackshirt
i have a little problem with web2py. i'm doing simple writing application with web2py. the code look like this for controller : import apt_pkg def important(): apt_pkg.init() cache = apt_pkg.Cache() for pkg in cache.packages: if pkg.essential: return dict(t=pkg) a

[web2py] Re: web2py iteration output

2012-01-09 Thread blackshirt
Thanks Anthony, it was works greatfully On Jan 10, 10:53 am, Anthony wrote: > > import apt_pkg > > def important(): > >     apt_pkg.init() > >     cache = apt_pkg.Cache() > >     for pkg in cache.packages: > >        if pkg.essential: > >            return dict(t=pkg) > > When you call "return" i

[web2py] Output from some controller

2012-01-12 Thread blackshirt
i have some a littel coding with web2py framework.. here is my controller and file : def update(): cache = apt.Cache() progress = apt.progress.TextFetchProgress() res = cache.update(progress) return dict(res = res) in this related view.. {{extend 'layout.html'}} {{=res}} {{pass}} t

[web2py] Re: Output from some controller

2012-01-15 Thread blackshirt
ase I would go with 1. > > On Jan 12, 8:24 pm, blackshirt wrote: > > > > > i have some a littel coding with web2py framework.. > > here is my controller and file : > > > def update(): > >    cache = apt.Cache() > >    progress = apt.progress.TextFetchProgr

[web2py] Re: Output from some controller

2012-01-16 Thread blackshirt
end 'layout.html'}} {{=output}} {{=error}} {{pass}} and you can look output here http://imageshare.web.id/images/48jjun7nv5kbdk95aw71.png like scrambled... how to parse output line by line ?? Thanks again On Jan 17, 2:29 am, Massimo Di Pierro wrote: > On Jan 15, 11:43 pm, blackshirt

[web2py] using PAM to authenticate and verify user

2012-01-16 Thread blackshirt
i have a simply question about using PAM on linux to authenticate user. let's me explain my code. we have a simple controller like this def update(): cache = apt.Cache() progress = apt.progress.TextFetchProgress() res = cache.update(progress) redirect(URL(r=request, c='statistic', f='

[web2py] how we create admin password and placed in parameters_PORTNUM.py file manually

2012-01-24 Thread blackshirt
i just want to know, is it possible to reconstruct password entries on parameters_PORTNUM.py file manually ?? if it possible, how we can build this password manually ?? Thanks