IRC log of #schooltool for Wednesday, 2005-12-14

*** didymo has joined #schooltool00:23
*** jinty has quit IRC00:55
*** jinty has joined #schooltool00:57
*** jinty has quit IRC01:14
*** srichter has quit IRC01:21
*** srichter has joined #schooltool01:51
th1asrichter: ayt?02:00
srichteryes03:33
th1aOK, I have some questions.03:33
th1aWell one right now.03:33
srichtershoot03:33
th1aI made Section implement IHaveRequirement.03:34
th1aThat's fine.03:34
th1aAnd I tested that in the Course doctests.03:35
th1aBut I can't do req = IRequirement(section)03:35
th1aI think because there's no configure.zcml for requirement?03:35
th1aDo in need to register the adapter?03:36
th1aI get a TypeError 'Could not adapt'03:37
srichteryes03:37
srichteryou have to register the same adapters that we did in the README.txt of schooltool.requirement03:38
th1aOK.  Paul's alrady done that in CanDo, so it shouldn't really be a problem.03:38
th1aSecond question.03:39
th1aWhen I'm actually writing code, where and when should the req = IRequirement(section) happen?03:39
th1aWhen the section is created?03:39
th1aIn __init__.py?03:40
srichterthe section is stored in the ZODB04:09
th1aWell, yeah.04:09
srichterso the adapter lookup is done whenever you need it04:10
th1aSo I'm not really creating something when I do the "req = ..." thing?04:10
srichterno04:11
srichterwell, actually you do04:11
th1aI'm "looking up the adapter."04:12
th1aBut not creating an object in the database.04:12
srichterif the groupRequirement does not exist on a section, it will be added as an annotation04:12
th1aOK.  So if I want to attach an evaluation to a section, what I'm really doing is looking up the adapter, which is a groupRequirement, and pointing the evaluation at that (not at the section itself).04:14
th1aI mean, I am giving a student an evaluation for their work in the section.04:14
th1aTheir grade for the class.04:14
srichteran evaluation is not attached to a section04:15
srichterright, so you look up the evaluations for a student04:15
th1aRight, it is attached to the student, but it refers to the groupRequirement.04:16
srichteryep04:17
th1aOK.  Thanks.04:18
*** tiredbones has quit IRC04:59
*** dman13 has quit IRC06:51
*** hazmat has joined #schooltool08:54
*** auxesis has quit IRC09:32
*** th1a has quit IRC10:36
*** th1a has joined #schooltool10:52
*** np_ has joined #schooltool11:16
*** _np has quit IRC11:29
*** strichter has joined #schooltool11:33
*** srichter has quit IRC11:33
*** _np has joined #schooltool11:53
*** hazmat has quit IRC11:54
*** _np_ has joined #schooltool12:00
*** np_ has quit IRC12:08
*** _np has quit IRC12:10
*** mgedmin has joined #schooltool12:26
*** alga has joined #SchoolTool12:55
*** alga has quit IRC12:57
*** alga has joined #SchoolTool13:27
*** ignas has joined #schooltool13:29
povbot`/svn/commits: * mg committed revision 5441:13:40
povbot`/svn/commits: Introduced IEventForDisplay.13:40
*** mgedmin has quit IRC13:43
*** didymo has quit IRC13:44
*** Aiste has quit IRC13:52
*** _np_ has quit IRC14:28
*** strichter is now known as srichter14:54
povbot`/svn/commits: * alga committed revision 5442:14:59
povbot`/svn/commits: makeCalendar for SectionAttendance.14:59
*** thisfred has joined #schooltool15:02
*** tiredbones has joined #schooltool15:28
*** faassen has joined #schooltool16:19
*** jinty has joined #schooltool16:24
*** Aiste has joined #schooltool16:33
th1ahi srichter.18:21
jintysrichter: nightly logs of automatic builds of the Z3.2 release branch are now here: http://lentejasverdes.ath.cx/buildlogs/18:41
jintyhave fun!18:41
th1aGr19:00
srichterhi19:01
srichterI am here, but I am having someone come over for some sprinting later19:01
th1aThat wasn't actually an exclamation.19:01
th1aIt did express my feelings, however.19:01
srichter:-)19:02
th1aOK.  I just mailed to you this configure.zcml I'm trying to use for requirement.19:04
th1aI'm sure it isn't complete.  I'm just trying to get the adapter to work.19:04
srichterI see19:05
srichterthe ZCML looks ok19:06
srichterare you sure it is loaded?19:06
th1aIf I break it the server won't start.19:07
srichterok, that means it is loaded19:08
srichterit should work19:08
th1a:-(19:08
srichterhow do you know it does not work?19:10
srichterdid you write a functional test?19:10
povbot`/svn/commits: * alga committed revision 5443:19:11
povbot`/svn/commits: Added an AbsenceExplanation class to store the explanation along with their acceptance status.19:11
th1aI'm just trying to get "req = IRequirement(section)" to work in the doctest for section.19:11
srichterbut the ZCML is not loaded for a doctest19:13
th1aWell, that might be the source of my problem then.19:14
th1aI was just trying to add things to test_course.py19:16
th1aI did just add a print statement to "getRequirement()" which is coming up when I run the tests.19:18
th1aSo it seems to have some idea of what its supposed to be doing.19:18
th1aOh, no it isn't.  I guess I need a functional test...19:28
ignassrichter, what might be the problem - i have got commendation/BasicComponent.txt test failing19:47
ignasit tries to write a read only attribute19:47
ignasand gets no traceback19:47
*** faassen has quit IRC20:21
*** mgedmin has joined #schooltool20:24
*** didymo has joined #schooltool20:36
*** jinty has left #schooltool20:57
* mgedmin hath achieved enlightenment21:06
mgedminif you have an old sandbox, your Zope3 subdir will continue pointing at Zope3 trunk21:07
mgedminif you make fresh checkout, the Makefile will check out the Zope 3.2 branch for you21:07
mgedminsome tests fail with Zope 3.2, and work with trunk21:07
th1aI need a good example of how to set up functional tests in SchoolTool.21:09
mgedminwhat do you mean?21:10
th1aI mean, as far as the setup and such that is necessary.21:11
th1aI need a functional test to see if I can adapt things from different packages correctly.21:11
mgedminok21:11
mgedminfirst you need to decide where to put your new test21:12
mgedmin(it should live in a 'ftests' subpackage of some package)21:12
th1aIt can go in the course package.21:12
mgedmin(if there are other ftests there, all is well)21:12
mgedmin(if not, you may have to do some additional setup here)21:12
mgedminthen you need to create a text file21:13
mgedmin(restructured text)21:13
mgedminyou can assume that Zope 3 has been set up there21:13
mgedminif you want to test adaptation21:13
mgedminyou can do so directly:21:13
mgedmin   >>> someobject = get_some_object_somehow()21:13
mgedmin   >>> adapter = IMyAdapter(someobject)21:13
mgedmin  >>> adapter.do_stuff()21:13
th1aWhat do you mean I can "assume that Zope 3 has been set up there?"21:14
mgedminthe adapter registry has been configured (by zcml)21:14
mgedminthere is a in-memory database (reachable by calling getRootFolder())21:14
mgedminand there's an empty application object in that database21:14
mgedmin(actually this application object is what is returned by getRootFolder() in our ftests)21:15
mgedminso if you want to test adapter registrations in ZCML21:15
mgedminyou can do this in a straightforward manner:21:15
mgedmin   >>> from schooltool.somewhere import SomeContentObject21:15
mgedmin   >>> from schooltool.somewhere.interfaces import ISomeInterface21:15
mgedmin   >>> obj = SomeContentObject()21:15
mgedmin   >>> adapter = ISomeInterface(obj)21:16
mgedmin   >>> adapter.doSomeStuff()21:16
mgedminetc.21:16
th1aDo I have to do some other setup somewhere else?21:16
mgedminit depends21:16
th1aI can just add a text file to ftests and it'll work?21:16
mgedminyes21:16
mgedminyou might have to do some other setup21:16
mgedminif your adapter expects something more21:17
mgedmine.g. if your adapter calls getSchoolToolApplication() and tries to figure out the default timetable21:17
mgedminor if your adapter wants the object to have been added to some container21:17
mgedminetc.21:17
th1aWhat would I have to do then (generally)?21:18
*** toothpick has joined #schooltool21:19
toothpickI doownloaded the live version of schooltool, but don't see docs on how to use it21:20
th1aThe LiveCD?21:20
mgedminth1a, the only generic answer to your question is "do what's necessary"21:21
mgedminthen there are specific answers to specific questions21:21
th1aWell, let's say that I wanted to getSchoolToolApplication() and figure out the default timetable.21:23
th1atoothpick:  Did you download the LiveCD?21:24
mgedminth1a, in that case, you'd first have to create the default timetable (say, using zope.testbrowser, or the RESTive api, or whatever)21:25
mgedminthen do21:25
mgedmin   >>> app = getRootFolder()21:25
mgedmin   >>> from zope.component.hooks import setSite21:25
mgedmin   >>> setSite(app)21:25
mgedmin   >>> ... do your test ...21:25
mgedmin   >>> setSite(None)21:26
mgedmin   >>> del app  # maybe; not sure it's necessary21:26
mgedminhm... strike the 'del app' bit21:26
th1aBut there isn't some kind of setup function I can call that automatically does that stuff?21:26
mgedminth1a, no21:26
th1aOK.  That's what I needed to know.21:26
mgedminthere's no way to figure out what needs to be done in each specific case21:27
toothpickth1a yes21:27
toothpickI have it running on the machine next to me21:27
mgedminwhen you call internal functions directly, there is no way to automatically determine what sort of environment that function expects21:27
th1aI know, I just need to know what direction I'm looking for answers.21:27
th1atoothpick:  So you got it running?21:27
mgedminthen you use the proper external API (i.e., browser/rest views), then everything is done automatically21:27
toothpickI booted the cd th1a...can't find docs on it21:28
th1aThere's not much to say about it... It has SchoolTool and SchoolBell installed.21:28
th1aThere are shortcuts on the desktop.21:28
toothpickThe schoolbell shortcut works21:28
toothpickthe schooltool does not21:28
th1aThe login/password is "manager/schooltool" or "manager/schoolbell"21:29
th1aWhat happens with SchoolTool?21:29
th1aIt certainly ought to be working.21:29
th1aThere's no trick ;-)21:29
toothpickstrange21:29
toothpicknow it is working, I was getting could not connect to local host21:29
th1aIt might have taken a long time to start (a wild guess).21:30
*** thisfred has quit IRC21:31
povbot`/svn/commits: * alga committed revision 5444:21:32
povbot`/svn/commits: Finished the section absences API.21:33
toothpickI got it now21:38
*** toothpick has quit IRC21:39
*** mgedmin has quit IRC21:44
*** ignas has quit IRC21:53
*** alga has quit IRC22:55
povbot`/svn/commits: * hoffman committed revision 5445:23:18
povbot`/svn/commits: Make sections implement IHaveRequirement.  This approach might not stick around, but I want to try it out.23:18
povbot`/svn/commits: * hoffman committed revision 5446:23:20
povbot`/svn/commits: Forgot this one.23:20
*** didymo has quit IRC23:32
povbot`/svn/commits: * hoffman committed revision 5447:23:42
povbot`/svn/commits: Fixing docstring.23:42

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