Hoping all is well

26 views
Skip to first unread message

Prateek Malhotra

unread,
Jul 2, 2012, 2:17:57 PM7/2/12
to kay-...@googlegroups.com
Feel like the project is stagnating a little. Any update on the py27 branch? I'd like to help if possible.

I'd also like to point out there are thread-unsafe examples given in the KAY docs for defining URL handlers: http://kay-docs.shehas.net/urlmapping.html#adding-your-view

The last example:
from myapp.views import MyClassBasedView
view_func = MyClassBasedView(template_name="myapp/mytemplate.html")

This will keep the handler function in memory and if multiple request are sent to it, with py27 and threadsafe:true, the request object of one request can overwrite the request object of a previous request. This effected my app recently and I had to change it.

Thanks.

Paolo Casciello

unread,
Jul 5, 2012, 11:06:37 AM7/5/12
to kay-...@googlegroups.com
Hi Prateek,

Takashi seems missing. Hope he reply soon. He were about to release the new version.
I'm also spreading the voice on KAY here at EuroPython this week but is difficult since I've to say "try the py27 branch from the repos!" and it isn't much... "professional" :D

Do you know other people using it? What a bout a proposal for takeover/fork?
I'm saying these in the public mailing list 'cause I think all in this project must be open :)

For the problem in documentation, i've fixed some examples too in the py27. Feel free to fix it or maybe i could fix it for you if you don't have setup the environment for testing documentation.


Bye,
  Paolo

Takashi Matsuo

unread,
Jul 5, 2012, 4:57:41 PM7/5/12
to kay-...@googlegroups.com
Hi Prateek,

Thanks for the feedback. I'm going to fix the doc. What your change
looks like BTW?

Paolo,

Sorry about my absence. I'd been spending a crazy days for Google I/O.
I'm going to release 3.0 in a days.

--
Takashi Matsuo
matsuo....@gmail.com
Kay's daddy


2012/7/6 Paolo Casciello <paolo.c...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "kay-users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/kay-users/-/BomiVm-ZDEMJ.
>
> To post to this group, send email to kay-...@googlegroups.com.
> To unsubscribe from this group, send email to
> kay-users+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/kay-users?hl=en.

Paolo Casciello

unread,
Jul 6, 2012, 4:59:51 AM7/6/12
to kay-...@googlegroups.com

On Thursday, July 5, 2012 10:57:41 PM UTC+2, tmatsuo wrote:

Paolo,

Sorry about my absence. I'd been spending a crazy days for Google I/O.
I'm going to release 3.0 in a days.

Yes I folow you on Plus:) IO is an amazing event!!

Before release could you please merge my changes from https://bitbucket.org/xcash/kay-framework ?
Nothing disruptive :) 
or I could merge it on the google code repos if you prefer.


Bye,
 Paolo

 

victorgoh

unread,
Jul 6, 2012, 5:53:46 AM7/6/12
to kay-...@googlegroups.com
Glad to hear Kay 3.0 is coming soon. Keep up the good work!

Paolo Casciello

unread,
Jul 6, 2012, 6:08:28 AM7/6/12
to kay-...@googlegroups.com
to be correct we haven't release the 2.x yet so this is 2 :D

Takashi Matsuo

unread,
Jul 6, 2012, 9:17:04 PM7/6/12
to kay-...@googlegroups.com
Paolo,

I tried to merge it but had a hard time to do it right(in particular,
I saw some changed reverted just by pulling from there).
So, I'll release 3.0.0 without merging it.

However, I'll work on merging it soon. How can I safely merge your change BTW?

--
Takashi Matsuo
matsuo....@gmail.com
Kay's daddy


2012/7/6 Paolo Casciello <paolo.c...@gmail.com>:
>
> --
> You received this message because you are subscribed to the Google Groups
> "kay-users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/kay-users/-/2IIb5ghPARkJ.

Paolo Casciello

unread,
Jul 7, 2012, 5:03:29 AM7/7/12
to kay-...@googlegroups.com
Hi Takashi,

I'ts strange.. I've done it without problems.
Follows are the steps:

...
925 files updated, 0 files merged, 0 files removed, 0 files unresolved

#you may need to clone this via https
xcash@localhost /tmp $ hg clone ssh://h...@bitbucket.org/xcash/kay-framework kay-framework-cash
...
925 files updated, 0 files merged, 0 files removed, 0 files unresolved

