IRC log of #schooltool for Tuesday, 2009-01-20

*** alga has joined #SchoolTool00:06
*** replaceafill has quit IRC00:20
*** povbot has joined #schooltool03:34
*** th1a has quit IRC05:39
*** ignas has joined #schooltool11:53
*** alga has quit IRC12:47
*** mgedmin has joined #schooltool13:07
*** alga has joined #SchoolTool13:23
*** ignas has quit IRC14:24
*** th1a has joined #schooltool16:07
*** yvl has quit IRC16:22
*** ignas has joined #schooltool16:24
ignasth1a: ping16:29
*** replaceafill has joined #schooltool16:39
replaceafillignas, ping16:51
replaceafilli'm going to change the implementation to use adapters16:55
replaceafillcould i create a new branch for it16:55
replaceafillusing the procedure aelkner told me yesterday16:55
replaceafilli just dont want to put more work on u17:02
replaceafillthats all17:02
ignaswell - i didn't do much work yet anyway17:05
ignasjust looked at what was done17:05
replaceafillok to understand clearly:17:05
replaceafill1. bzr branch gradebook trunk17:06
replaceafill2. make my changes there17:06
replaceafill3. push to a new branch on my own folder with a suffix like _integration17:06
ignasa sec17:06
ignassuffix should be17:14
ignasalso - the things i disliked about the current state of code17:14
ignasutilities instead of adapters are not really giving any benefits17:14
ignasexcept that you can't dispatch according to section type17:15
ignasor some special logic17:15
ignastitles as connecting attribute17:15
ignasdo you really want that?17:15
ignasi mean - people can change titles17:15
ignaswhat will happen if someone will add one more external activity source17:15
ignasand that other source will have a title from one of the sources that existed before17:15
ignaswhat happens when external activities disappear?17:16
ignasi mean - if i will delete a skilldriver in cando17:16
ignaswhat will happen to the linked activity?17:16
ignaswhat will happen if i will rename activity in cando?17:17
replaceafillbut if storing adapters as attributes is not the solution17:17
ignasyou are not storing adapters anyway17:17
replaceafillhow can we link them?17:17
ignasi you want to keep persistent information about the connection17:17
ignasyou need a separate persistent object17:17
ignasnow - how that persistent object finds out what activities it is linking is another problem17:18
ignasat the moment you are using titles for that17:18
ignasbut you could also find some other way to refer to an external activity provided by the utility/adapter17:19
ignasor you can refer to the external activity directly17:19
ignasand use subscribers17:19
ignasto remove the linked activity if the external gets deleted17:19
ignasor you can add code in the adapter/utility17:20
ignasthat can lookup the external activity in any way it needs17:20
ignasby some unique token17:20
ignasso IExternalActivities(section)17:20
ignascan list external activities17:20
ignaslook up external activity by some key17:20
ignasand give a unique key for any activity it returns17:20
ignasnot sure how it should be implemented though17:21
ignasas I haven't seen the cando part of the code17:21
ignasoh and how does:17:21
ignas+    def getExternalActivity(self):17:21
ignas+        section = self.__parent__.__parent__.__parent__17:21
ignas+        try:17:21
ignas+            return [activity17:21
ignas+                    for activity in interfaces.IExternalActivities(section)17:21
ignas+                    if self.title == activity.title][0]17:21
ignas+        except (IndexError,):17:21
ignas+            return None17:21
ignaseven work?17:21
ignasthe if has no ":" after it17:21
ignasmy bad17:22
ignasmisread it17:22
ignasso if you find more than 1 activity17:22
ignaswith the same title17:22
ignasyou return the first one17:22
ignasemm - so if i add one more activity with the same title17:22
ignasyour code can suddenly start using the new activity17:22
ignaseven though the old one was linked17:22
replaceafilli completly agree17:23
ignasso that's what i am worried about17:23
replaceafillthe whole code :D17:23
replaceafillwriting it all down...17:26
th1aignas: pong17:27
ignasth1a: how many and which days are we going to spend programming?17:31
th1aIt seems to me that your plan covers everything I would have wanted to talk about, so we should be able to plow right into coding.17:32
th1aAs much as is actually possible.17:32
ignasi am talking dates17:32
ignasfor flying17:32
th1aOh, yeah.  ;-)17:32
th1a3 days of coding Feb. 6, 7, 8.17:34
ignasok, so i will try to get a flight to get there on 5 and come back on 10 or maybe just maybe 11th17:36
th1aOK. Let me know.17:37
*** fsufitch has quit IRC17:48
*** fsufitch has joined #schooltool17:52
ignasth1a: i just tried to find out how much it costs and how long it takes to go from Washington D.C. to New York by train17:52
ignasth1a: let's say i am slightly disappointed by the backwardness of Amtrak17:53
ignasreplaceafill: not the whole code, the idea to have them enabled on demand and not automatically is something i didn't even think of17:56
ignason the other hand the functional test that has john...5...6...2917:57
ignasis something i would not do really17:57
ignasi mean - it would match "john 50 60 29"17:57
ignasjust as well17:57
ignasand if it will fail because 6 has changed to 717:57
replaceafillu would use the whole html?17:57
ignaswell - good luck finding out what has changed17:58
ignaswell - it's a table17:58
ignasand you probably know the id of the table17:58
ignasso you could use analyze.queryHTML()17:58
ignasand xpath17:58
ignasto filter out and print only the table itself17:58
ignasfor example17:58
replaceafillwow, didnt know about analyze17:58
replaceafillwhere does it come from?17:59
ignaslook up usages of queryHTML in schooltool code17:59
replaceafilli mean, which package?17:59
ignasit is in functional test globals17:59
ignasby default17:59
ignasso you just do:17:59
ignas  >>> print analyze.queryHTML('//div[@class="commendation"]',17:59
ignas  ...                         manager.contents)[0]17:59
ignasin a functional test17:59
ignasand you get all the divs that have class set to commendation17:59
ignaswell - just the first div actually18:00
replaceafillcool, xpath18:00
replaceafilllike in selenium :)18:00
ignasa bit more precise than blobbing everything with ...18:00
ignasalso gives a *LOT* less output18:00
ignaswhen  it fails18:00
ignasso at least limmiting it to the '//div[@id="content-body"]'18:01
ignaspart of the page18:01
ignasstrips all the menus18:01
ignasfrom the output18:01
replaceafillignas, is it ok to fix the unique title issue using a prefix in the adapter/utility?18:04
ignashmm, don't really know18:04
replaceafillkind of the way formlib does it18:04
ignasaren't there other ways18:04
ignasto identify an activity?18:04
ignasi guess not18:05
replaceafilltitle, description18:05
ignasi mean like __name__18:05
ignasi guess not really18:05
replaceafillActivity, Activity-218:05
ignasstill - can you "get" the activity using that thing18:06
ignasyou must be able to reliably convert the identifier string18:06
ignasinto an activity18:06
ignasand back18:06
ignasas I don't really know how activities are being accessed18:06
ignasand how the constraint of different titles is being enforced18:07
ignastitles are for presentation18:07
ignasdescriptions are for presentation either18:07
replaceafilli guess right now the gradebook allows 2 act with the same title18:08
ignasin perfect case external activity sources should allow you18:08
ignasto add activities that are not persistent objects18:08
ignasreplaceafill: also cando might allow it, or some other plugin that adds activities18:08
ignasso the activity source adapter for a section should be the one doing mapping between external activities and their ids18:09
ignasso what you'd need as an actual ID18:09
ignaswould be the adapter/utility name + the id18:09
ignasas 2 separate attributes18:09
ignasi'd say18:09
ignas(no a dot is not reliable, someone can call his adapter "")18:10
ignasor can name his activity "St. Christianology"18:10
ignasso to convert an activity ID into the actual external activity18:10
replaceafillsomething like an intid?18:10
ignasin a linked activity you would do18:10
ignassomething like that18:10
ignasyou have "activity_id" and "adapter_name"18:11
replaceafilldoes st have an intid utility?18:11
ignasyeah, but i'd not use it for this18:11
ignasas you would enforce18:11
ignasa constraint - all external activities must be persistent18:11
replaceafilloh yes18:11
ignasyou do queryAdapter(section, IExternalActivities, name=adapter_name).getActivity(activity_id)18:11
ignasto acquire the external activity18:12
ignasIExternalActivity has an attribute18:12
ignasthat can be used to look it up18:12
ignasalso - external activity plugin writers18:12
ignasmust write a subscriber18:12
ignasthat removes all the linked activities18:13
replaceafillhow can that be enforced?18:13
ignasit can't18:13
replaceafilli mean the thirdparty writer to know about the subscriber18:13
ignasbut should be documented i'd guess18:13
replaceafillah ok18:13
ignasthat have  adapter_name == my_adapter_name and activity_id == event.object.id18:13
ignaslinked activities removed18:14
ignasfrom the database18:14
ignasthe slightly tricky case might be listing the activities in choice fields18:15
replaceafillto filter them?18:15
ignasthough - you can either display multiple boxes (one for each provider)18:15
ignasor you will have to play around with some clever code to generate double ids18:15
ignasbut still - as you control the ID generation18:15
ignas(users don't see the ids)18:15
ignasyou can think of something18:16
replaceafillwriting down...18:16
ignascan you explain me what and why the updategrades view does?18:17
replaceafillit refreshes the grades of the linkedactivity18:18
ignasi mean - why is it needed?18:18
replaceafillfrom the cando skilldriver18:18
replaceafilljelkner asked for a button to update the grades18:19
ignasyeah, but shouldn't it be performed automatically?18:19
replaceafillhe didn't want them to be automatically refreshed18:19
ignasif someone deletes a skill driver18:20
ignasyou have following problems18:20
ignasreturns None18:21
ignaswhen you try to get it's activity18:21
ignasyou have an evaluation in your gradebook18:21
ignasthat has not been removed18:21
ignasI am interested in how it would work18:21
ignasin the actual gradebook grading views18:22
replaceafillthe subscriber should fix that, right?18:24
ignasi mean - you have a plugin that provides external activities for cando18:24
ignasso i'd assume you can write a functional test18:24
ignasthat looks at what actually happens18:24
ignasif you "add" linked activity that points at cando18:25
ignasand then grade it18:25
ignasupdate grades18:25
ignasthen remove the skilldriver18:25
ignasthen refresh the gradebook views18:25
ignastry grading it in the gradebook18:25
ignastry clicking it and stuff18:25
replaceafillsince the linked activity couldnt find the external activity it should raise an lookuperror18:27
replaceafilland fail miserably :)18:27
ignasyeah, and if it not fails - what happens to the code that calculates averages? displays grading tables?18:27
ignascan you do identical titles among 2 activities in cando18:28
ignaswhat happens if you change a title18:28
ignasand why is the view called AddExternalActivity18:29
ignasif it is adding LinkedActivities18:29
ignasi mean - external activities are being provided by the utility18:29
replaceafilli got with the "New External Activity" label18:30
replaceafillbut that should be AddLinkedActivity18:30
ignaswell - the label can stay that way, for a user it is "add external activity" thing18:32
ignasmaybe "register external activity"18:32
ignasor something like that18:32
ignasbut still the view should match the class it is adding18:32
ignasso yeah if you would bzr branch trunk18:32
ignasapply the changes you did in some way18:33
ignasbzr diff -r  1..18:33
ignasin your branch18:33
ignasthe one that you did18:33
ignasgives a full diff18:33
ignasthat you should be able to bzr patch18:33
ignasonto your new branch18:33
ignasand then fix at least some of the stuff18:33
ignasit would be nice18:33
replaceafillok will do it18:35
replaceafillthe id thing is the one that still bothers me18:35
replaceafillhow to get a unique one18:35
ignasit should be taken care of by the utility/adapter really18:36
ignasso in your test18:36
ignasit should be performed by your stubs18:36
ignasand in cando18:36
ignasby cando18:36
ignascando for example18:36
ignascan use IntId18:36
ignasstubs can do whatever they want ;)18:36
replaceafillyes because skilldrivers are persistent18:36
replaceafillthanks ignas, i will work on all of this18:37
ignasas long as a pair of adapter_name + activity ID18:37
ignasare enough to get an external activity18:37
ignasby calling queryUtility(section, IExternalActivities, name=name).get(activity_id)18:38
ignasit should work18:38
ignasso in cando case - the get() method would just perform and indID lookup18:38
aelknerreplaceafill: as you take note of ignas' suggestions19:03
aelknermay i suggest that you save the bullet-proofing for the last step19:03
aelknerby that i mean, the considerations that ignas outlined for avoiding conflicts with duplicate external activities19:04
aelknerand get the essential parts working enough that we can deploy to jelkner's machine on thursday19:04
ignasaelkner: problem19:04
ignasis touching the ID part19:05
ignashaving titles as IDs is very bad19:05
ignasand if you don't change it19:05
ignasand deploy it19:05
ignaschanging it to something/anything else19:05
ignaswill be very difficult19:05
ignasand require schooltool.gradebook + cando evolution script19:05
ignasyou can do it well with utility19:06
ignasinstead of an adapter19:06
ignasas that is code19:06
ignasso if anything should be postponed - it's the utility stuff, not the id stuff19:06
aelknerok, sounds fine19:07
aelknerjust want us to realize that we don't have more than one client at the moment19:07
aelknerand jelkner wants something on his desk by thursday19:07
aelknerso in the spirit of yagni, can we please not worry about all test cases before then19:08
ignasaelkner: i am not really sure anyone will be spending any time on this feature after it's merged, unless it breaks ;)19:08
ignasand i am trying to prevent the "breaks" part19:08
aelkneri'm not suggesting that we merge anything before it is ready19:08
aelkneri'm just suggesting that replaceafill focus on getting the code to function for jelkner first19:09
ignasif it was automatic external activities without the intermediate persistent layer it would be easier to prototype...19:09
ignasbut doing jelkner specific evolution might be tricky19:09
replaceafillafk, bath19:10
aelknerignas: i agree that replaceafill should address the issues that would help avoid the need for evolution19:11
aelknerlike handling the id issue19:11
aelkneri'm just trying to get something to jelkner by thursday so that he can demonstrate to whomever he wishes19:13
ignasif it is for demonstration19:13
ignasthat i'd say current code should work19:13
ignasas long as you destroy the Data.fs19:13
ignasafter the demo19:13
aelknerno, i'm not suggesting that19:13
aelknerthe id issue whold be resolved by thursday19:13
aelknerbut things like the subscriber19:14
aelknerthat handles deleting the linked activity19:14
aelkneris not needed for any demo19:14
aelknerjelkner can just avoid deleting a skill driver19:14
aelknerthat's all i'm saying19:14
ignaswith one user you can live with it19:14
aelknerbut we'll make sure to get everything right before we request the merge19:15
ignasok, as long as the right code gets merged - it's you who will be resolving problems with the wrong one ;)19:16
ignasalso it's you who would be suffering if you would not complete it for thursday I guess19:16
*** ignas has quit IRC19:39
*** alga has quit IRC20:00
*** mgedmin has quit IRC20:00
*** alga has joined #SchoolTool20:12
aelknerreplaceafill: so when ignas says:20:52
aelkneryou do queryAdapter(section, IExternalActivities, name=adapter_name).getActivity(activity_id)20:53
aelknerhe's talking about using the object id instead of the title20:53
aelknerbecuase the user can change the title20:53
aelknerbut the object id stays the same20:53
aelknernow even though zodb objects are python objects20:54
aelkneri wouldn't rely on the python method, id(objecct)20:54
aelknerbecause i'm not sure if that id stays the same from run to run20:55
aelknerhowever, i believe IKeyReference(object) returns an id that is persistent20:55
aelknerlook at gradebook.,py for an example of its use20:56
aelkneryes, the section's id is obtained using that construct20:58
aelknerand that is persisted to the person object's annotation20:58
aelknerso it can be relied upon20:58
replaceafillbut ikeyreference depend on the object being persistent, right?20:58
aelknerthe skilldriver is20:59
aelknerso even though external activities aren't20:59
aelknerthey act as a proxy to the skilldriver which is20:59
aelkneryou should change the linked activity to not use title21:01
aelknerbut use this id instead21:01
aelknerbut also, as ignas indicated21:01
aelknerthe name of the adapter21:01
replaceafillshould be part of the id21:01
aelknerno, they are two pieces of information21:02
aelkneragain, look at the queryAdapter call21:02
aelknerther is adapter_name and activity_id21:02
aelknerboth pieces need to be stored in the linked activity21:03
aelknerso the user that creates the linked activity21:03
aelknerwill need to choose both21:03
aelknera pulldown with cando and other plugin in it21:04
aelknerthen a pulldown with the list of skilldrivers in the case of cando21:04
aelknerand the titles will be tied to the ids21:04
replaceafillthese external activities are from this source21:04
replaceafillthese other external activities are from this other source21:05
replaceafillwell, will work on that21:06
aelknerif it's not ready by thursday, don't worry21:08
aelkneryou couldn't have anticipated this problem21:08
aelkneryou'll do your best21:08
aelknerand i'm sure jelkner will understand21:08
replaceafilli'll work the fastest i can though21:09
aelknerbest of luck with it21:10
replaceafillthanks man :)21:10
replaceafillwe will need js for that UI, right?21:10
replaceafillto select the external activities according to their source21:11
aelknerit's true that the server can't know what the user chooses for source21:13
aelknerwhen it delivers the vocabulary for the activiies21:13
aelknerso i guess you would need js to limit the choices to the user according to what is chosen for the source21:14
aelknerso if no source is chosen, the list of activities should be empty21:15
aelknerif there is only one source, as will be the case for jelkner21:16
aelknerthen that choice is fixed and the list of activites can already be set21:17
aelknerfor thursday21:17
aelkneryou could work around the js part21:17
aelknerjust assume that there is only one choice21:17
aelknerand get that working21:18
aelknerthe key is getting something to jelkner21:18
aelknerbut also21:18
aelknerhaving the right data structure so that we won't need to evolve21:18
aelknerso i think you can arrange that without having ot worry about the js part yet21:19
replaceafillwell, gonna get something to eat21:20
*** Aiste has quit IRC21:51
*** fsufitch has quit IRC21:51
*** th1a has quit IRC21:51
*** aelkner has quit IRC21:51
*** jstraw has quit IRC21:51
*** lisppaste5 has quit IRC21:51
*** alga has quit IRC21:51
*** replaceafill has quit IRC21:51
*** spowers has quit IRC21:51
*** jfroche has quit IRC21:52
*** wgrant has quit IRC21:52
*** jfroche has joined #schooltool22:10
*** spowers has joined #schooltool22:10
*** lisppaste5 has joined #schooltool22:10
*** Aiste has joined #schooltool22:10
*** aelkner has joined #schooltool22:10
*** jstraw has joined #schooltool22:10
*** wgrant has joined #schooltool22:10
*** th1a has joined #schooltool22:10
*** replaceafill has joined #schooltool22:10
*** alga has joined #schooltool22:10
*** fsufitch has joined #schooltool22:10

Generated by 2.15.1 by Marius Gedminas - find it at!