Commits

Ian Bicking  committed 3657ed3 Merge

Merged in bisque/paste (pull request #11)

Small changes for turbogears

  • Participants
  • Parent commits b3f56e5, edf80ff

Comments (0)

Files changed (3)

File paste/auth/auth_tkt.py

         self.secret = secret
         self.userid = userid
         self.ip = ip
-        self.tokens = ','.join(tokens)
+        if not isinstance(tokens, basestring):
+            tokens = ','.join(tokens)
+        self.tokens = tokens
         self.user_data = user_data
         if time is None:
             self.time = time_mod.time()

File paste/registry.py

         app_iter = None
         reg = environ.setdefault('paste.registry', Registry())
         reg.prepare()
-        if self.streaming:
-            return self.streaming_iter(reg, environ, start_response)
+        #if self.streaming:
+        #    return self.streaming_iter(reg, environ, start_response)
 
         try:
             app_iter = self.application(environ, start_response)
+            #print "REG ", type(app_iter)
+            if isinstance(app_iter, (list, tuple)):
+                #print "DIRECT"
+                return app_iter
+            #print "STREAMING"
+            return self.streaming_iter(app_iter, reg, environ)
+
         except Exception, e:
             # Regardless of if the content is an iterable, generator, list
             # or tuple, we clean-up right now. If its an iterable/generator
 
         return app_iter
 
-    def streaming_iter(self, reg, environ, start_response):
+    def streaming_iter(self, app_iter, reg, environ):
         try:
-            for item in self.application(environ, start_response):
+            for item in app_iter:
                 yield item
         except Exception, e:
             # Regardless of if the content is an iterable, generator, list
+[egg_info]
+tag_build = bisque2
+tag_date = 0
+tag_svn_revision = 0
+
 [aliases]
 distribute = register sdist bdist_egg upload pudge publish
+