Re: Progress when parsing a large file with SAX

2007-02-12 Thread marc . omorain
On Feb 12, 1:21 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Anastasios Hatzis wrote: > > Diez B. Roggisch wrote: Thanks guys! I'll try it out later today and let you know how I get on. -- http://mail.python.org/mailman/listinfo/python-list

Re: Progress when parsing a large file with SAX

2007-02-12 Thread Diez B. Roggisch
Anastasios Hatzis wrote: > Diez B. Roggisch wrote: > > ... > > I got the same problem with large XML as Marc. > > So you deserve also my thanks for the example. :-) > >> class PercentageFile(object): >> >>def __init__(self, filename): >>self.size = os.stat(filename)[6] >>s

Re: Progress when parsing a large file with SAX

2007-02-12 Thread Anastasios Hatzis
Diez B. Roggisch wrote: ... I got the same problem with large XML as Marc. So you deserve also my thanks for the example. :-) > class PercentageFile(object): > >def __init__(self, filename): >self.size = os.stat(filename)[6] >self.delivered = 0 >self.f = file(filena

Re: Progress when parsing a large file with SAX

2007-02-12 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi there, > > I have a 28mb XML file which I parse with SAX. I have some processing > to do in the startElement / endElement callbacks, which slows the > parsing down to about 60 seconds on my machine. > > My application is unresponsive for this time, so I would like t

Progress when parsing a large file with SAX

2007-02-12 Thread marc . omorain
Hi there, I have a 28mb XML file which I parse with SAX. I have some processing to do in the startElement / endElement callbacks, which slows the parsing down to about 60 seconds on my machine. My application is unresponsive for this time, so I would like to show a progress bar. I could show a sp