weird exception : AttributeError: 'module' object has no attribute 'logException'
I am running a script (summary.py) which is calling the method logException in another module ( pytool). Yesterday, ard 18:50, all of a sudden summary.py was throwing the exception : AttributeError: 'module' object has no attribute 'logException' What I did to fix it was to delete the compiled version of the pytool and run again. And it worked again. I am now trying to understand what happened, working with the network admin to see who modified the direcory where pytool is stored. But do you have any idea of what could have happened? All the imports are working, but no method could be called on the compiled files. Thanks for your help, N. -- http://mail.python.org/mailman/listinfo/python-list
PIL and solaris
Hi all, I am trying to install PIL with python 2.3 on solaris X86, but I get this error message : building '_imaging' extension creating build/temp.solaris-2.10-i86pc-2.3 creating build/temp.solaris-2.10-i86pc-2.3/libImaging /sgnome/tools/x86-solaris/forte/SOS8/SUNWspro/bin/cc -i -xO4 -xspace -xstrconst -xpentium -mr -DANSICPP -D__STDC_VERSION__=199409L -DNDEBUG -O -DHAVE_LIBJPEG -DHAVE_LIBZ -I/usr/sfw/include/freetype2 -IlibImaging -I/usr/sfw/include -I/usr/local/include -I/usr/include -I/usr/sfw/include/python2.3 -c libImaging/Antialias.c -o build/temp.solaris-2.10-i86pc-2.3/libImaging/Antialias.o unable to execute /sgnome/tools/x86-solaris/forte/SOS8/SUNWspro/bin/cc: No such file or directory error: command '/sgnome/tools/x86-solaris/forte/SOS8/SUNWspro/bin/cc' failed with exit status 1 [EMAIL PROTECTED] # pwd /export/home/lmtansu/Imaging-1.1.6b1 It works fine with python 2.2 however Do you have any recommendation? Advices? -- http://mail.python.org/mailman/listinfo/python-list
pass parameters in SPYCE
Hi all, I started to use the so good spyce server. I manage to do all the basics, however, I still block on one problem : How can I pass parameters to a spy page : example I have an index page : link1 link2 link3 link4 I want all theses html links to point to process.spy with the value of the link as parameter ( equivalent to call process.spy -link1 ). Is this feasible with html links or I have to use forms and replace my links with buttons? Thank you for your help NVk -- http://mail.python.org/mailman/listinfo/python-list
Re: xml aggregator
thanks a lot for the code. It was not working the first time (do not recognize item and existing_time -- i changed item by r[-1] and existing_time by existing_equip). however, it is not producing the result i expected, as in it doesn't group by same category the elements, it creates a new block of xml results - LINK id=23 - EQUIPMENT id=jr2 - TIMESTAMP id=3pm datamy first value/data /TIMESTAMP /EQUIPMENT /LINK - LINK id=23 - EQUIPMENT id=jr1 - TIMESTAMP id=3pm datamy second value/data /TIMESTAMP /EQUIPMENT /LINK - LINK id=23 - EQUIPMENT id=jr2 - TIMESTAMP id=3pm datamy third value/data /TIMESTAMP /EQUIPMENT /LINK - LINK id=24 - EQUIPMENT id=jr2 - TIMESTAMP id=3pm datamy fourth value/data /TIMESTAMP /EQUIPMENT /LINK - LINK id=25 - EQUIPMENT id=jr2 - TIMESTAMP id=3pm datamy fifth value/data /TIMESTAMP /EQUIPMENT /LINK - LINK id=25 EQUIPMENT id=jr2 TIMESTAMP id=4pm datamy sixth value/data /TIMESTAMP /EQUIPMENT /LINK /results The idea behind all that is : i want to create an xml file that'll have a XSL instructions. The xsl will sort the entries and display something like : Route 23: *jr1 *3pm value value value *5pm value value *jr2 *3pm value value value *5pm value value Route 29 *jr1 *3pm value value value *5pm value value *jr2 *3pm value value value *5pm value value I know this is feasible with XSL2 , but i need something compatible with quite old browser, and XSL2 is not even working on my comp( i could upgrade but i cannot ask all the users to do so). That's why I thought rearranging the xml would do it. Do you have other idea? Do u think it is the best choice? More information abt the application I am writing : i am parsing a feed, extracting some data and producing reports. the application is running on spyce, so i don't have to produce a file in output, just print the xml to the screen and it is automatically wrting to the html page we view. Thanks again for your help. Gerard Flanagan wrote: Gerard Flanagan wrote: kepioo wrote: Hi all, I am trying to write an xml aggregator, but so far, i've been failing miserably. what i want to do : i have entries, in a list format :[[key1,value],[key2,value],[ key3,value]], value] example : [[route,23],[equip,jr2],[time,3pm]],my first value] [[route,23],[equip,jr1],[time,3pm]],my second value] [[route,23],[equip,jr2],[time,3pm]],my third value] [[route,24],[equip,jr2],[time,3pm]],my fourth value] [[route,25],[equip,jr2],[time,3pm]],'my fifth value] [snip example data] If anyone has an idea of implemetation or any code ( i was trying with ElementTree... (You should have posted the code you tried) The code below might help (though you should test it more than I have). The 'findall' function comes from here: http://gflanagan.net/site/python/elementfilter/elementfilter.py it's not the elementtree one. Sorry, elementfilter.py was a bit broken - fixed now. Use the current one and change the code I posted to: [...] existing_route = findall(results, [EMAIL PROTECTED] % routeid) #changed line if existing_route: route = existing_route[0] existing_equip = findall(route, [EMAIL PROTECTED]'%s'] % equipid) if existing_equip: [...] ie. don't quote the route id since it's numeric. Gerard -- http://mail.python.org/mailman/listinfo/python-list
Re: xml aggregator
Thank you so much, it works and it rocks ! bad thing i need ot figure out is why mozilla cannot parse my xsl sheet, but it works in IE ( most of my users are using IE) so the module u wrote is to top up element tree with Xpath capabilities, is it? Does the new element tree does that? which one is the most appropriate? btw, are u french? Regards, Nassim -- http://mail.python.org/mailman/listinfo/python-list
xml aggregator
Hi all, I am trying to write an xml aggregator, but so far, i've been failing miserably. what i want to do : i have entries, in a list format :[[key1,value],[key2,value],[ key3,value]], value] example : [[route,23],[equip,jr2],[time,3pm]],my first value] [[route,23],[equip,jr1],[time,3pm]],my second value] [[route,23],[equip,jr2],[time,3pm]],my third value] [[route,24],[equip,jr2],[time,3pm]],my fourth value] [[route,25],[equip,jr2],[time,3pm]],'my fifth value] the tree i want in the end would be : results route id=23 equip id=jr2 time id=3pm datamy first value/data datamy third value/data /time /equip equip id=jr1 time id=3pm datamy second value/data /time /equip route id=24 equip id=jr2 time id=3pm datamy fourthvalue/data /time /equip route id=25 equip id=jr2 time id=3pm datamy fifth value/data /time /equip /results If anyone has an idea of implemetation or any code ( i was trying with ElementTree... thank you so much -- http://mail.python.org/mailman/listinfo/python-list
How to access the content of notepad with Python?
Hi, I have a software running on my computer that really looks like notepad ( same interface, different name). I need to write a script that will capture the content of this software -- the text written inside. Is it possible using win32 libs? any clue? Thanks! -- http://mail.python.org/mailman/listinfo/python-list
Re: fnmatch on filename (without specific extension)
i agree with you, it is better to find by ourself. i managed to do it, but i left the code at work. i used the re module , using a re.match(Results Log) and a re.search(date) with a function to find the date og the day with the appropriate format. Is it ok to use re for file names? or fnmatch is more efficient? thanks anyway! Nassim -- http://mail.python.org/mailman/listinfo/python-list
fnmatch on filename (without specific extension)
Hi, I have some files in a directory : Results Log, 11;21AM, Apr 09 2006.txt Results Log, 11;21AM, Apr 08 2006.txt Results Log, 03;59AM, Apr 07 2006.txt otherfile1.txt otherfile2.txt ... I'd like to copy all the Results Log file, whatever the hour but with a specific day. For instance, today ( 9th april), the script should copy the first file : Results Log, 11;21AM, Apr 09 2006.txt Any idea, help? Regards, -- http://mail.python.org/mailman/listinfo/python-list
looking for atomixlib
Hi all, I am looking for atomixlib 0.3.0. Previously it could be downloaded on Sylvain webpage ( http://www.defuze.org/oss/atomixlib/) but as explained on the webpage : Well the hard-drive of the server hosting my data (blog, projects and mails) died last Sunday. It would not have affected me that much except that there was no backup whatsoever. :S Does anyone have a copy of atomixlib? Regards, -- http://mail.python.org/mailman/listinfo/python-list
Re: SAX/Python : read an xml from the end to the top
Hi Diez, thank you for your answer. Let me give you more background on the project. The input xml I am parsing is always well formed. It is coming out from another application that append to this xml. I didn't see the source code of the application, but i know that it is not re-writing the whole xml. I thinnk it is just removing the last root element, adding the new tags and writing again the /root tag. We don't want to create new output files for every entry ( each entry is an event, and we have approximativaly 5 events per minute). So I have to stick with this xml input file. I guess, i will parse it till I find the last reported event and update the output xml from there, reporting only the events I am interested inI hope SAX won't take too much time to do all this...(let's say 1 event = 10 tags, 5 events/minutes, xml file running for 1 month -- 5400 000 opening tags)... What do you think? -- http://mail.python.org/mailman/listinfo/python-list
Re: SAX/Python : read an xml from the end to the top
Thanks Diez for your suggestion, I'll look around to find out more about the seek function ( i learnt python 2 weeks ago and I do not have a programmer background, but so far, I am doing well). Peter, I cannot really process as your advice : it is not that stereotypical entrieswe built a data structure for the xml and we report various types of events, always under the same format but with different contents types. The script i am writing aims at picking only special events ( identified by a route tag and an information tag). Anyway, thank you for your advices!! -- http://mail.python.org/mailman/listinfo/python-list
Re: SAX/Python : read an xml from the end to the top
An example ( i changed the content to make it easier) : ### input file 3 root case TimeStamp Date=Mon Feb 20 19:40:28 SGT 2006 Messagefruits/Message Elements Element name=apple5/Element Element name=banana10/Element Element name=peach25/Element /Elements /TimeStamp /case case TimeStamp Date=Mon Feb 20 19:45:28 SGT 2006 Messagenames/Message Elements Element name=CEOvincent/Element Element name=AnalysitRobert/Element /Elements /TimeStamp /case case TimeStamp Date=Mon Feb 20 19:50:28 SGT 2006 Messageopen the car/Message /TimeStamp /case case TimeStamp Date=Mon Feb 20 19:55:28 SGT 2006 Messagefruits/Message Elements Element name=peach25/Element Element name=apple8/Element Element name=cherry120/Element /Elements /TimeStamp /case /root ##3 The script I want to write has to track any change in the input file(what we want to track are parameters in the script. Here for instance, the number of apple and cherry). The ouput file for this example would be ( we write it as a stream): ### OutPut file # track case TimeStamp Date=Mon Feb 20 19:40:28 SGT 2006 Messagefruits/Message Elements Element name=apple5/Element /Elements /TimeStamp /case case TimeStamp Date=Mon Feb 20 19:55:28 SGT 2006 Messagefruits/Message Elements Element name=apple8/Element /Elements /TimeStamp /case case TimeStamp Date=Mon Feb 20 19:55:28 SGT 2006 Messagefruits/Message Elements Element name=cherry120/Element /Elements /TimeStamp /case /track 3 The input file keeps being generated. The ouput file is generated on request. Both are streamed based : we happend to the end of the file. -- http://mail.python.org/mailman/listinfo/python-list
Re: SAX/Python : read an xml from the end to the top
An example ( i changed the content to make it easier) : ### input file 3 root case TimeStamp Date=Mon Feb 20 19:40:28 SGT 2006 Messagefruits/Message Elements Element name=apple5/Element Element name=banana10/Element Element name=peach25/Element /Elements /TimeStamp /case case TimeStamp Date=Mon Feb 20 19:45:28 SGT 2006 Messagenames/Message Elements Element name=CEOvincent/Element Element name=AnalysitRobert/Element /Elements /TimeStamp /case case TimeStamp Date=Mon Feb 20 19:50:28 SGT 2006 Messageopen the car/Message /TimeStamp /case case TimeStamp Date=Mon Feb 20 19:55:28 SGT 2006 Messagefruits/Message Elements Element name=peach25/Element Element name=apple8/Element Element name=cherry120/Element /Elements /TimeStamp /case /root ##3 The script I want to write has to track any change in the input file(what we want to track are parameters in the script. Here for instance, the number of apple and cherry). The ouput file for this example would be ( we write it as a stream): ### OutPut file # track case TimeStamp Date=Mon Feb 20 19:40:28 SGT 2006 Messagefruits/Message Elements Element name=apple5/Element /Elements /TimeStamp /case case TimeStamp Date=Mon Feb 20 19:55:28 SGT 2006 Messagefruits/Message Elements Element name=apple8/Element /Elements /TimeStamp /case case TimeStamp Date=Mon Feb 20 19:55:28 SGT 2006 Messagefruits/Message Elements Element name=cherry120/Element /Elements /TimeStamp /case /track 3 The input file keeps being generated. The ouput file is generated on request. Both are streamed based : we happend to the end of the file. Any suggestion? -- http://mail.python.org/mailman/listinfo/python-list
SAX/Python : read an xml from the end to the top
I currently have an xml input file containing lots of data. My objectiv is to write a script that reports in another xml file only the data I am interested in. Doing this is really easy using SAX. The input file is continuously updated. However, the other xml file should be updated only on request. Everytime we run the script, we track the new elements in the input file and report them in the output file. My idea was to : _ detect in the output file the last event reported _ read the input file from the end _ report all the new events ( since the last time the script was run). Question : IS it possible to read an XML file and process it from the end to the beginning, using SAX -- http://mail.python.org/mailman/listinfo/python-list