Browse Source

refactor some code to try to prevent the IndexError that sometimes

happens when removing files.. This hasn't been confirmed to work,
but I believe this will fix it...

[git-p4: depot-paths = "//depot/": change = 800]
v0.3
John-Mark Gurney 18 years ago
parent
commit
93eaac1228
2 changed files with 2 additions and 1 deletions
  1. +1
    -1
      ContentDirectory.py
  2. +1
    -0
      FSStorage.py

+ 1
- 1
ContentDirectory.py View File

@@ -124,7 +124,7 @@ class ContentDirectoryControl(UPnPPublisher, dict):

if BrowseFlag == 'BrowseDirectChildren':
ch = self.getchildren(ObjectID)[StartingIndex: StartingIndex + RequestedCount]
filter(lambda x, s = self, d = didl: d.addItem(s[x.id].checkUpdate()) and None, ch)
filter(lambda x, d = didl: d.addItem(x) and None, filter(lambda x, s = self: s[x.id].checkUpdate(), ch))
else:
didl.addItem(self[ObjectID])



+ 1
- 0
FSStorage.py View File

@@ -39,6 +39,7 @@ class FSObject(object):
if x.errno in (errno.ENOENT, errno.ENOTDIR, errno.EPERM, ):
# We can't access it anymore, delete it
self.cd.delItem(self.id)
return None
else:
raise x



Loading…
Cancel
Save