IRC Logs for #circuits-dev Sunday, 2014-01-12

*** Osso has quit IRC01:15
*** qwebirc21028 has joined #circuits-dev10:45
*** Osso has joined #circuits-dev10:45
qwebirc21028Hi again! I have yet another error: It's an error or I'm doing something wrong again? :)10:47
*** Osso has quit IRC10:49
*** spaceone has joined #circuits-dev11:47
*** prologic has joined #circuits-dev11:47
*** qwebirc21028 has quit IRC12:06
*** Osso has joined #circuits-dev12:52
*** Osso has quit IRC14:54
*** qwebirc29653 has joined #circuits-dev15:15
qwebirc29653Hi again! Either I'm doing something wrong, or there is a trouble when using call/wait in @expose'd function:
qwebirc29653Ok, I've managed to get it working using yield instead of return in function with event call, but I can use only handler because I get attribute error when I use self.request inside of function decorated with expose.17:13
*** Osso has joined #circuits-dev19:31
prologicqwebirc29653: hi I don't know who you are :)21:37
prologicyou're obviously using a web-based irc client (maybe off our website)? :)21:37
prologicwith a guest nickname :)21:37
prologicbut to answer your question21:37
prologicqwebirc29653:  couple of things21:38
prologica) You don't need to:21:38
prologicunless you _really_ want to expose / as /index (in your case)21:38
prologicb) you are mixing yield and return21:38
prologicyou can only use one or the other21:38
prologicchange the last line to21:38
prologicyield res21:38
*** Osso has quit IRC22:23
qwebirc29653prologic, I know, you don't know :)23:37
prologicI figured you were the same person in #circuits asking a similar question the rather day :)23:41
qwebirc29653Oh no, I'm uncovered :)23:42
qwebirc29653I've already understood I shouldn't mix yield and return, but I still can't use self.response:
qwebirc29653As temporary workaround I use handler instead of expose.23:45
prologicno you cannot access self.response or self.request23:50
prologicif you use yield in your request handler23:50
prologicit's a known issue (not a bug per say)23:50
prologicyou have to access it via the event object23:51
prologicdef index(self, event, *args, **kwargs):23:51
prologic   request, response = event.args[:2]23:51
prologicAnd as I mentioned before23:51
prologicDon't use @handler to create request handlers23:51
prologicthey won'y be picked up by the default dispatcher23:51
prologicController automatically wrapped methods using @expose which wraps using @handler23:52
prologici.e: there is double wrapping going on23:52
qwebirc29653I know 'bout automatic wrapping and used this solution as _very_ temporary. Again, thanks for solution!23:55

Generated by 2.11.0 by Marius Gedminas - find it at!