Re: web status display for long running program

2005-02-25 Thread Peter Hansen
Paul Rubin wrote: "Kamilche" <[EMAIL PROTECTED]> writes: I was inspired to enhance your code, and perform a critical bug-fix. Your code would not have sent large files out to dialup users, because it assumed all data was sent on the 'send' command. I added code to check for the number of bytes sent

Re: web status display for long running program

2005-02-25 Thread Larry Bates
Not exactly on point, but this is what I use in many of my programs to show progress on long running console apps. Larry Bates class progressbarClass: def __init__(self, finalcount, progresschar=None): import sys self.finalcount=finalcount self.blockcount=0 #

Re: web status display for long running program

2005-02-25 Thread Michele Simionato
This is fun, so I will give my solution too (of course, the effort here is to give the shortest solution, not the more robust solution ;). This is the server program, which just counts forever: from threading import Thread from CGIHTTPServer import test import os class Counter(Thread): def r

Re: web status display for long running program

2005-02-25 Thread Simon Wittber
> I was inspired to enhance your code, and perform a critical bug-fix. > Your code would not have sent large files out to dialup users, because > it assumed all data was sent on the 'send' command. I added code to > check for the number of bytes sent, and loop until it's all gone. Another solutio

Re: web status display for long running program

2005-02-24 Thread Paul Rubin
"Kamilche" <[EMAIL PROTECTED]> writes: > I was inspired to enhance your code, and perform a critical bug-fix. > Your code would not have sent large files out to dialup users, because > it assumed all data was sent on the 'send' command. I added code to > check for the number of bytes sent, and loop

Re: web status display for long running program

2005-02-24 Thread Kamilche
Cute! Thanks for posting that. I too like the 'web interface' concept, it has made SmoothWall a pleasure to use, even on older machines. I was inspired to enhance your code, and perform a critical bug-fix. Your code would not have sent large files out to dialup users, because it assumed all data w

Re: web status display for long running program

2005-02-24 Thread Paul Rubin
[EMAIL PROTECTED] (Brian Roberts) writes: > - I don't want to embed a full web server into the application or > require any special PC setup. That's not a big deal, just use the standard library's http server class. > - I think I know how to listen on a socket, but not sure how to send > stuff to

Re: web status display for long running program

2005-02-24 Thread Peter Hansen
Brian Roberts wrote: I have a command line Python program ... I think an optional web page would be convenient interface. The Python program would listen on some port, and if queried (by me browsing to localhost:12345 for example) would return a pretty status display. Hitting reload would update

Re: web status display for long running program

2005-02-24 Thread John Lenton
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brian Roberts wrote: | I have a command line Python program that sometimes takes a bit | (several minutes) to run. I want to provide an optional method for an | impatient user (me!) to check the status of the program. The type and | amount of status i

web status display for long running program

2005-02-24 Thread Brian Roberts
I have a command line Python program that sometimes takes a bit (several minutes) to run. I want to provide an optional method for an impatient user (me!) to check the status of the program. The type and amount of status information doesn't fit nicely into a --verbose or logger -- either too litt