IRC log of #schooltool for Wednesday, 2011-04-06

*** menesis has quit IRC00:20
*** menesis has joined #schooltool00:32
*** menesis has quit IRC01:00
*** menesis has joined #schooltool01:07
replaceafillaelkner u there?01:41
replaceafillaelkner you added addTeacher, addStudent and addAdministrator to trunk, right?01:41
replaceafillhttps://bugs.launchpad.net/schooltool/+bug/75202101:42
replaceafillaelkner i assigned it to you01:43
* replaceafill still doesnt understand bug importance very well...01:44
replaceafilltraceback -> critical01:45
replaceafillnot found -> ?01:45
th1areplaceafill: Anything you want aelkner to remember to do has to be marked critical.02:32
th1aIt is a special case.02:32
replaceafillth1a ah ok02:32
replaceafillchanged to critical02:33
aelknerreplaceafill, hey02:38
replaceafillhey aelkner02:38
replaceafillaelkner i added to bugs related to those views, assigned one to you02:39
replaceafills/to/two02:39
aelknerthat's cool02:39
aelkneri'm surprised about the cancel button issue, but i'll check it out02:39
replaceafillit seems like a copy from the cambodia case...02:40
replaceafilland cambodia does provide those extra views02:40
aelknerthat would make sense02:40
replaceafillaelkner did you ever deal with a custom enum demographics field that need multiple values?02:47
replaceafilli have this case for cambodia:02:47
replaceafillSpecial function (list, multiple: Secretary, Librarian, Home Economy/Techonology, Drama/Music/Plastic Arts, Agriculture, Sports, Workshop, Accounting/Cashier, Laboratory, Youth)02:47
replaceafillthose are  'extra' functions for a teacher/staff member02:47
*** replaceafill has quit IRC02:59
*** yvl_ has joined #schooltool04:28
*** th1a_ has joined #schooltool04:28
*** th1a has quit IRC04:33
*** yvl has quit IRC04:33
*** replaceafill has joined #schooltool04:45
*** th1a_ has quit IRC06:20
*** replaceafill has quit IRC07:16
*** yvl_ is now known as yvl08:22
*** replaceafill has joined #schooltool08:30
*** alga has joined #schooltool09:38
*** replaceafill has quit IRC09:38
*** yvl has quit IRC11:47
*** yvl has joined #schooltool11:49
*** menesis has quit IRC13:15
*** menesis has joined #schooltool14:38
*** menesis has quit IRC14:42
*** menesis has joined #schooltool15:06
*** menesis has quit IRC15:18
*** menesis has joined #schooltool15:22
*** jelkner has joined #schooltool16:36
*** th1a has joined #schooltool16:41
jelknerth1a: In thinking about next year's setup, do I want one or two instances of ST to accommodate the two sets of terms I need to support?16:50
th1aYes, apparently I forgot that you can't have overlapping terms.16:50
th1aSo...16:50
th1aCan the same student have classes in overlapping terms?16:51
jelknerYes16:51
jelknerSince it is two schools16:51
jelknerbut APS students can take classes at both16:51
jelknerthat's not a problem16:51
jelknersince we import all APS students anyway16:52
th1aI guess you're looking at two instances.16:52
jelknerThat's what I thought16:52
jelknersince you told me the rule of thumb is: SchoolTool is designed a present for a single school16:52
jelknerso two schools == two instances16:52
th1aYes.16:53
jelknerok, cool16:53
jelknermattva01 told me that means i can't use packages16:53
jelknersince the debs don't support multiple instances on the same machine16:53
jelknerso i need to talk to replaceafill about setting up two instances on my one vm16:54
jelkneri guess from eggs?16:54
jelkneror source?16:54
jelknerhow?16:54
th1aI don't think you need that.16:54
jelkneri don't need what?16:54
th1aYou should be able to use the packages with your own configuration in /etc/schooltool16:54
jelknerahh16:54
th1aBut I can't tell you exactly how.16:55
jelknerso matt is mistaken?16:55
jelknerhe comes in today16:55
th1aWell... see what he says to that.16:55
jelknerso i wanted to ask now so we can begin thinking about it16:55
jelknerok16:55
jelknerwill do16:55
th1aThe packaging machinery shouldn't blow away your configuration.16:55
jelknerthanks16:55
th1aIt shouldn't be any different than running a special configuration of, say, Apache.16:55
th1a*shouldn't*16:56
jelknerwell we are early enough on this to have time to test ;-)16:56
jelknerthanks, i'll update you later...16:56
menesisyou can use packages17:12
menesiscp -r /etc/schooltool/schooltool-2009 /etc/schooltool/schooltool-test17:13
menesiscp /etc/init.d/schooltool-2009 /etc/init.d/schooltool-test17:13
menesisand then edit the new files to refer to the new locations17:14
*** alga has quit IRC17:19
*** menesis has quit IRC18:23
*** replaceafill has joined #schooltool18:31
*** alga has joined #schooltool18:41
*** menesis has joined #schooltool18:46
*** menesis has quit IRC18:48
*** menesis has joined #schooltool19:01
*** menesis has quit IRC19:53
*** menesis has joined #schooltool20:48
*** menesis has quit IRC20:53
*** menesis has joined #schooltool21:08
*** fsufitch has joined #schooltool21:24
fsufitchaelkner: ello21:25
th1areplaceafill:  Do you know if there's a way to control the window size when Selenium server opens Firefox?21:26
replaceafillth1a no, but let me look21:27
aelknerhey21:27
th1areplaceafill:  Does it make them really wide for you?21:28
replaceafillth1a yes21:28
replaceafillfull screen i guess21:28
*** th1a has quit IRC21:29
*** th1a has joined #schooltool21:29
aelknerfsufitch, today we should get started with the data model21:30
fsufitchyup21:30
fsufitchwould be quite useful if we were in the same room, with a whiteboard21:30
aelkneri want to go over a few things with you about the way our data model works21:30
aelkneryes, it would, but we'll make due21:30
fsufitchyup21:30
aelkneri want you to learn a little by investigating with pdb, but first some explanation21:31
replaceafillth1a according to http://release.seleniumhq.org/selenium-core/1.0/reference.html you can change the background of the screenshot :P21:31
fsufitchaelkner: be right back, getting a soda21:32
th1aI saw that.21:32
replaceafillth1a and this? http://stackoverflow.com/questions/1522252/how-to-resize-firefox-window-when-selenium-is-running21:32
replaceafillselenium.getEval("window.resizeTo(X, Y); window.moveTo(0,0);")21:33
th1aAh!21:33
replaceafillthank you javascript :P21:33
replaceafilllet me know if it works ;)21:33
th1aThat may solve the problem of auto-cropping screenshots too!21:34
replaceafillauto-cropping?21:34
fsufitchaelkner: back21:35
th1aWell, making them the right size so there's not a lot of blank space around small forms.21:35
replaceafillth1a ah, got it21:35
th1aaelkner, fsufitch:  If only there was a technology by which fsufitch and aelkner could share a video image over the internet.21:35
fsufitchif only...21:36
replaceafill:D21:36
th1aaelkner:  Doesn't your laptop have a camera?21:36
fsufitchmy laptop does, but i don't have sound recording capabilities, i'd have to go bother jeff for a mic or something21:37
aelkneri have a camera, but haven't used it for video chat before21:37
fsufitchdo you have skype?21:37
aelkneri'd have to set up a new account because i haven't used it for so long that i don't remember my signon inf21:38
aelkneri'd rather not spend the time dong that rather than working on the data model21:38
fsufitchright21:39
aelknerat the sprint, we should work out all those issues21:39
aelkneranyway21:39
th1aLOL21:39
aelknerour data model is organized using BTreeContainer objects which can contain one another21:39
aelknerforming a tree not unlike folders do in a normal file system21:39
aelknerto get to an object, it's easy to travese using the __name__ of each object in the hierachy21:40
aelknerfor the sake of simplicity, we'll always use 'app' to represent http://localhot:708021:40
aelknerwhich also happens to be, in code, ISchoolToolApplication(None)21:41
aelknerwhich is the root object, sub-classed from BtreeContainer, with it's own attributes as well21:41
fsufitchyes21:41
aelknerso app/schooltool.schoolyear/2010-2011 represents the SchoolYear object for 2010-201121:41
aelknerwe have app/schooltool.courseinfo which is the root of all data for our package21:42
aelknerit extends app without getting in the way of the rest of it21:42
fsufitch'schooltool.schoolyear' and 'schooltool.courseinfo' are stored in constants somewhere right?21:43
aelknerremember class SchoolToolApplication(BTreeContainer) works like a dict21:44
aelknerso app['schooltool.schoolyear'] is the SchoolYearContainer21:44
aelknerapp['persons'] is the PersonContainer21:44
aelknerand app'schooltool.courseinfo'] will be our root container21:45
aelkneryou need to think in paralell21:45
fsufitchyup21:45
aelknerand spell better than that :)21:45
aelknerso app['persons']['jelkner'] is the python that corresponds to:21:46
fsufitchsomething i noticed is that you can get from ISchoolYear to ICourseInfoSchoolYear, but not back21:46
aelknerhttp://localhost:7080:/persons/jelkner21:46
fsufitchthis is when i was writing the view, and didn't have a way to display the title of the SchoolYear associated with the CourseInfoSchoolYear21:46
aelkneragain let's just say app/persons/jelkner for simplicity21:46
fsufitchmhm21:46
aelknerlet's not think about views until we understand traversal better21:47
aelknerso anyway21:47
aelknerapp/schooltool.courseinfo21:47
aelknershould contain it's own set of containers21:47
aelknerfor now we only need to have schoolyears21:47
fsufitchyup21:48
aelknerlater, we will be adding containers for pathways and other things, but let's not get too complex yet21:48
aelknerso app/schooltool.courseinfo/schoolyears/2010-2011 would be a ICourseInfoSchoolYear object21:48
aelknerso far so good?21:49
fsufitchyup21:49
aelknerok, now check this out21:49
aelknerwe already have defined a traversal adapter21:49
aelknerso i'm going to show you how the traversal corresponds to pythoncode21:49
aelknerwheras app/schooltool.courseinfo/schoolyears/2010-2011 corresponds to app['schooltool.courseinfo']['schoolyears']['2010-2011']21:50
fsufitchi see21:51
aelknerapp/schooltool.schoolyear/2010-2011/courseinfo, our traversal adapter21:51
replaceafillth1a did the resize trick work/21:51
th1aOh, I'm still fiddling with other things.21:51
aelknercorresponds to ICourseInfoSchoolYear(app['schooltool.schoolyear']['2010-2011'])21:52
fsufitchi see, adapter21:52
aelkneryou see the traversal actually runs the adapter, see traversal.zcml21:52
fsufitchyup, i saw it registered there21:52
aelknerexcellent21:52
aelknerso, you see how the data is modeled through containment21:53
aelknerbut accesible also via taversal adapters21:53
aelknerthere's more than one way to traverse to the same object21:53
aelknerthis will come in handy in views when making links21:54
aelknerbut again, we'll get into that later21:54
aelknerfor now, i think we should keep it to courseinfo.py, adapters.py and README.txt to unit test it21:55
fsufitchyup21:55
aelknerbtw, you can learn a lot simply by putting a pdb trace anywhere21:55
aelknersaying app = ISchoolToolApplication(None)21:56
aelknerand looking at the heirarchy21:56
aelkneri suggest you do that later to see how the data model looks in code21:56
aelkneralthough, keep in mind, to get the schoolyear container in code21:57
aelknerthe only acceptible practice at this point is to use the adapter21:57
aelknerISchoolYearContainer(app)21:57
aelknerbelieve it or not, we don't have IPersonContainer(app), so app['persons'] is needed in that case21:58
aelknersomeone should fix that in core soon21:58
fsufitchyeah, for consistency21:58
aelknerso, if you look at schooltool.intervention a second21:59
aelkneryou'll note that the root container is actually simply a container of IInterventionSchoolYear objects21:59
aelknerbut our root needs to contain more than one type of container22:00
aelknerapp/schooltool.courseinfo/schoolyears22:00
aelknerapp/schooltool.courseinfo/pathways (later)22:00
aelkneretc.22:00
fsufitchyup22:00
aelknerso your next commit could involve creating interfaces, implementations and tests22:01
aelknerfor ICourseInfoSchoolYear22:02
fsufitchthose already exist22:02
aelknerwhich involves adding the container to CourseInfoRoot as sefl['schoolyears']22:03
aelknerno, only the root exists22:03
fsufitchlook at courseinfo.py, line 5222:03
aelkneroh, sorry, you're right22:03
fsufitch:)22:03
aelkner i think it needs fixing the way it is right now22:04
fsufitchoh?22:04
aelknerthe root can't just contain CourseInfoSchoolYear objects as it currently does22:04
fsufitchoh right, that.22:05
fsufitchso, a new interface for ICourseInfoSchoolYearContainer (that's so long!)22:05
fsufitch?22:05
aelknerdon't worry about brevity, clarity is more important22:05
fsufitchokay22:06
fsufitchso, that interface, its implementation, and the adapter for ICourseInfoSchoolYearContainer(app) then22:06
fsufitchnow, how does this "subscriber" business work?22:06
aelknergood question22:06
aelknerwe don't need to do it that way22:07
aelknerwe could simply wait until someone needs ICourseInfoSchoolYear(schoolyear)22:07
fsufitchi see, and process it in the adapter22:07
aelknerand have that adapter create the object if it is already found22:07
aelknerisn't22:07
aelknerwe call that auto-vivifying22:08
fsufitchthe way it's currently sort of being done in the getCourseInfoSchoolYear adapter22:08
aelkneryes, good22:08
aelknerauto-vivify means 'bring to life automatically'22:08
aelknerok, maybe the english is obvious, but i felt it needed to be pointed out22:09
fsufitch:)22:09
aelkneryou still have your branch of schooltool.intervention22:10
fsufitchyes22:10
aelknerlook at adapters.py for getStudentYearInterventionStudent22:11
aelknerit's atually a multi-adapter, but don't worry about that22:11
fsufitchthat means it takes multiple arguments, right?22:11
aelknerright, adapting multiple things is the same as taking multiple arguments22:12
aelknerthat's why the concept of adapters is actually quite simple at its core22:12
fsufitchyup22:12
fsufitchnow im remembering how adapters work, and since i've worked with other web development frameworks, i see why adapters are so awesome22:13
aelknerno as far as interventionStudent[u'messages'] = intervention.InterventionMessages()22:13
aelkneryup22:13
aelkneras far as that line of code being there22:13
aelkneri'm not sure why i did it that way and not in the __init__ of InterventionStudent22:13
aelknerah, i know why22:14
fsufitchoh?22:14
aelknerbecause the line before it, interventionSchoolYear[student.__name__] = interventionStudent22:14
aelknerthat needs to complete first, meaning __init__ is already run22:14
aelknerin order to do the next level of containmemt on the next line22:14
fsufitchright22:15
aelknerputting those two lines in __init__ crashes because the InterventionStudent object itself22:15
aelknerdoesn't have a home yet22:15
aelknerdoes that make sense?22:16
fsufitchyup22:16
aelknerok, so can you set about fixing the adapter of ICourseInfoRoot(schoolyear)22:18
aelknerto create the 'schoolyears' container?22:18
aelknerand while you're at it, create adapters.py for all of the adapters22:18
aelknerkeep just the data object definitions in courseinfo.py22:19
fsufitchokay22:19
aelkneralso, note the way adapters.py uses @adapter and @implementer?22:19
fsufitchyeah, i wanted to ask about that22:19
fsufitchis that preferred to the ZCML way?22:20
aelknerit's nicer i find to use those descriptors because it make registering them trivial22:20
aelknerall that's needed is factory=...22:20
aelknerthe descriptors tell the registration engine what gets adapted and implemented22:21
aelkneror 'provided' as it is also refered22:21
aelkneralso22:21
aelknerin unit tests, we need to manually provide adapters in setup22:21
aelknerso the provideAdapter(getCourseInfoSchoolYear) call needs no adapts=22:22
aelkneror provides=22:22
aelknerit's much more convenient for coding purposes22:22
aelkneralso, having the descriptors is better because it keeps the definition of what's adapted22:23
aelknertogether with the code that does the job22:23
fsufitchi see22:24
fsufitch:) alright22:24
aelknerthings have gotten simpler and clearer over the years22:24
aelknerand you're the benificiary :)22:24
aelknerbeneficiary22:25
aelknerhad to look it up, i'm embarrassed to admit22:25
aelknerso, i think you can make a small, but productive commit just cleaning that stuff up22:26
fsufitchyup22:27
aelknerok, i'll leave you to it then22:27
aelknerremember, always make sure bin/test works before commiting22:28
aelknerand if you want me to check out the diff before you commit, email it to me22:28
aelknerand wait for me to respond to your ping22:28
fsufitchokay :)22:29
aelkneroh, bin/test -u is much faster22:29
aelknerso use that until it passes before you worry about bin/test -f22:29
aelknerbin/test will run that every time, and that wastes your time waiting22:30
fsufitchah, okay22:30
aelkneryou have your cell?22:31
aelknerif i don't respond to ping in five minutes, call my cell, ok?22:31
fsufitchyep22:31
fsufitchpoor signal though22:31
fsufitchokay22:31
aelkneryou have the number programmed in, right?22:31
fsufitchyup22:32
aelknercool22:32
aelknerfsufitch, btw, reading back i noticed you point out that we don't have an adapter back to ISchoolYEar22:42
fsufitchyes22:42
aelknerthat is a good point, and it wil be easy to add it to this commit and test it22:43
fsufitchthing is i don't see any efficient way to code it (less than O(n) efficiency)22:43
aelknerthe __name__ of CourseInfoSchoolYear objects is the same the correesponding SchoolYear object22:44
fsufitch__name__ is the attribute SchoolYear is indexed by?22:44
fsufitchso, ISchoolYearContainer(app)[courseinfoschoolyear.__name__] would do it?22:45
aelknerbingo, well done22:45
aelknerfsufitch, another thing for this commit22:46
fsufitchokay :)22:46
aelknersee how test_cataloghas its own setup and teardown22:46
aelkneri want you to provide the adapters for tests there22:47
aelknerrather than in README.txt itself22:47
aelknerit's another way we keep things cleaner22:47
fsufitchwait, test_catalog? where?22:47
aelknersorry, thought you would get the implied 'in schooltool.intervetnion)22:48
aelkneralways remember, examples is the mother's milk of software delvelopment22:48
aelkneryou'll move the provideAdapter calls from README.txt to setup in test_courseinfo.py22:49
fsufitchi see22:49
aelknerand you won't need the adapter- and provides= anymore22:49
aelknersince you are using the descriptors22:50
fsufitchyup22:50
aelknerso that's enough changes for one commit22:50
aelkneri'll try not to think of any more :)22:51
fsufitchheh okay22:52
aelknerfsufitch, i didn't realize that test_Courseinfo.py already has setup and teardown22:52
aelknerso all you need is to add the provide adapter calls22:52
fsufitchokay22:53
aelknerfrom schooltool.relationship.tests import setUp, tearDown22:53
aelknerthat should be removed because it's not used, hence, confusing22:53
fsufitchdone22:54
th1areplaceafill:  Sent you the script-in-progress.22:54
* replaceafill checks22:55
th1aNote that it wants to be run as root and to delete your database.22:55
replaceafillos.stat(db_path).st_size > 70000???!?!?22:57
th1aIf your database isn't empty, delete it.22:57
replaceafillis 70k the size for an emtpy one/22:57
th1aYes.  :D22:57
replaceafill:D22:57
replaceafill400x400 window :)22:59
replaceafilldo you need to move the window?22:59
th1aThat's the default.22:59
th1aI'm not sure when you need to position it.23:00
th1aI think for the first one the screen is rendered small enough that it has no effect.23:00
th1aYou can mostly paste the commands from the IDE into a method.23:02
replaceafillth1a why dont you give screenshots meaningful names like 'login-form.png', etc?23:05
replaceafillwont it make it easier to insert them into the book?23:05
replaceafills/wont/wouldnt23:05
replaceafillfsufitch you should check group.py, level.py and course.py for an idea on how to implement object -> schoolyear adapters using intids23:13
replaceafilland not depending on ___name__ attributes23:13
fsufitchreplaceafill: okay23:14
fsufitchwhich part of schooltool are they in?23:14
replaceafillgroup/group.py, level/level.py, course/course.py23:14
replaceafilli guess groups dont have the direct Group -> SchoolYear adapter though23:15
replaceafillbut you will see that usually you get the adapter from the GroupContainer, LevelContainer, CourseContainer -> SchoolYear23:15
replaceafillso, if you have a course you do ISchoolYear(course.__parent__)23:15
replaceafillISchoolYear(group.__parent__)23:16
aelkneryou should be able to do ISchoolYear(course)23:16
aelkneri mean, you can23:17
replaceafillin the background is really ISchoolYear(course.__parent__)23:17
replaceafillall of them are23:17
replaceafill@adapter(ICourse)23:17
replaceafill@implementer(ISchoolYear)23:17
replaceafilldef getSchoolYearForCourse(course):23:17
replaceafill    return ISchoolYear(course.__parent__)23:17
aelknerreplaceafill, reffing fsufitch to course, group, level implementation is a bit more complex than i wanted to go for now23:20
replaceafillok, refer him later ;)23:20
aelknerhe can rely on __name__ because his will always match schoolyear's23:20
aelknerits one-to-one23:20
fsufitchalso the advantage of adapters is you can always rewrite them and it won't break other code so long as they keep working23:21
replaceafillwell, who am i to question you guys ;)23:21
replaceafillyou know your code better :)23:21
aelkneri'm just trying to keep it simple23:22
aelknerthe whole intids thing should be used only when absolutely nexessary23:22
aelknernecessary23:22
*** menesis has quit IRC23:32
aelknerfsufitch, you had asked about schoolYearAddedSubsciber, and i wanted to make sure we agreed23:47
aelknerthat you would remove that subscriber since you are auto-vivifying in the adapter23:48
aelkneris that what we agreed?23:48
fsufitchi dont recall agreeing upon removing that subscriber, but sure, i can do that23:49
aelknerwere coding the adpater the same way, i.e., duplicate?23:49
fsufitchwell no, i was going to make the adapter "self-vivifying"23:50
fsufitchbut i can reimplement that subscriber under adapter functionality23:50
fsufitchi don't see any disadvantage in doing so23:50
aelknerso yeah, you get rid of the subscriber23:50
fsufitchokay :)23:50
aelknerthis way, when your test creates the schoolyear, none of your code gets run23:51
aelknerbut then when you adapt to your schoolyear, the auto-vivify will go into effect23:51
fsufitchyup23:51
aelknerlater (in a separate comit) you will want to have a subscriber for when schoolyears are removed23:51
aelknerbecause then you need to auto-killify23:52
fsufitch"killify" is a funny word23:52
aelknerjost joking around in my own lame way23:53
fsufitch:-P23:53
aelknerbut you do need to remove CourseInfoSchoolYear objects when SchoolYear objects go away23:53
aelkneragain, in a separate commit23:53

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