From: James E. <mil...@cl...> - 2005-01-28 20:09:48
|
The patch has been applied to my CVS tree. I've gone ahead and updated the example scripts (pending testing when I get ahold of the iFP this evening) > The two names I'm not sure about are the name of the class itself, and isOK. The class name was iFP, which reads fine to me, but is exactly opposite the recommended naming convention which would suggest "Ifp". I didn't touch it, though. I think leaving it alone is best. I read iFP to mean "iRiver flash device" while Ifp reads as "if P". > isOK I renamed to __nonzero__; this means rather than using Cool! Like I've mentioned before I'm still pretty new to python and didn't even know it had that property. That makes a lot more sense. > It has two other small changes. It removes the DeleteDirRecursive function entirely and replaces it with a 'recursive' parameter to rmdir, and the listdir function, if it is not given a callback, returns a list of files in the given directory. These are both fine. Its a much better implementation of returning a list of files than I was looking at. It'll also fit very well into the GUI design I have in my head :-) > The patch doesn't touch the example scripts. If you like it I can send another one which does. I've done it myself. No problem there. I did have one question though: - def WriteData(self,data): + def write_write(self,data): Was that supposed to be write_data to match read_data? If so I'll just change my working copy before I commit it. > Let me know what you think; I have patches lined up for function caching, properties, and a rewrite of the read_*/write_* functions to return a file-like object to use. Go ahead and send them to me and I'll apply them. I am a little confused as to the utility of read and write with file-like objects. I'm assuming that would be for situations where the app generates/decodes the data on the fly? I think the ease of passing (localfile,remotefile) would be used in most cases. I'm not saying that file-like objects shouldn't be there, but I think the filename based ones should remain and the file-like interfaces added. Thanks for your help on this. I'm glad I could provide something useful to the community! Thanks, james |