FileCache does not seem to work

"[email protected]" <[email protected]>
Newsgroups gmane.comp.mobile.bitpim.devel
Message-ID <[email protected]>
Roger, common.FileCache class does not seem to work.  First, there was the problem of 'os' not being imported, but even with that fixed, there were addtional exceptions which I'm attaching FYI.

-Joe Pham

def statinfo(filename):
    """Returns a simplified version of os.stat results that can be used to tell if a file
    has changed.  The normal structure returned also has things like last access time
    which should not be used to tell if a file has changed."""
    try:
        import os
        s=os.stat(filename)  <-- Line 553
        return (s.st_mode, s.st_ino, s.st_dev, s.st_uid, s.st_gid, s.st_size, s.st_mtime,
                s.st_ctime)
    except:
        raise
        return None


An unexpected exception has occurred.
Please see the help for details on what to do.

Traceback (most recent call last):
  File "E:\Python23\Lib\site-packages\wx\_core.py", line 10673, in <lambda>
    lambda event: event.callable(*event.args, **event.kw) )
  File "E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\gui.py", line 886, in OnPopulateEverythingFromDisk
    self.wallpaperwidget.populate(results)
  File "E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\wallpaper.py", line 290, in populate
    self.OnRefresh()
  File "E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\guiwidgets.py", line 1110, in OnRefresh
    self.aggdisp.UpdateItems()
  File "E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\aggregatedisplay.py", line 372, in UpdateItems
    self.sections=self.datasource.GetSections()
  File "E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\wallpaper.py", line 128, in GetSections
    items=[DisplayItem(self, key, self.mainwindow.wallpaperpath) for key in self._data['wallpaper-index']]
  File "E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\guiwidgets.py", line 1293, in __init__
    self.setvals()
  File "E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\guiwidgets.py", line 1301, in setvals
    self.fileinfo=self.view.GetFileInfo(self.filename)
  File "E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\wallpaper.py", line 274, in GetFileInfo
    return fileinfo.identify_imagefile(filename)
  File "E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\fileinfo.py", line 284, in identify_imagefile
    return thefileinfocache.set(file,ImgFileInfo(fo))
  File "E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\common.py", line 583, in set
    self.items[filename]=statinfo(filename),value
  File "E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\common.py", line 553, in statinfo
    s=os.stat(filename)
TypeError: coercing to Unicode: need string or buffer, type found

Variables by last 8 frames, innermost last

Frame UpdateItems in E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\aggregatedisplay.py at line 372
           self =  <aggregatedisplay.Display; proxy of C++ wxScrolledWindow instance at _40d74401_p

Frame GetSections in E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\wallpaper.py at line 128
           _[1] =  <built-in method append of list object at 0x01978CF0>
           self =  <wallpaper.WallpaperView; proxy of C++ wxPanel instance at _f088da01_p_wxPanel>
            key =  0

Frame __init__ in E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\guiwidgets.py at line 1293
      mediapath =  u'E:\\Documents and Settings\\Joe\\My Documents\\bitpim\\wallpaper'
           self =  <wallpaper.DisplayItem object at 0x01DDD4F0>
            key =  0
           view =  <wallpaper.WallpaperView; proxy of C++ wxPanel instance at _f088da01_p_wxPanel>

Frame setvals in E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\guiwidgets.py at line 1301
             me =  Keys ['name', 'origin']
                   {'origin': 'builtin', 'name': 'Clock1'}
           self =  <wallpaper.DisplayItem object at 0x01DDD4F0>

Frame GetFileInfo in E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\wallpaper.py at line 274
           self =  <wallpaper.WallpaperView; proxy of C++ wxPanel instance at _f088da01_p_wxPanel>
       filename =  u'E:\\Documents and Settings\\Joe\\My Documents\\bitpim\\wallpaper\\Clock1'

Frame identify_imagefile in E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\fileinfo.py at line 284
              v =  None
            obj =  None
       filename =  u'E:\\Documents and Settings\\Joe\\My Documents\\bitpim\\wallpaper\\Clock1'
              f =  <function idimg_PNG at 0x01A220B0>
             fo =  <fileinfo.FailedFile instance at 0x01E868A0>

Frame set in E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\common.py at line 583
           self =  <common.FileCache instance at 0x01A217B0>
          value =  <fileinfo.ImgFileInfo instance at 0x01E868F0>
       filename =  <type 'file'>

Frame statinfo in E:\Documents and Settings\Joe\My Documents\cell_apps\bitpim\common.py at line 557
       filename =  <type 'file'>


______________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/month -visit http://www.netzero.com/surf to sign up today!



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.