IRC log of #schooltool for Thursday, 2008-01-03

*** fsufitch has quit IRC01:31
*** fsufitch has joined #schooltool01:34
*** didymo has quit IRC02:40
*** eldar has left #schooltool03:41
*** didymo has joined #schooltool06:00
*** fsufitch has quit IRC06:40
*** subir has joined #schooltool07:43
*** subir has quit IRC10:10
*** subir has joined #schooltool11:18
*** didymo has quit IRC12:52
*** ignas has joined #schooltool13:35
*** eldar has joined #schooltool15:29
*** alga has joined #SchoolTool15:41
*** subir has quit IRC15:45
eldarignas: hey ayt?16:55
ignashi16:56
eldari can't get my evolve script to actually do the evolution in cando16:56
eldari made a new evolve7.py16:56
eldarand increased the generation number in the __init__.py16:56
eldarto 716:56
eldarand just started the server, assuming it would try to evolve16:56
eldardid i miss a step?16:56
ignashmm17:24
ignasa sec17:24
ignassorry, got distracted by a search of a lost wallet17:25
ignas(not mine)17:25
ignashmm17:25
ignasdo you have application control17:25
ignasin your navigation menu?17:25
ignaseldar: ?17:34
eldarapplication control?17:50
eldaryou mean i need devmode or something?17:50
ignasis it there17:52
ignasit is in new schooltool17:52
ignasand i think it's not devmode17:52
ignasif it's not there - you are probably using a release schooltool17:53
ignasand we'll have to go in another way17:53
eldaralright let me see17:54
eldarignas: yup i have application control17:56
eldaroooh evolve button17:56
ignasnot just it17:57
ignasthe important part is the number17:57
ignaswhich generation is it in17:57
ignasat the moment17:57
ignasso you know if it evolved successfully17:57
eldarit says it's 617:57
eldari hit the evolve and it tried to evolve17:58
eldarwhich is good17:58
eldarnow i can fix my evolve script17:58
ignasdid it evovle?17:58
eldarthanks :)17:58
ignasor is it showing an exception17:58
ignasnp17:58
eldarexception17:58
eldarcan i not create a new container in the evolve script?17:59
ignasyou should be able to17:59
eldari said app['messageboxes'] = MessageBoxContainer()18:00
eldarand it's throwing me key error18:00
ignaslisppaste5: url18:00
lisppaste5To use the lisppaste bot, visit http://paste.lisp.org/new/schooltool and enter your paste.18:00
ignas:)18:00
eldari gotta switch irc to linux, brb18:01
*** eldar has quit IRC18:01
*** eldar has joined #schooltool18:03
lisppaste5eldar pasted "evolve" at http://paste.lisp.org/display/5350518:03
ignasthe exception please ;)18:04
lisppaste5eldar pasted "exception" at http://paste.lisp.org/display/5350618:05
eldarif you just search for "evolve7"18:05
eldarit'll take you to the line it's complaining about18:05
ignasi can see it18:06
ignasi think i know what is wrong18:06
ignasi am thinking how to fix it18:06
eldarenlighten me please :)18:06
ignas because of some reason MessageBoxContainer can't get adapted to IKeyReference18:08
eldarhmmm that is interesting18:09
eldarconsidering that MessageBoxContainer is just JournalContainer renamed18:09
ignasand that gives you an error when system tries getting intid for the object18:09
ignascan you print the result of18:10
ignasgetAllUtilitiesRegisteredFor(ICatalog, MessageBoxContainer()):18:10
ignasit should be a list of utilities18:11
eldarhehe lemme shove a pdb in my evolve script18:11
ignasand post me the class definition of the MessageBoxContainer18:12
lisppaste5eldar pasted "MessageBoxContainer" at http://paste.lisp.org/display/5350718:14
eldarthere's the definition, i'm looking for the location of getallutilities18:14
eldarso i can import it18:14
ignasfrom zope.component import getAllUtilitiesRegisteredFor18:15
ignasthe fix that would work is something like app._p_jar.add(message_box_container) before adding it to the container18:16
eldar_p_jar?18:16
eldarwhat's that18:16
ignaszodb connection18:17
eldarok so getAllUtilities returns an empty list18:18
ignasi see, well - that does not matter too much18:18
ignasyou must do the _p_jar thingie18:19
ignasand before you do that18:19
ignascould you please het a more unique key18:19
ignasfor your container please18:19
ignaslike cando.messages.message_box_container18:19
ignasor something like that18:19
eldarinstead of just messageboxes?18:19
eldaralright18:19
ignasyes18:19
ignasa new convention18:19
ignasit should have been like 'schooltool.attendance' , 'schooltool.persons' and etc.18:20
ignasto avoid conflicts in the future18:20
eldari see18:20
ignaslike with 'journal' that was one thing for cando and a different thing for schooltool18:20
lisppaste5eldar pasted "evolve_edit" at http://paste.lisp.org/display/5350818:25
eldarok so that's what i changed18:25
eldari tried evolve, i got essentially the same error18:25
lisppaste5eldar pasted "essentially_same_error" at http://paste.lisp.org/display/5350918:26
eldarignas, any ideas?18:31
ignasa second18:37
ignashmm18:39
ignasand adapting of the container to zope.app.keyreference.interfaces.IKeyReference18:41
ignasgives you what?18:41
eldarnot yet18:43
eldarexception18:43
eldarnever understood those18:43
*** jfluhmann has joined #schooltool18:45
ignashmm18:46
ignasi'd try to adapt the object to ZODB.interfaces.IConnection18:46
*** jfluhmann has left #schooltool18:46
ignasand step into it to see why it is not giving you a connection18:46
ignaseven though you have added the object to the connection18:46
eldarhow do i step into a command i type?18:47
eldarwhile in pdb18:48
eldaror should i write that in the file and then launch pdb?18:48
ignasi'd do that18:49
ignaslaunch the pdb before the adaptation18:49
eldaruhh it doesn't give me all that many details18:51
eldarwhen i hit n on that step18:51
eldarit just throws the exception and takes me to zope generations.py18:52
lisppaste5eldar pasted "pdb" at http://paste.lisp.org/display/5351418:53
ignasnot n18:54
ignas"s"18:54
ignasstep into18:54
ignasnot next line18:54
eldarah i see18:54
ignasmmm18:54
ignasbut it could not find the adapter at all :/18:54
ignasemm18:55
ignashmm18:55
ignasvery interesting i might say18:56
ignasIConnection adapter looks for _p_jar on the object18:56
ignasif it can't find it18:56
ignas(could you see if it's there)18:56
ignasand if it can't - it looks for __parent__18:57
lisppaste5eldar pasted "debug" at http://paste.lisp.org/display/5351618:57
eldarthere is a __parent___18:58
eldarbut it's None18:58
ignascould you replace the __parent__ thing18:58
ignaswith a container.__parent__ = app18:58
ignasbefore adding it18:58
eldarstill couldn't adapt18:59
ignasemm very strange19:00
ignascall  zope.app.keyreference.persistent.connectionOfPersistent19:00
ignason the object19:00
eldarwait it worked19:00
eldari think19:00
ignas(it's a 1 argument function)19:00
eldarnvmd19:01
eldarafter the __parent__ change it now throws19:01
eldarTypeError: ('Only first-class persistent objects may be added to a Connection.', <Connection at 0906e3ac>)19:01
eldarso calling that will fix it?19:02
eldardo i have to do: message_box_container = connectionOfPersistent(message_box_container)19:02
eldaror just : connectionOfPersistent(message_box_container)19:03
eldarwell i tried both, i get the same exception19:05
eldarthis is weird19:05
eldari thought i'd just be able to assign a new container easily19:05
ignasno19:05
ignashmm19:06
ignashow does the code look now?19:06
lisppaste5eldar pasted "evolve7" at http://paste.lisp.org/display/5351919:06
ignasmessage_box_container = connectionOfPersistent(message_box_container) is not  needed19:07
ignasit does not make sense actually19:07
ignasthe function was to test the adapter19:07
ignasmessage_box_container = IConnection(message_box_container) is not needed too19:07
ignasapp._p_jar.add(message_box_container) should be removed19:07
eldarok19:07
eldarok19:07
eldarnow we're back at the same key error19:10
ignas hmm19:11
ignaskey error is because IKeyReferenceAdapter fails to work on the object19:12
ignasand it fails to work because it seems that IConnection adapter does not work on the object19:12
ignasand i can't really understand why "connectionOfPersistent" would be failing19:13
ignaswith __parent__ set19:13
eldarhas this been done in schooltool?19:13
ignasno19:13
ignasit's Zope3 code19:13
eldaradding new containers to root lvl app19:13
eldari see19:13
eldarno, i don't mean the connectionOfPersistent19:14
ignasit's the persistent dict that is at fault19:14
ignasi mean - btrees don't have these problems19:14
ignasbut app is a sample container19:14
ignasbased on a persistent dict19:14
eldari see19:14
ignasand it seems that it's behaving differently from things like PersonContainer19:14
ignascan you try "connectionOfPersistent" on the object and see if it returns anything19:15
ignasjust plain if connectionOfPersistent(object): print "YES"19:15
ignasor something on that level19:15
eldaryes19:15
eldarit returns yes o.O19:16
ignasok19:17
ignasand what does zope.app.keyreference.persistent.KeyReferenceToPersistent(object)19:17
ignasreturn ?19:17
eldar<zope.app.keyreference.persistent.KeyReferenceToPersistent object at 0x99a230c>19:18
eldarthat's what it returns when i do that on message_box_container19:19
ignasand hash() on it?19:19
eldaron the object that I get?19:19
ignasyes19:19
eldar135852673419:19
ignasemm19:20
ignasweird19:20
ignasand what does IKeyReference(object) return?19:20
eldar<zope.app.keyreference.persistent.KeyReferenceToPersistent object at 0x99a258c>19:21
ignasemm19:22
ignasfunny19:22
ignasand adding of the object to app still fails?19:22
eldaryup, same key error19:23
ignascan you add pdb in zope.app.intid.addIntIdSubscriber19:23
ignasand try running the thing again19:23
eldarjust at the top of the function?19:25
eldarok i added it in the beginning of definition19:26
eldarthe pdb activated when i started the server19:27
eldarshould i just skip through that one?19:27
ignasno19:27
ignaswhat's the "ob"?19:28
eldar<cando.message.message.MessageBoxContainer object at 0xa70e36c>19:28
ignaswhat's it's __parent__ ?19:28
ignaswhat is returned by IKeyReference(ob, None) ?19:29
eldarschooltool app object19:29
eldar<zope.app.keyreference.persistent.KeyReferenceToPersistent object at 0x908218c>19:29
ignashmm19:29
ignascan you step to notify(IntIdAddedEvent(ob, event)) part?19:29
eldari'm on it, you want me to step into it?19:30
ignastry running the command in a pdb19:31
eldarthat raises the key error19:32
ignaswhat's in the utilities list?19:34
eldar(Pdb) utilities19:34
eldar(<zope.app.intid.IntIds object at 0x9162bac>,)19:34
ignaswhoah19:34
eldar?19:35
ignasdo you have setSite in your evolution script?19:35
ignas"setSite(app)"19:35
ignasor something like that19:35
ignasif not - you might try to add it19:35
eldarlol nope19:35
ignasit set's up local utilities19:35
ignasand if it works then try removing the __parent__  = app line19:36
ignasit might be unnecessary19:36
eldaroh man19:38
eldari got a scary error19:38
ignasshow me19:39
lisppaste5eldar pasted "scary_exception" at http://paste.lisp.org/display/5352319:39
ignascan you post all the code again?19:40
lisppaste5eldar pasted "evolve7" at http://paste.lisp.org/display/5352419:41
ignasoh19:43
ignasdo a try: finaly: setSite(None)19:43
ignaserror reporting won't work otherwise19:43
eldar        try:19:44
eldar            finally:19:44
eldar                setSite(app)19:44
eldarlike that?19:44
eldaroops, replace app with None19:44
eldarwhy am I putting None in, btw?19:44
ignasto reset the site19:44
ignasbecause else - error reporting tries to get the site19:45
ignasand report errors on it19:45
eldarand that goes instead of setsite(app)?19:45
ignasafter19:46
ignasi mean19:46
ignasaround19:46
ignas:)19:46
eldarat the and of the look?19:46
eldarloop*19:46
ignastry: setSite(app) all the code finaly: setSite(None)19:46
eldarah i see19:47
lisppaste5eldar pasted "like this?" at http://paste.lisp.org/display/5352519:47
eldaror does all the subcode go inside the try19:48
eldarooops the first siteSite i meant to put app in19:48
eldarsorry >.<19:48
ignasyes, like that19:49
ignasbut with app in the first setSite ;)19:49
eldarok so it's throwing me invalid syntax19:51
eldaron the journals = app['journals'] line19:51
ignasindent stuff19:51
ignasinside19:51
eldarah i see19:51
ignasit's a try finaly block ;)19:51
eldarnever used finally >.<19:51
lisppaste5eldar pasted "can't get a school tool app" at http://paste.lisp.org/display/5352719:52
lisppaste5eldar pasted "evolve7" at http://paste.lisp.org/display/5352819:53
eldarit says can't get a schooltool application ...19:53
eldarI think I edited the script properly19:53
eldarbut I posted it just in case19:54
ignascan you paste the code19:54
ignasoh19:55
ignasare you evolving using "evolve button" ?19:55
eldaryup19:55
ignasbecause if you are - you might want to restart the application19:55
ignasand see it then19:55
ignasand fix the code to do this:19:55
ignasorig_site = getSite()19:55
ignasand in finally: setSite(orig_site)19:56
ignasinstead of None19:56
ignasso it would work with Evolve button too19:56
eldarweee a move on19:57
eldarthanks :)19:57
ignasyou might want to go through all evolution scripts that do setSite19:58
ignasand improve them19:58
ignasso they'd be easier to debug in the future19:58
eldarokies19:59
ignasthe "kill error reporting if site is not None" makes it very confusing to debug evolution scripts19:59
ignasespecially if they fail for users19:59
eldarhaha yeah20:01
eldarnyahahahaha20:05
eldarit worked20:05
eldarawesome20:06
eldarthank you very much, sir20:06
ignas:)20:07
ignasok, g2g home now20:07
ignasbye20:07
*** ignas has quit IRC20:07
*** eldar has quit IRC20:13
*** jfluhmann has joined #schooltool22:06
*** jfluhmann has left #schooltool22:07
*** didymo has joined #schooltool22:52

Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!