in the kay-framework dir (official repo)

hg up py27 to change the branch

xcash@localhost /tmp/kay-framework $ hg pull ../kay-framework-cash

this will pull my modifications

in fact 
xcash@localhost /tmp/kay-framework $ hg heads
changeset:   1194:dfefd886d82d
branch:      py27
tag:         tip
parent:      1193:1277744ab12b
parent:      1181:9690fdac2f6e
user:        Paolo Casciello <paolo.c...@gmail.com>
date:        Sun Mar 04 11:15:56 2012 +0100
summary:     merge up from official

changeset:   1187:bd8a53fc5276
branch:      py27
user:        Takashi Matsuo <tma...@shehas.net>
date:        Fri Jul 06 17:33:21 2012 +0900
summary:     Docs small fix.

then let's merge (some tutorial and docs fixes)

xcash@localhost /tmp/kay-framework $ hg merge
merging docs/source/conf.py
4 files updated, 1 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)

and the commit should work fine.

I've done this right now :)
If you prefer I'll push it directly to google code myself.

Bye,
 Paolo

Takashi Matsuo

unread,
Jul 7, 2012, 8:24:33 AM7/7/12
to kay-...@googlegroups.com
Hi Paolo,

Thanks, I merged it and released a new version!
Apparently I totally forgot how to use mercurial :(

--
Takashi Matsuo
matsuo....@gmail.com
Kay's daddy


2012/7/7 Paolo Casciello <paolo.c...@gmail.com>:
>> > kay-users+...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/kay-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "kay-users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/kay-users/-/cdIObOUhn1UJ.
>
> To post to this group, send email to kay-...@googlegroups.com.
> To unsubscribe from this group, send email to
> kay-users+...@googlegroups.com.

Prateek Malhotra

unread,
Jul 9, 2012, 1:24:24 PM7/9/12
to kay-...@googlegroups.com
instead of defining URL handler's based on classes as shown in the example above, it should be done as follows:

Rule('<url>', endpoint='<endpoint>', view=('path.to.ClassBasedViewHandler', (), {}))


Thank you,
Prateek

Paolo Casciello

unread,
Jul 13, 2012, 11:50:53 AM7/13/12
to kay-...@googlegroups.com
Prateek I will fix docs but since I never used that style of defining routing (i don't like it, i prefer the new clearer way) I don't know how it works. (and still after reading the docs I don't know how it works! :D )

Why don't you migrate to the new style of routing?

> For more options, visit this group at
> http://groups.google.com/group/kay-users?hl=en.

--
You received this message because you are subscribed to the Google Groups "kay-users" group.
To post to this group, send email to kay-...@googlegroups.com.
To unsubscribe from this group, send email to kay-users+unsubscribe@googlegroups.com.

Prateek Malhotra

unread,
Jul 16, 2012, 11:50:19 AM7/16/12
to kay-...@googlegroups.com
Is this not the new style of routing?

view_groups = [
  ViewGroup(
    Rule('/', endpoint='index', view=('app_name.listings.ListingsHandler', (), {})),
    Rule('/<username>', endpoint='index'), 
 ...
The only difference between what the doc shows and what I'm doing is that I use class-based handlers versus functions. That is, my ListingsHandler looks like:

class ListingsHandler(<class derived from kay.handlers.BaseHandler>):    
    def get_template(self):
        ...
    
    def get_headers(self):
        if self.request.method == 'GET' and not getattr(self, 'no_cache', False):
            return {'Cache-Control': 'public,max-age=60'}
        return {}
    
    def get_data(self):
        data = super(ListingsHandler, self).get_data()
        ...
        return data
    @ndb.toplevel
    def get(self, username = '@'):
        ...
 
I am able to build global logic to my controller by using this method

I hope this clarifies what I am doing. If you see something I am doing incorrectly, please point it out and help me!

Thank you,
Prateek

Paolo Casciello

unread,
Jul 17, 2012, 11:39:10 AM7/17/12
to kay-...@googlegroups.com
You're right. My fault :)

The problem is that in the docs there isn't the section on using custom handlers in the new style. Your implementation seems perfect so I will update docs accordingly. :)

Thanks Prateek!

Bye,
 Paolo
Reply all
Reply to author
Forward
0 new messages