*** didymo has joined #schooltool | 00:23 | |
*** jinty has quit IRC | 00:55 | |
*** jinty has joined #schooltool | 00:57 | |
*** jinty has quit IRC | 01:14 | |
*** srichter has quit IRC | 01:21 | |
*** srichter has joined #schooltool | 01:51 | |
th1a | srichter: ayt? | 02:00 |
---|---|---|
srichter | yes | 03:33 |
th1a | OK, I have some questions. | 03:33 |
th1a | Well one right now. | 03:33 |
srichter | shoot | 03:33 |
th1a | I made Section implement IHaveRequirement. | 03:34 |
th1a | That's fine. | 03:34 |
th1a | And I tested that in the Course doctests. | 03:35 |
th1a | But I can't do req = IRequirement(section) | 03:35 |
th1a | I think because there's no configure.zcml for requirement? | 03:35 |
th1a | Do in need to register the adapter? | 03:36 |
th1a | I get a TypeError 'Could not adapt' | 03:37 |
srichter | yes | 03:37 |
srichter | you have to register the same adapters that we did in the README.txt of schooltool.requirement | 03:38 |
th1a | OK. Paul's alrady done that in CanDo, so it shouldn't really be a problem. | 03:38 |
th1a | Second question. | 03:39 |
th1a | When I'm actually writing code, where and when should the req = IRequirement(section) happen? | 03:39 |
th1a | When the section is created? | 03:39 |
th1a | In __init__.py? | 03:40 |
srichter | the section is stored in the ZODB | 04:09 |
th1a | Well, yeah. | 04:09 |
srichter | so the adapter lookup is done whenever you need it | 04:10 |
th1a | So I'm not really creating something when I do the "req = ..." thing? | 04:10 |
srichter | no | 04:11 |
srichter | well, actually you do | 04:11 |
th1a | I'm "looking up the adapter." | 04:12 |
th1a | But not creating an object in the database. | 04:12 |
srichter | if the groupRequirement does not exist on a section, it will be added as an annotation | 04:12 |
th1a | OK. 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 |
th1a | I mean, I am giving a student an evaluation for their work in the section. | 04:14 |
th1a | Their grade for the class. | 04:14 |
srichter | an evaluation is not attached to a section | 04:15 |
srichter | right, so you look up the evaluations for a student | 04:15 |
th1a | Right, it is attached to the student, but it refers to the groupRequirement. | 04:16 |
srichter | yep | 04:17 |
th1a | OK. Thanks. | 04:18 |
*** tiredbones has quit IRC | 04:59 | |
*** dman13 has quit IRC | 06:51 | |
*** hazmat has joined #schooltool | 08:54 | |
*** auxesis has quit IRC | 09:32 | |
*** th1a has quit IRC | 10:36 | |
*** th1a has joined #schooltool | 10:52 | |
*** np_ has joined #schooltool | 11:16 | |
*** _np has quit IRC | 11:29 | |
*** strichter has joined #schooltool | 11:33 | |
*** srichter has quit IRC | 11:33 | |
*** _np has joined #schooltool | 11:53 | |
*** hazmat has quit IRC | 11:54 | |
*** _np_ has joined #schooltool | 12:00 | |
*** np_ has quit IRC | 12:08 | |
*** _np has quit IRC | 12:10 | |
*** mgedmin has joined #schooltool | 12:26 | |
*** alga has joined #SchoolTool | 12:55 | |
*** alga has quit IRC | 12:57 | |
*** alga has joined #SchoolTool | 13:27 | |
*** ignas has joined #schooltool | 13:29 | |
povbot` | /svn/commits: * mg committed revision 5441: | 13:40 |
povbot` | /svn/commits: Introduced IEventForDisplay. | 13:40 |
*** mgedmin has quit IRC | 13:43 | |
*** didymo has quit IRC | 13:44 | |
*** Aiste has quit IRC | 13:52 | |
*** _np_ has quit IRC | 14:28 | |
*** strichter is now known as srichter | 14:54 | |
povbot` | /svn/commits: * alga committed revision 5442: | 14:59 |
povbot` | /svn/commits: makeCalendar for SectionAttendance. | 14:59 |
*** thisfred has joined #schooltool | 15:02 | |
*** tiredbones has joined #schooltool | 15:28 | |
*** faassen has joined #schooltool | 16:19 | |
*** jinty has joined #schooltool | 16:24 | |
*** Aiste has joined #schooltool | 16:33 | |
th1a | hi srichter. | 18:21 |
jinty | srichter: nightly logs of automatic builds of the Z3.2 release branch are now here: http://lentejasverdes.ath.cx/buildlogs/ | 18:41 |
jinty | have fun! | 18:41 |
th1a | Gr | 19:00 |
srichter | hi | 19:01 |
srichter | I am here, but I am having someone come over for some sprinting later | 19:01 |
th1a | That wasn't actually an exclamation. | 19:01 |
th1a | It did express my feelings, however. | 19:01 |
srichter | :-) | 19:02 |
th1a | OK. I just mailed to you this configure.zcml I'm trying to use for requirement. | 19:04 |
th1a | I'm sure it isn't complete. I'm just trying to get the adapter to work. | 19:04 |
srichter | I see | 19:05 |
srichter | the ZCML looks ok | 19:06 |
srichter | are you sure it is loaded? | 19:06 |
th1a | If I break it the server won't start. | 19:07 |
srichter | ok, that means it is loaded | 19:08 |
srichter | it should work | 19:08 |
th1a | :-( | 19:08 |
srichter | how do you know it does not work? | 19:10 |
srichter | did 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 |
th1a | I'm just trying to get "req = IRequirement(section)" to work in the doctest for section. | 19:11 |
srichter | but the ZCML is not loaded for a doctest | 19:13 |
th1a | Well, that might be the source of my problem then. | 19:14 |
th1a | I was just trying to add things to test_course.py | 19:16 |
th1a | I did just add a print statement to "getRequirement()" which is coming up when I run the tests. | 19:18 |
th1a | So it seems to have some idea of what its supposed to be doing. | 19:18 |
th1a | Oh, no it isn't. I guess I need a functional test... | 19:28 |
ignas | srichter, what might be the problem - i have got commendation/BasicComponent.txt test failing | 19:47 |
ignas | it tries to write a read only attribute | 19:47 |
ignas | and gets no traceback | 19:47 |
*** faassen has quit IRC | 20:21 | |
*** mgedmin has joined #schooltool | 20:24 | |
*** didymo has joined #schooltool | 20:36 | |
*** jinty has left #schooltool | 20:57 | |
* mgedmin hath achieved enlightenment | 21:06 | |
mgedmin | if you have an old sandbox, your Zope3 subdir will continue pointing at Zope3 trunk | 21:07 |
mgedmin | if you make fresh checkout, the Makefile will check out the Zope 3.2 branch for you | 21:07 |
mgedmin | some tests fail with Zope 3.2, and work with trunk | 21:07 |
th1a | I need a good example of how to set up functional tests in SchoolTool. | 21:09 |
mgedmin | what do you mean? | 21:10 |
th1a | I mean, as far as the setup and such that is necessary. | 21:11 |
th1a | I need a functional test to see if I can adapt things from different packages correctly. | 21:11 |
mgedmin | ok | 21:11 |
mgedmin | first you need to decide where to put your new test | 21:12 |
mgedmin | (it should live in a 'ftests' subpackage of some package) | 21:12 |
th1a | It 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 |
mgedmin | then you need to create a text file | 21:13 |
mgedmin | (restructured text) | 21:13 |
mgedmin | you can assume that Zope 3 has been set up there | 21:13 |
mgedmin | if you want to test adaptation | 21:13 |
mgedmin | you 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 |
th1a | What do you mean I can "assume that Zope 3 has been set up there?" | 21:14 |
mgedmin | the adapter registry has been configured (by zcml) | 21:14 |
mgedmin | there is a in-memory database (reachable by calling getRootFolder()) | 21:14 |
mgedmin | and there's an empty application object in that database | 21:14 |
mgedmin | (actually this application object is what is returned by getRootFolder() in our ftests) | 21:15 |
mgedmin | so if you want to test adapter registrations in ZCML | 21:15 |
mgedmin | you can do this in a straightforward manner: | 21:15 |
mgedmin | >>> from schooltool.somewhere import SomeContentObject | 21:15 |
mgedmin | >>> from schooltool.somewhere.interfaces import ISomeInterface | 21:15 |
mgedmin | >>> obj = SomeContentObject() | 21:15 |
mgedmin | >>> adapter = ISomeInterface(obj) | 21:16 |
mgedmin | >>> adapter.doSomeStuff() | 21:16 |
mgedmin | etc. | 21:16 |
th1a | Do I have to do some other setup somewhere else? | 21:16 |
mgedmin | it depends | 21:16 |
th1a | I can just add a text file to ftests and it'll work? | 21:16 |
mgedmin | yes | 21:16 |
mgedmin | you might have to do some other setup | 21:16 |
mgedmin | if your adapter expects something more | 21:17 |
mgedmin | e.g. if your adapter calls getSchoolToolApplication() and tries to figure out the default timetable | 21:17 |
mgedmin | or if your adapter wants the object to have been added to some container | 21:17 |
mgedmin | etc. | 21:17 |
th1a | What would I have to do then (generally)? | 21:18 |
*** toothpick has joined #schooltool | 21:19 | |
toothpick | I doownloaded the live version of schooltool, but don't see docs on how to use it | 21:20 |
th1a | The LiveCD? | 21:20 |
mgedmin | th1a, the only generic answer to your question is "do what's necessary" | 21:21 |
mgedmin | then there are specific answers to specific questions | 21:21 |
th1a | Well, let's say that I wanted to getSchoolToolApplication() and figure out the default timetable. | 21:23 |
th1a | toothpick: Did you download the LiveCD? | 21:24 |
mgedmin | th1a, in that case, you'd first have to create the default timetable (say, using zope.testbrowser, or the RESTive api, or whatever) | 21:25 |
mgedmin | then do | 21:25 |
mgedmin | >>> app = getRootFolder() | 21:25 |
mgedmin | >>> from zope.component.hooks import setSite | 21: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 necessary | 21:26 |
mgedmin | hm... strike the 'del app' bit | 21:26 |
th1a | But there isn't some kind of setup function I can call that automatically does that stuff? | 21:26 |
mgedmin | th1a, no | 21:26 |
th1a | OK. That's what I needed to know. | 21:26 |
mgedmin | there's no way to figure out what needs to be done in each specific case | 21:27 |
toothpick | th1a yes | 21:27 |
toothpick | I have it running on the machine next to me | 21:27 |
mgedmin | when you call internal functions directly, there is no way to automatically determine what sort of environment that function expects | 21:27 |
th1a | I know, I just need to know what direction I'm looking for answers. | 21:27 |
th1a | toothpick: So you got it running? | 21:27 |
mgedmin | then you use the proper external API (i.e., browser/rest views), then everything is done automatically | 21:27 |
toothpick | I booted the cd th1a...can't find docs on it | 21:28 |
th1a | There's not much to say about it... It has SchoolTool and SchoolBell installed. | 21:28 |
th1a | There are shortcuts on the desktop. | 21:28 |
toothpick | The schoolbell shortcut works | 21:28 |
toothpick | the schooltool does not | 21:28 |
th1a | The login/password is "manager/schooltool" or "manager/schoolbell" | 21:29 |
th1a | What happens with SchoolTool? | 21:29 |
th1a | It certainly ought to be working. | 21:29 |
th1a | There's no trick ;-) | 21:29 |
toothpick | strange | 21:29 |
toothpick | now it is working, I was getting could not connect to local host | 21:29 |
th1a | It might have taken a long time to start (a wild guess). | 21:30 |
*** thisfred has quit IRC | 21:31 | |
povbot` | /svn/commits: * alga committed revision 5444: | 21:32 |
povbot` | /svn/commits: Finished the section absences API. | 21:33 |
toothpick | I got it now | 21:38 |
*** toothpick has quit IRC | 21:39 | |
*** mgedmin has quit IRC | 21:44 | |
*** ignas has quit IRC | 21:53 | |
*** alga has quit IRC | 22: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 IRC | 23: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!