Browse Source

keep track of the last few requests that we have processed, we now

don't need to print out the browse lines to log, we can just take
a peak at the ring buffer to see what's happened...

[git-p4: depot-paths = "//depot/": change = 848]
v0.3
John-Mark Gurney 19 years ago
parent
commit
35d5e9a3b4
1 changed files with 19 additions and 7 deletions
  1. +19
    -7
      ContentDirectory.py

+ 19
- 7
ContentDirectory.py View File

@@ -22,6 +22,8 @@
# traceback.print_exc(file = log.logfile) # traceback.print_exc(file = log.logfile)
# #


reqname = 'requests'

from twisted.python import log from twisted.python import log
from twisted.web import resource, static from twisted.web import resource, static


@@ -32,6 +34,7 @@ from DIDLLite import DIDLElement, Container, Movie, Resource, MusicTrack
from twisted.internet import defer from twisted.internet import defer
from twisted.python import failure from twisted.python import failure


import debug
import traceback import traceback
from urllib import quote from urllib import quote


@@ -136,6 +139,9 @@ class ContentDirectoryControl(UPnPPublisher, dict):
return self.children[item][:] return self.children[item][:]


def __init__(self, title, *args, **kwargs): def __init__(self, title, *args, **kwargs):
log.msg('ringbuf')
debug.insertringbuf(reqname)
print `debug.insertringbuf`
super(ContentDirectoryControl, self).__init__(*args) super(ContentDirectoryControl, self).__init__(*args)
self.webbase = kwargs['webbase'] self.webbase = kwargs['webbase']
self._urlbase = kwargs['urlbase'] self._urlbase = kwargs['urlbase']
@@ -173,10 +179,21 @@ class ContentDirectoryControl(UPnPPublisher, dict):
BrowseFlags = ('BrowseMetaData', 'BrowseDirectChildren') BrowseFlags = ('BrowseMetaData', 'BrowseDirectChildren')


def soap_Browse(self, *args): def soap_Browse(self, *args):
l = {}
log.msg('ringbuf append')
debug.appendnamespace(reqname, l)
l['query'] = 'Browse(ObjectID=%s, BrowseFlags=%s, Filter=%s, ' \
'StartingIndex=%s RequestedCount=%s SortCriteria=%s)' % \
tuple(map(repr, args))

try: try:
return self.thereal_soap_Browse(*args)
ret = self.thereal_soap_Browse(*args)
except defer.Deferred, x: except defer.Deferred, x:
return doRecallgen(x, self.soap_Browse, *args)
ret = doRecallgen(x, self.soap_Browse, *args)

l['response'] = `ret`

return ret


def thereal_soap_Browse(self, *args): def thereal_soap_Browse(self, *args):
"""Required: Incrementally browse the native heirachy of the Content """Required: Incrementally browse the native heirachy of the Content
@@ -223,11 +240,6 @@ class ContentDirectoryControl(UPnPPublisher, dict):


#log.msg('Returning: %s' % result) #log.msg('Returning: %s' % result)


log.msg('Browse(ObjectID=%s, BrowseFlags=%s, Filter=%s, '
'StartingIndex=%s RequestedCount=%s SortCriteria=%s) = %s' %
(`ObjectID`, `BrowseFlag`, `Filter`, `StartingIndex`,
`RequestedCount`, `SortCriteria`, `result`))

return result return result


# Optional actions # Optional actions


Loading…
Cancel
Save