*** fsufitch has quit IRC | 01:31 | |
*** fsufitch has joined #schooltool | 01:34 | |
*** didymo has quit IRC | 02:40 | |
*** eldar has left #schooltool | 03:41 | |
*** didymo has joined #schooltool | 06:00 | |
*** fsufitch has quit IRC | 06:40 | |
*** subir has joined #schooltool | 07:43 | |
*** subir has quit IRC | 10:10 | |
*** subir has joined #schooltool | 11:18 | |
*** didymo has quit IRC | 12:52 | |
*** ignas has joined #schooltool | 13:35 | |
*** eldar has joined #schooltool | 15:29 | |
*** alga has joined #SchoolTool | 15:41 | |
*** subir has quit IRC | 15:45 | |
eldar | ignas: hey ayt? | 16:55 |
---|---|---|
ignas | hi | 16:56 |
eldar | i can't get my evolve script to actually do the evolution in cando | 16:56 |
eldar | i made a new evolve7.py | 16:56 |
eldar | and increased the generation number in the __init__.py | 16:56 |
eldar | to 7 | 16:56 |
eldar | and just started the server, assuming it would try to evolve | 16:56 |
eldar | did i miss a step? | 16:56 |
ignas | hmm | 17:24 |
ignas | a sec | 17:24 |
ignas | sorry, got distracted by a search of a lost wallet | 17:25 |
ignas | (not mine) | 17:25 |
ignas | hmm | 17:25 |
ignas | do you have application control | 17:25 |
ignas | in your navigation menu? | 17:25 |
ignas | eldar: ? | 17:34 |
eldar | application control? | 17:50 |
eldar | you mean i need devmode or something? | 17:50 |
ignas | is it there | 17:52 |
ignas | it is in new schooltool | 17:52 |
ignas | and i think it's not devmode | 17:52 |
ignas | if it's not there - you are probably using a release schooltool | 17:53 |
ignas | and we'll have to go in another way | 17:53 |
eldar | alright let me see | 17:54 |
eldar | ignas: yup i have application control | 17:56 |
eldar | oooh evolve button | 17:56 |
ignas | not just it | 17:57 |
ignas | the important part is the number | 17:57 |
ignas | which generation is it in | 17:57 |
ignas | at the moment | 17:57 |
ignas | so you know if it evolved successfully | 17:57 |
eldar | it says it's 6 | 17:57 |
eldar | i hit the evolve and it tried to evolve | 17:58 |
eldar | which is good | 17:58 |
eldar | now i can fix my evolve script | 17:58 |
ignas | did it evovle? | 17:58 |
eldar | thanks :) | 17:58 |
ignas | or is it showing an exception | 17:58 |
ignas | np | 17:58 |
eldar | exception | 17:58 |
eldar | can i not create a new container in the evolve script? | 17:59 |
ignas | you should be able to | 17:59 |
eldar | i said app['messageboxes'] = MessageBoxContainer() | 18:00 |
eldar | and it's throwing me key error | 18:00 |
ignas | lisppaste5: url | 18:00 |
lisppaste5 | To use the lisppaste bot, visit http://paste.lisp.org/new/schooltool and enter your paste. | 18:00 |
ignas | :) | 18:00 |
eldar | i gotta switch irc to linux, brb | 18:01 |
*** eldar has quit IRC | 18:01 | |
*** eldar has joined #schooltool | 18:03 | |
lisppaste5 | eldar pasted "evolve" at http://paste.lisp.org/display/53505 | 18:03 |
ignas | the exception please ;) | 18:04 |
lisppaste5 | eldar pasted "exception" at http://paste.lisp.org/display/53506 | 18:05 |
eldar | if you just search for "evolve7" | 18:05 |
eldar | it'll take you to the line it's complaining about | 18:05 |
ignas | i can see it | 18:06 |
ignas | i think i know what is wrong | 18:06 |
ignas | i am thinking how to fix it | 18:06 |
eldar | enlighten me please :) | 18:06 |
ignas | because of some reason MessageBoxContainer can't get adapted to IKeyReference | 18:08 |
eldar | hmmm that is interesting | 18:09 |
eldar | considering that MessageBoxContainer is just JournalContainer renamed | 18:09 |
ignas | and that gives you an error when system tries getting intid for the object | 18:09 |
ignas | can you print the result of | 18:10 |
ignas | getAllUtilitiesRegisteredFor(ICatalog, MessageBoxContainer()): | 18:10 |
ignas | it should be a list of utilities | 18:11 |
eldar | hehe lemme shove a pdb in my evolve script | 18:11 |
ignas | and post me the class definition of the MessageBoxContainer | 18:12 |
lisppaste5 | eldar pasted "MessageBoxContainer" at http://paste.lisp.org/display/53507 | 18:14 |
eldar | there's the definition, i'm looking for the location of getallutilities | 18:14 |
eldar | so i can import it | 18:14 |
ignas | from zope.component import getAllUtilitiesRegisteredFor | 18:15 |
ignas | the fix that would work is something like app._p_jar.add(message_box_container) before adding it to the container | 18:16 |
eldar | _p_jar? | 18:16 |
eldar | what's that | 18:16 |
ignas | zodb connection | 18:17 |
eldar | ok so getAllUtilities returns an empty list | 18:18 |
ignas | i see, well - that does not matter too much | 18:18 |
ignas | you must do the _p_jar thingie | 18:19 |
ignas | and before you do that | 18:19 |
ignas | could you please het a more unique key | 18:19 |
ignas | for your container please | 18:19 |
ignas | like cando.messages.message_box_container | 18:19 |
ignas | or something like that | 18:19 |
eldar | instead of just messageboxes? | 18:19 |
eldar | alright | 18:19 |
ignas | yes | 18:19 |
ignas | a new convention | 18:19 |
ignas | it should have been like 'schooltool.attendance' , 'schooltool.persons' and etc. | 18:20 |
ignas | to avoid conflicts in the future | 18:20 |
eldar | i see | 18:20 |
ignas | like with 'journal' that was one thing for cando and a different thing for schooltool | 18:20 |
lisppaste5 | eldar pasted "evolve_edit" at http://paste.lisp.org/display/53508 | 18:25 |
eldar | ok so that's what i changed | 18:25 |
eldar | i tried evolve, i got essentially the same error | 18:25 |
lisppaste5 | eldar pasted "essentially_same_error" at http://paste.lisp.org/display/53509 | 18:26 |
eldar | ignas, any ideas? | 18:31 |
ignas | a second | 18:37 |
ignas | hmm | 18:39 |
ignas | and adapting of the container to zope.app.keyreference.interfaces.IKeyReference | 18:41 |
ignas | gives you what? | 18:41 |
eldar | not yet | 18:43 |
eldar | exception | 18:43 |
eldar | never understood those | 18:43 |
*** jfluhmann has joined #schooltool | 18:45 | |
ignas | hmm | 18:46 |
ignas | i'd try to adapt the object to ZODB.interfaces.IConnection | 18:46 |
*** jfluhmann has left #schooltool | 18:46 | |
ignas | and step into it to see why it is not giving you a connection | 18:46 |
ignas | even though you have added the object to the connection | 18:46 |
eldar | how do i step into a command i type? | 18:47 |
eldar | while in pdb | 18:48 |
eldar | or should i write that in the file and then launch pdb? | 18:48 |
ignas | i'd do that | 18:49 |
ignas | launch the pdb before the adaptation | 18:49 |
eldar | uhh it doesn't give me all that many details | 18:51 |
eldar | when i hit n on that step | 18:51 |
eldar | it just throws the exception and takes me to zope generations.py | 18:52 |
lisppaste5 | eldar pasted "pdb" at http://paste.lisp.org/display/53514 | 18:53 |
ignas | not n | 18:54 |
ignas | "s" | 18:54 |
ignas | step into | 18:54 |
ignas | not next line | 18:54 |
eldar | ah i see | 18:54 |
ignas | mmm | 18:54 |
ignas | but it could not find the adapter at all :/ | 18:54 |
ignas | emm | 18:55 |
ignas | hmm | 18:55 |
ignas | very interesting i might say | 18:56 |
ignas | IConnection adapter looks for _p_jar on the object | 18:56 |
ignas | if it can't find it | 18:56 |
ignas | (could you see if it's there) | 18:56 |
ignas | and if it can't - it looks for __parent__ | 18:57 |
lisppaste5 | eldar pasted "debug" at http://paste.lisp.org/display/53516 | 18:57 |
eldar | there is a __parent___ | 18:58 |
eldar | but it's None | 18:58 |
ignas | could you replace the __parent__ thing | 18:58 |
ignas | with a container.__parent__ = app | 18:58 |
ignas | before adding it | 18:58 |
eldar | still couldn't adapt | 18:59 |
ignas | emm very strange | 19:00 |
ignas | call zope.app.keyreference.persistent.connectionOfPersistent | 19:00 |
ignas | on the object | 19:00 |
eldar | wait it worked | 19:00 |
eldar | i think | 19:00 |
ignas | (it's a 1 argument function) | 19:00 |
eldar | nvmd | 19:01 |
eldar | after the __parent__ change it now throws | 19:01 |
eldar | TypeError: ('Only first-class persistent objects may be added to a Connection.', <Connection at 0906e3ac>) | 19:01 |
eldar | so calling that will fix it? | 19:02 |
eldar | do i have to do: message_box_container = connectionOfPersistent(message_box_container) | 19:02 |
eldar | or just : connectionOfPersistent(message_box_container) | 19:03 |
eldar | well i tried both, i get the same exception | 19:05 |
eldar | this is weird | 19:05 |
eldar | i thought i'd just be able to assign a new container easily | 19:05 |
ignas | no | 19:05 |
ignas | hmm | 19:06 |
ignas | how does the code look now? | 19:06 |
lisppaste5 | eldar pasted "evolve7" at http://paste.lisp.org/display/53519 | 19:06 |
ignas | message_box_container = connectionOfPersistent(message_box_container) is not needed | 19:07 |
ignas | it does not make sense actually | 19:07 |
ignas | the function was to test the adapter | 19:07 |
ignas | message_box_container = IConnection(message_box_container) is not needed too | 19:07 |
ignas | app._p_jar.add(message_box_container) should be removed | 19:07 |
eldar | ok | 19:07 |
eldar | ok | 19:07 |
eldar | now we're back at the same key error | 19:10 |
ignas | hmm | 19:11 |
ignas | key error is because IKeyReferenceAdapter fails to work on the object | 19:12 |
ignas | and it fails to work because it seems that IConnection adapter does not work on the object | 19:12 |
ignas | and i can't really understand why "connectionOfPersistent" would be failing | 19:13 |
ignas | with __parent__ set | 19:13 |
eldar | has this been done in schooltool? | 19:13 |
ignas | no | 19:13 |
ignas | it's Zope3 code | 19:13 |
eldar | adding new containers to root lvl app | 19:13 |
eldar | i see | 19:13 |
eldar | no, i don't mean the connectionOfPersistent | 19:14 |
ignas | it's the persistent dict that is at fault | 19:14 |
ignas | i mean - btrees don't have these problems | 19:14 |
ignas | but app is a sample container | 19:14 |
ignas | based on a persistent dict | 19:14 |
eldar | i see | 19:14 |
ignas | and it seems that it's behaving differently from things like PersonContainer | 19:14 |
ignas | can you try "connectionOfPersistent" on the object and see if it returns anything | 19:15 |
ignas | just plain if connectionOfPersistent(object): print "YES" | 19:15 |
ignas | or something on that level | 19:15 |
eldar | yes | 19:15 |
eldar | it returns yes o.O | 19:16 |
ignas | ok | 19:17 |
ignas | and what does zope.app.keyreference.persistent.KeyReferenceToPersistent(object) | 19:17 |
ignas | return ? | 19:17 |
eldar | <zope.app.keyreference.persistent.KeyReferenceToPersistent object at 0x99a230c> | 19:18 |
eldar | that's what it returns when i do that on message_box_container | 19:19 |
ignas | and hash() on it? | 19:19 |
eldar | on the object that I get? | 19:19 |
ignas | yes | 19:19 |
eldar | 1358526734 | 19:19 |
ignas | emm | 19:20 |
ignas | weird | 19:20 |
ignas | and what does IKeyReference(object) return? | 19:20 |
eldar | <zope.app.keyreference.persistent.KeyReferenceToPersistent object at 0x99a258c> | 19:21 |
ignas | emm | 19:22 |
ignas | funny | 19:22 |
ignas | and adding of the object to app still fails? | 19:22 |
eldar | yup, same key error | 19:23 |
ignas | can you add pdb in zope.app.intid.addIntIdSubscriber | 19:23 |
ignas | and try running the thing again | 19:23 |
eldar | just at the top of the function? | 19:25 |
eldar | ok i added it in the beginning of definition | 19:26 |
eldar | the pdb activated when i started the server | 19:27 |
eldar | should i just skip through that one? | 19:27 |
ignas | no | 19:27 |
ignas | what's the "ob"? | 19:28 |
eldar | <cando.message.message.MessageBoxContainer object at 0xa70e36c> | 19:28 |
ignas | what's it's __parent__ ? | 19:28 |
ignas | what is returned by IKeyReference(ob, None) ? | 19:29 |
eldar | schooltool app object | 19:29 |
eldar | <zope.app.keyreference.persistent.KeyReferenceToPersistent object at 0x908218c> | 19:29 |
ignas | hmm | 19:29 |
ignas | can you step to notify(IntIdAddedEvent(ob, event)) part? | 19:29 |
eldar | i'm on it, you want me to step into it? | 19:30 |
ignas | try running the command in a pdb | 19:31 |
eldar | that raises the key error | 19:32 |
ignas | what's in the utilities list? | 19:34 |
eldar | (Pdb) utilities | 19:34 |
eldar | (<zope.app.intid.IntIds object at 0x9162bac>,) | 19:34 |
ignas | whoah | 19:34 |
eldar | ? | 19:35 |
ignas | do you have setSite in your evolution script? | 19:35 |
ignas | "setSite(app)" | 19:35 |
ignas | or something like that | 19:35 |
ignas | if not - you might try to add it | 19:35 |
eldar | lol nope | 19:35 |
ignas | it set's up local utilities | 19:35 |
ignas | and if it works then try removing the __parent__ = app line | 19:36 |
ignas | it might be unnecessary | 19:36 |
eldar | oh man | 19:38 |
eldar | i got a scary error | 19:38 |
ignas | show me | 19:39 |
lisppaste5 | eldar pasted "scary_exception" at http://paste.lisp.org/display/53523 | 19:39 |
ignas | can you post all the code again? | 19:40 |
lisppaste5 | eldar pasted "evolve7" at http://paste.lisp.org/display/53524 | 19:41 |
ignas | oh | 19:43 |
ignas | do a try: finaly: setSite(None) | 19:43 |
ignas | error reporting won't work otherwise | 19:43 |
eldar | try: | 19:44 |
eldar | finally: | 19:44 |
eldar | setSite(app) | 19:44 |
eldar | like that? | 19:44 |
eldar | oops, replace app with None | 19:44 |
eldar | why am I putting None in, btw? | 19:44 |
ignas | to reset the site | 19:44 |
ignas | because else - error reporting tries to get the site | 19:45 |
ignas | and report errors on it | 19:45 |
eldar | and that goes instead of setsite(app)? | 19:45 |
ignas | after | 19:46 |
ignas | i mean | 19:46 |
ignas | around | 19:46 |
ignas | :) | 19:46 |
eldar | at the and of the look? | 19:46 |
eldar | loop* | 19:46 |
ignas | try: setSite(app) all the code finaly: setSite(None) | 19:46 |
eldar | ah i see | 19:47 |
lisppaste5 | eldar pasted "like this?" at http://paste.lisp.org/display/53525 | 19:47 |
eldar | or does all the subcode go inside the try | 19:48 |
eldar | ooops the first siteSite i meant to put app in | 19:48 |
eldar | sorry >.< | 19:48 |
ignas | yes, like that | 19:49 |
ignas | but with app in the first setSite ;) | 19:49 |
eldar | ok so it's throwing me invalid syntax | 19:51 |
eldar | on the journals = app['journals'] line | 19:51 |
ignas | indent stuff | 19:51 |
ignas | inside | 19:51 |
eldar | ah i see | 19:51 |
ignas | it's a try finaly block ;) | 19:51 |
eldar | never used finally >.< | 19:51 |
lisppaste5 | eldar pasted "can't get a school tool app" at http://paste.lisp.org/display/53527 | 19:52 |
lisppaste5 | eldar pasted "evolve7" at http://paste.lisp.org/display/53528 | 19:53 |
eldar | it says can't get a schooltool application ... | 19:53 |
eldar | I think I edited the script properly | 19:53 |
eldar | but I posted it just in case | 19:54 |
ignas | can you paste the code | 19:54 |
ignas | oh | 19:55 |
ignas | are you evolving using "evolve button" ? | 19:55 |
eldar | yup | 19:55 |
ignas | because if you are - you might want to restart the application | 19:55 |
ignas | and see it then | 19:55 |
ignas | and fix the code to do this: | 19:55 |
ignas | orig_site = getSite() | 19:55 |
ignas | and in finally: setSite(orig_site) | 19:56 |
ignas | instead of None | 19:56 |
ignas | so it would work with Evolve button too | 19:56 |
eldar | weee a move on | 19:57 |
eldar | thanks :) | 19:57 |
ignas | you might want to go through all evolution scripts that do setSite | 19:58 |
ignas | and improve them | 19:58 |
ignas | so they'd be easier to debug in the future | 19:58 |
eldar | okies | 19:59 |
ignas | the "kill error reporting if site is not None" makes it very confusing to debug evolution scripts | 19:59 |
ignas | especially if they fail for users | 19:59 |
eldar | haha yeah | 20:01 |
eldar | nyahahahaha | 20:05 |
eldar | it worked | 20:05 |
eldar | awesome | 20:06 |
eldar | thank you very much, sir | 20:06 |
ignas | :) | 20:07 |
ignas | ok, g2g home now | 20:07 |
ignas | bye | 20:07 |
*** ignas has quit IRC | 20:07 | |
*** eldar has quit IRC | 20:13 | |
*** jfluhmann has joined #schooltool | 22:06 | |
*** jfluhmann has left #schooltool | 22:07 | |
*** didymo has joined #schooltool | 22:52 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!