IRC log of #schooltool for Sunday, 2006-02-19

jelkner lhuynh jelkner *** jelkner has joined #schooltool 00:57 *** jelkner has quit IRC 00:57 *** pcardune has joined #schooltool 02:19 *** pcardune has quit IRC 05:34 *** jinty has quit IRC 10:57 *** jelkner has joined #schooltool 16:17 *** lhuynh has joined #schooltool 16:59 lhuyng: good morning linda! 17:00 hello 17:00 you're an hour early 17:00 well, I have some homework to do, also 17:00 me too 17:00 so I'll skulk around here until then 17:00 ok, let me not disturb you then... 17:00 :) 17:01 *** flint has joined #schooltool 17:10 flint :) 17:10 lhuynh, hi there!!! 17:10 lhuynh, flint, i just sent an email to david muffley about gasp.  i cc'd both of you 17:11 flint: i created a lauchpad project for gasp 17:12 now the trick will be to learn how to use it! ;-) 17:12 i suggested to david that you might be able to help him with that 17:12 jelkner: we were supposed to do anything before interfaces.py? 17:17 you mean in timeclock? 17:17 not sure 17:17 it says it can't import zope.schema 17:17 what says? 17:18 when I "python interfaces.py" it 17:18 back up a bit, are you working on timeclock? 17:18 i'm just looking it over 17:18 are you logged into maddog? 17:18 yes 17:19 hold on then... 17:19 lhuynh: let's go over this step-by-step 17:21 1. can you start your zope instance with runzope? 17:21 how would I do that? 17:21 from your home directory, you'd type:  ./zope3/bin/runzope 17:22 what's supposed to happen? 17:23 it worked 17:23 you should get some message about zope starting on port 8080 17:24 okay 17:24 point your web browser to: http://maddog.yhspatriot.net:8080 17:24 well? 17:25 it's loading 17:25 ahh yes, dial-up :-( 17:26 a blank page shows up 17:26 it shouldn't be blank 17:27 it should be mostly blank 17:27 alright, I agree that is 17:27 click login 17:27 on the upper right 17:28 and then i sign in 17:28 yup 17:28 the login changes to manager 17:28 yes 17:28 ok, that's all you need to do with that for now... i just wanted to make sure your instance was setup and you could login... good 17:29 so this means I should be able to access zope.schema, right? 17:30 now you should go over the lesson from last week: http://ypal.net/zope3class/12february2006 17:30 elkner, got an x problem, be right back... 17:30 *** flint has quit IRC 17:30 my interfaces.py matches the most recent version 17:30 go over this lesson from the beginning 17:30 good 17:31 how would I quit onto the command line? 17:33 -c 17:34 * lhuynh grins 17:34 jelkner, will all your classes be at this site?  http://ypal.net/zope3class/12february2006 17:35 tiredbones: all of paul's zope3 classes will be on that site, yes 17:35 eventually we will move them to ibiblio 17:36 jelkner, thanks 17:36 but only after the class is finished 17:36 *** flint has joined #schooltool 17:39 there, I am back and a bit better organized.... 17:39 lhuynh, hey Good Morning LInda! 17:40 hello :) 17:40 where the hell did Elkner go? 17:40 * jelkner is working, and thus actively ignoring flint until he says something useful ;-) 17:41 Just ignoring flint can be considered actual work.  Sadly you cannot get paid for ignoring flint, or I would do it myself... :^) 17:42 * tiredbones bookmark 17:43 yet ignoring flint does often "payoff", none the less... 17:44 the payoff of ignoring flint hm...  think if you ignore flint for long enough, you will DIE!!! :^) 17:45 http://www.network-theory.co.uk/docs/pytut/tut_51.html 17:46 i've been looking for a good explaination of python's packaging mechanism, and strangly, most books/tutorials don't contain one 17:47 *** pcardune has joined #schooltool 17:47 good morning, teach! 17:47 hi jelkner 17:47 jeff what is the url of your work of last weeks dialogs? 17:48 http://ypal.net/zope3class/12february2006 17:48 jeff thanks,  I had some "family issues" the last few days and have been living my life in "mph mode" eh? 17:50 mph mode is where you stop measuring your lilfe in hours and switch to "miles per hour"... 17:50 soo... what do you guys think of the new intel macs? 17:51 pcardune, there is an inherant evil in any monopoly... or we would not be here. 17:52 lol 17:52 pcardune, the evil in this one is dye heat.  ppc's are very interesting at a physical level. 17:53 pcardune, I would avoid counting them out.  I myself have been spending time with the VIA Corefusion products, which you may know by the old name of Cyrix. 17:54 pcardune, on another subject, can you help me get the logon right for "http://64.5.53.104:8080/@@contents.html" ? 17:55 pcardune, I am about to hack the principals.zcml file... 17:55 have you tried username:gandalf and password:123? 17:55 pcardune, absolutely, try it yourself... 17:56 17:56 something like that should be in your principals.zcml file 17:57 so is everyone here? 17:59 of who is supposed to be here? 17:59 I'm awake 17:59 I'm confused... 17:59 we are missing will and david woo 18:00 robbie will join us late 18:00 ok 18:00 pcardune, the ubuntu install allows you to set this password.  I finally got it.  There is no default. 18:00 ok, it is 11 am 18:01 take it away pcardune! 18:01 jelkner, Jeff's impersonation of Ed McMahon... 18:01 ok, so i believe the place we left of with last week was having written the interfaces 18:02 for our Person object and its corresponding container 18:02 http://ypal.net/zope3class/InterfacesPy 18:02 what have we done with the configuration file?  anything? 18:03 nothing. 18:03 what configuration file? 18:03 ok, nevermind... we will work with tests at the moment 18:04 So, now is the perfect time in the XP way to write tests for our implementation of the IPerson interface 18:04 pcardune, at the risk of annoying both you and Stephan, lets review some of the words and concepts you are throwing around here... 18:04 since we haven't written the implementation yet :) 18:05 flint: sure 18:05 ok, an interface is the first thing we wrote eh? 18:05 correct 18:05 an interface stores what it gathers in a container. 18:05 an interface defines a "contract" 18:06 the container is related to a storage object oh yea the contract. 18:06 ok all i know about containers for certian is that they all begin with a capital "I" by convention. 18:07 all interfaces being with a capital I, and yet it is by convention 18:07 s\being\begin 18:08 s\yet\yes 18:08 ok, teacher, let's go on 18:09 Imagine if you just wanted to get a freaking web site operational?  Would you not want to know something like website= browser, zcml, code, test, and btrieve? 18:09 so, you were about to write a test 18:10 i'm ready to see that 18:10 jelkner, elkner please then explain the proper answer to the question website = ! 18:10 flint: just sit back and come along for the ride 18:11 flint: i'm going to say no you don't, unless you want to play with magic... in which case you can look at the "boring" product (it's actually called boring) for the simplest example of a product 18:11 jelkner, most computer folks write books backwards, I want to build a timesheet product I do not care about tests.  the education process should explain why I should care about tests. 18:11 we care about tests because tests drive our code 18:11 we want code, so we need tests first 18:11 let's go 18:11 in the XP fashion 18:12 ok, anyways 18:12 so, everyone should create a test.py file in their timeclock folder 18:12 no, this dogmatic approach serves no one but the faithful.  richter creates tests and puts nothing in them.  lets go and do the exact same thing. 18:12 ok, i've got it 18:13 flint: that's what we are going to do 18:13 so, import the following classes: 18:14 pcardune, I always a bit of a dicipline problem... 18:14 unittest 18:14 zope.testing.doctest 18:14 zope.testing.dostestunit 18:14 zope.app.testing.setup 18:14 the primary way of doing unit tests nowadays is with what are called doctests 18:14 they serve as documentation and tests for your product 18:15 next, in your test.py file add the functon 18:15 is it dostestunit or doctestuint? 18:15 def setUp(test): 18:16 setup.placefulSetUp() 18:16 doctestunit 18:16 not doctestuint ;) 18:16 I will admit that setting up the test.py file can be a b it like playing with magic at first 18:17 i will explain in a moment what all this means 18:17 next, add the function: 18:17 def tearDown(test): 18:17 setup.placefulTearDown() 18:17 pcardune, use majic in the context of something with meaning.  at this stage we do not know what we are testing or why... this is not right. 18:17 so, what we are going to test is our currently non-existant implementation of IPerson and IPersonContainer 18:18 (the first tests should always fail to pass, if you are programming in the XP sense) 18:18 refer questions about XP to jelkner ;) 18:18 is this a good time to check the file? 18:19 jelkner: not yet 18:19 that is like refering questions about Christianaty to Christ :^) 18:19 def test_suite(): 18:19 return unittest.TestSuite(( 18:19 doctest.DocFileSuite('README.txt', 18:19 setUp=setUp, tearDown=tearDown, 18:19 globs={'pprint': doctestunit.pprint}, 18:19 optionflags=doctest.NORMALIZE_WHITESPACE| 18:19 doctest.ELLIPSIS), 18:19 )) 18:19 ok, so once you have that in your file we can check it 18:20 your file should have three functions: setUp, tearDown, test_suite 18:20 depending on how much experience all of you have with unittest, this idea of setUp and tearDown should be familiar 18:20 if you haven't had as much experience:  often with unittests we want to setup some kind of environment for the tests to run in 18:21 sometimes this includes writing helper functions for the tests 18:21 pcardune, what are you testing for? 18:22 flint, syntax?  why not just run the program and allow python to find syntax errors? 18:22 flint: we are testing the implementation of IPerson 18:22 we are going to do that in with a doctests 18:22 doctests require some extra setup, which comes in test.py 18:23 ok, iperson is an interface with two objects eh?  (I am not trying to be dense this comes naturally :^) 18:24 at the moment I'm not going to get into what placefulSetUp and placefulTearDown does because it is a bit involved it will just make you confused 18:24 IPerson is an interface that defines a contract for two attributes 18:24 pcardune, excellent! I would not want to be confused at this stage... 18:25 Interfaces do not have objects 18:25 they are a very abstract thing... it's like programming an idea 18:25 pcardune, "IPerson is an interface that defines a contract for two attributes" thanks that I understand 18:25 thus we are teseting this statement "IPerson is an interface that defines a contract for two attributes" 18:26 ok, do looking at the test_suite function 18:26 we simply return a testsuite with a DocFileSuite object.  I'm going to be very brief on this... If you need to know more about how unittests work, you can look that up outside of class.  There are lots of great websites 18:27 don't worry about what the code means, just know that it will be useful for us 18:28 finally, write at the bottom of your test.py file: 18:28 pcardune, I do not mean to rattle you, as the teacher I am asking you for clarity. 18:28 if __name__ == '__main__': 18:28 unittest.main(default='test_suite') 18:28 flint: I know, thank you for asking even if others resent your questions ;) 18:28 this last part just makes it so we can type at the command prompt "python test.py" and it will run our tests for us 18:29 it's important to understand that test.py doesn't actually contain tests 18:29 and is not going to contain tests 18:29 it is simply a setup for doctests which reside in a totally separate file 18:29 lol 18:30 now we will look at that file 18:30 make the file: README.txt 18:30 is now a good time to check our file? 18:30 tests.py 18:31 jelkner: yes, and rename it to test.py (so we all have the same thing) 18:31 ok, give me a minute to post it 18:31 the 'README.txt' isn't the same one in the zope3 directory, right? 18:32 correct 18:32 if you want an example of what a really good README.txt file looks like, you can look at src/zope/app/apidoc/README.txt 18:33 lhuynh, linda I think we are supposed to be in the /home/zope/src directory... 18:33 really? *was still in timeclock* 18:33 actually, we should be in timeclock 18:34 lhuynh, linda I think we are supposed to be in the /home/zope/src/timeclock directory... my correction. 18:34 http://ypal.net/zope3class/TestPyV01 18:34 $HOME/zope3/lib/python/timeclock is the directory 18:35 alright 18:36 jelkner: there is a problem with the tag... it does not show quote marks 18:36 for example, around README.txt 18:36 hmm... let me deal with that later 18:37 if everyone reloads that page, i just added something at the bottom 18:37 right now we want to create READM.txt in$HOME/zope3/lib/python/timeclock, yes?                                                                                                                                                                                                                    18:37
yes                                                                                                                                                                                                                                                                                                18:39
I suppose TESTME.txt would be too dam obvious..                                                                                                                                                                                                                                                    18:39
:^)                                                                                                                                                                                                                                                                                                18:39
flint: well, convention is you put the tests in README.txt because your tests should be written so well, that you should be able to read them like a book and figure out how stuff works                                                                                                           18:40
pcardune, right... :^)                                                                                                                                                                                                                                                                             18:41
ok, if you run python test.py now, it tells you it ran 0 tests.                                                                                                                                                                                                                                    18:41
good                                                                                                                                                                                                                                                                                               18:41
so what should our first test look like?                                                                                                                                                                                                                                                           18:42
so, our first test can be creating a Person                                                                                                                                                                                                                                                        18:42
actually mine said "No module named zope.testing.doctest                                                                                                                                                                                                                                           18:43
"                                                                                                                                                                                                                                                                                                  18:43
So, generally you would have documentation explaining the purpose of the Person object and so on and so forth                                                                                                                                                                                      18:43
we will get right to the tests                                                                                                                                                                                                                                                                     18:43
flint: is zope in your python path?                                                                                                                                                                                                                                                                18:43
so, after having written about the Person object, we write the tests                                                                                                                                                                                                                               18:45
the great thing about doctests is that the tests look just like a python interpreter shell                                                                                                                                                                                                         18:45
which means, to write the first test, start a new line, indent a few spaces, and write >>>                                                                                                                                                                                                         18:46
so our first line can be >>> from timeclock.person import Person                                                                                                                                                                                                                                   18:46
inside a docstring, yes?                                                                                                                                                                                                                                                                           18:47
or not                                                                                                                                                                                                                                                                                             18:47
we put the docstrings at the top/bottom of code?                                                                                                                                                                                                                                                   18:47
we are editing an empty file name README.txt, what to we put in it?                                                                                                                                                                                                                                18:48
The TimeClock Application                                                                                                                                                                                                                                                                          18:50
===========================                                                                                                                                                                                                                                                                        18:50
This application stores hours that people have worked                                                                                                                                                                                                                                              18:50
Creating Person Objects                                                                                                                                                                                                                                                                            18:50
-----------------------                                                                                                                                                                                                                                                                            18:50
A Person object stores information about a person who works                                                                                                                                                                                                                                        18:50
>>> from cando.virginia import interfaces, competency                                                                                                                                                                                                                                              18:50
something like that                                                                                                                                                                                                                                                                                18:50
you can use your own creativity with the sentances                                                                                                                                                                                                                                                 18:50
jelkner, jeff, I actually am using your good notes from last week.  but I am stuck.  if you go ahead you will loose me.                                                                                                                                                                            18:50
flint: we need to go ahead                                                                                                                                                                                                                                                                         18:51
i'll write them up again and this time, read them *during* the week!                                                                                                                                                                                                                               18:51
lhuynh: linda, how are you doing?                                                                                                                                                                                                                                                                  18:52
following...                                                                                                                                                                                                                                                                                       18:52
jelkner, To do your assignment here does Cando need to be tunning?                                                                                                                                                                                                                                 18:52
s/tunning/running/                                                                                                                                                                                                                                                                                 18:53
tiredbones: no                                                                                                                                                                                                                                                                                     18:53
I'm not sure if the commands are supposed to be put in docstrings at the top or bottom of the README.txt file                                                                                                                                                                                      18:53
in fact, paul's last line was a mistake                                                                                                                                                                                                                                                            18:53
we are not doing cando here                                                                                                                                                                                                                                                                        18:53
oh yeah... woops that was a pretty big mistake                                                                                                                                                                                                                                                     18:53
I have done what you said in the tutorial and I am still coming up wrong.                                                                                                                                                                                                                          18:53
flint: what are you getting? i want to see if I'm getting the same thing                                                                                                                                                                                                                           18:53
thanks for the support. Jeff.                                                                                                                                                                                                                                                                      18:53
lhuynh, here ya go...                                                                                                                                                                                                                                                                              18:54
root@docbox:/home/zope/src/timeclock # python test.py                                                                                                                                                                                                                                              18:54
Traceback (most recent call last):                                                                                                                                                                                                                                                                 18:54
File "test.py", line 2, in ?                                                                                                                                                                                                                                                                       18:54
import zope.testing.doctest                                                                                                                                                                                                                                                                        18:54
ImportError: No module named zope.testing.doctest                                                                                                                                                                                                                                                  18:54
root@docbox:/home/zope/src/timeclock #                                                                                                                                                                                                                                                             18:54
the idea here is your tests suck.                                                                                                                                                                                                                                                                  18:54
flint: this is what we talked about last week                                                                                                                                                                                                                                                      18:54
I did what we talked about last week.  want to see my damn .bashrc?                                                                                                                                                                                                                                18:55
you didn't set your PYTHONPATH                                                                                                                                                                                                                                                                     18:55
yes                                                                                                                                                                                                                                                                                                18:55
I even tried to put the line in the code itself                                                                                                                                                                                                                                                    18:55
lhuynh: the README.txt file is one big doctest, and it doesn't matter where you put the actual commands                                                                                                                                                                                            18:55
I specifically put the PYTHONPATH in my bashrc.                                                                                                                                                                                                                                                    18:55
that is not the way to make this stuff work.  I suspect that because I have shelled to root your damn code does not work!!!!~                                                                                                                                                                      18:56
flint, to check import sys, then sys.path.                                                                                                                                                                                                                                                         18:56
should say: export PYTHONPATH=/usr/local/src/Zope3/src:$HOME/zope3/lib/python 18:56 flint: you need to deal with this *before* class. 18:56 we need to make progress today 18:57 tiredbones, AH! at last a test i can understand!!!!! 18:57 jelkner, no jeff we need to learn. 18:57 flint: by not doing your homework, you hold the whole process up 18:57 that's not fair to the rest of us 18:57 jelkner, I did my homework as assigned that is not correct. now fix the problem not the blame. 18:58 *** wrobel has joined #schooltool 18:58 jelkner, Is this a class in some college? 18:58 tiredbones: nope... they don't teach this anywhere 18:59 tiredbones, no it is funded by the cando project 18:59 we are using it to train future cando developers 18:59 so we really do need to move, or the project will not be able to move 18:59 we want to do a sprint in the summer 19:00 now, i made a mistake earlier. the file should be tests.py with an s... not test.py. otherwise the zope testrunner will not work... we will get to that in a second 19:00 so the participants need to be able to write zope3 code by then 19:00 tiredbones, I have the following line and am now so rattled I cannot even type well... 19:00 >>> sys.path 19:01 ['', '/usr/local/src/Zope3/src', '/usr/local/lib/python24.zip', '/usr/local/lib/python2.4', '/usr/local/lib/python2.4/plat-linux2', '/usr/local/lib/python2.4/lib-tk', '/usr/local/lib/python2.4/lib-dynload', '/usr/local/lib/python2.4/site-packages'] 19:01 please pcardune, let's move on... 19:01 the path you suggest is not there, likely because i shelled to root to do this. let me shell out and try again... 19:01 jelkner, why are you writing code that does not work as root? (if that is the case) 19:02 ok, so once you have changed the name of the test.py file to tests.py (with an s) we can try running the test 19:02 which test? 19:02 the one in README.txt 19:02 all it does is import timeclock.person 19:02 that had cando in it? 19:02 yes, right, i forgot to fix that 19:03 it should read... 19:03 The TimeClock Application 19:03 =========================== 19:03 This application stores hours that people have worked 19:03 Creating Person Objects 19:03 ----------------------- 19:03 A Person object stores information about a person who works 19:03 >>> from timeclock.person import Person 19:03 flint,I'm soory, but I should not distrupt this forum. 19:03 so, is everyone on the same page? 19:04 still says ran 0 tests for me 19:04 tiredbones, you are the only one helping me. please continue. They are all on a box that elkner has set up. I am on an independent box. they may have something set I do not. 19:05 your tests.py file, should look like the one on the wiki 19:05 also, don't run the test just by running tests.py 19:06 we want to use the zope test runner to run our tests 19:06 if you go to your zope instance directory 19:07 I think the TestsPyV01 site disappeared 19:07 you can type "python bin/test -vpu --dir lib/python/timeclock" 19:07 flint, try somthing like sys.append(pathename). 19:07 lhuynh: you're right... it did disappear. jelkner, what happened to it? 19:08 i'm fixing the names 19:08 first is wast tests.py, then test.py, now it is going back to test.py 19:09 give me a minute 19:09 tiredbones, the /usr/local/src/Zope3/src does not exist. I have Python at that level. 19:09 let me figure where Zope3/src is kept on this machine and maybe fix this problem. 19:10 flint, do a find on Zope3. 19:10 flint: we're supposed to have a Zope3/src directory? 19:10 http://ypal.net/zope3class/TestsPy 19:11 pcardune: is this correct now? 19:11 lhuynh, I have no idea. 19:11 jelkner: yes, that looks correct 19:12 lhuynh: no, linda 19:12 lhuynh, linda are you having problems as well? 19:12 the system on which you are working (maddog) has the zope3 source in /usr/local/src/Zope3/src 19:12 your personal instance is in$HOME/zope3                                                                                                                                                                                                                                                           19:12
jelkner, my machine does not.                                                                                                                                                                                                                                                                      19:13
flint: it would be *much* easier for you if you would set things up like in the notes                                                                                                                                                                                                              19:13
otherwise, you will always have problems                                                                                                                                                                                                                                                           19:13
jelkner, it would be much easier if we were all using the same machine, then these bugs would turn up during implementation! :^)                                                                                                                                                                   19:14
jelkner, this is not in the notes, I am looking at them.                                                                                                                                                                                                                                           19:14
look again                                                                                                                                                                                                                                                                                         19:14
i will quote                                                                                                                                                                                                                                                                                       19:14
Prerequisites:                                                                                                                                                                                                                                                                                     19:15
* A runnable instance of zope3 (see https://wiki.ubuntu.com/LearningZope3 for how to set this up on Ubuntu Breezy or Dapper)                                                                                                                                                                       19:15
and: Good morning, everyone, let's start learning to program in Zope3! To begin with, I will assume you each have read https://wiki.ubuntu.com/LearningZope3 and have a running instance of zope3 in your home directory in a subdirectory called zope3                                            19:16
jelkner, my setup of Zope3 is running in /home/zope                                                                                                                                                                                                                                                19:16
jelkner, that is how the ubuntu install set it up.                                                                                                                                                                                                                                                 19:16
flint: please, we only have 45 minutes left                                                                                                                                                                                                                                                        19:17
jelkner, did it strike you as odd that everyone has a $HOME instance? 19:17 jelkner, this is a problem for anyone not running on maddog. 19:18 pcardune: what about README.txt? 19:18 jelkner: could you upload the README.txt file to the wiki 19:18 it should look like what I wrote above 19:18 will do 19:19 tiredbones, the problem is that they each have$HOME/Zope3/src driectories and my docbox.flint.com does not have this.  thanks.                                                                                                                                                                    19:20
pcardune, jelkner, If I get update with you folks would you mind if I participate?                                                                                                                                                                                                                 19:20
it's fine with me                                                                                                                                                                                                                                                                                  19:21
flint, if you have Zope3 installed point your system at it.                                                                                                                                                                                                                                        19:21
that would be great                                                                                                                                                                                                                                                                                19:21
how is this?                                                                                                                                                                                                                                                                                       19:22
that looks great                                                                                                                                                                                                                                                                                   19:22
I thought pcardune said the entire thing is in docstrings?                                                                                                                                                                                                                                         19:22
pcardune, do you have email I could possible ask some question while I'm setting up?                                                                                                                                                                                                               19:22
tiredbones, I have /home/flint/src/Zope-3.2.0/                                                                                                                                                                                                                                                     19:22
lhuynh: you don't have to write the quotations because the whole document is a docstring                                                                                                                                                                                                           19:22
tiredbones: yeah, paulcarduner@gmail.com                                                                                                                                                                                                                                                           19:23
pcardune: oh, okay                                                                                                                                                                                                                                                                                 19:23
pcardune, I am very frustrated.  you are on maddog too eh?                                                                                                                                                                                                                                         19:23
flint: no, I am on my own box                                                                                                                                                                                                                                                                      19:23
pcardune: what next?                                                                                                                                                                                                                                                                               19:24
pcardune, thanks.  I will continue to troubleshoot.                                                                                                                                                                                                                                                19:24
ok, now you can try running the test using the zope test runner                                                                                                                                                                                                                                    19:24
if you go to your instance home                                                                                                                                                                                                                                                                    19:24
type:                                                                                                                                                                                                                                                                                              19:25
python bin/test -vpu --dir lib/python/timeclock                                                                                                                                                                                                                                                    19:25
python: can't open file 'bin/test': [Errno 2] No such file or directory                                                                                                                                                                                                                            19:26
are you in your instance home?                                                                                                                                                                                                                                                                     19:27
I got that, also                                                                                                                                                                                                                                                                                   19:27
you mean /usr/local/src/Zope3/src or $HOME/zope3 ? 19:27$HOME/zope3                                                                                                                                                                                                                                                                                        19:27
there should be a folder called bin in there                                                                                                                                                                                                                                                       19:28
jelkner, I am not logging off this is too damn much fun to watch :^)                                                                                                                                                                                                                               19:28
pcardune, would it be possible to write a test to validate paths?                                                                                                                                                                                                                                  19:29
pcardune, What is the name of the instance that you are useing for this class?                                                                                                                                                                                                                     19:29
$python bin/test -vpu --dir timeclock 19:29 Running tests at level 1 19:29 Test-module import failures: 19:29 Module: timeclock.tests 19:29 NameError: global name 'doctest' is not defined 19:29 Total: 0 tests, 0 failures, 0 errors 19:29 Test-modules with import problems: 19:29 timeclock.tests 19:29 flint: i suppose it would be possible 19:29 pcardune, you understand why I feel this might be valuable, eh Professore? 19:30 ok, there were actually a few errors in the tests.py file 19:30 pcardune: it couldn't find timeclock if i typed lib/python/timeclock 19:31 more path issues 19:31 heh 19:31 flint: yes, paul, this is hard. 19:31 http://ypal.net/zope3class/TestsPy now shows it correctly 19:32 it is even harder if you don't prepare ahead of time! 19:32 jelkner, I did not know this problem existed until I started this meeting. did you? 19:33 pcardune, how would we test for proper path? 19:33 yes 19:33 we talked about it last week, paul 19:33 and *then* i tried to write up docs that would help 19:33 *** eeblefish has joined #schooltool 19:34 robbie, welcome 19:34 hello :) 19:34 flint: your test would probably end up being to rigid to work on lots of platforms 19:34 Finally got here! : ) 19:34 flint: it would be a bit challenging 19:34 what we are testing for this the abililty to get to the Zope3 binaries eh 19:35 so jelkner, with those changes to tests.py, what is your output after running the test? 19:36$ python bin/test -vpu --dir timeclock                                                                                                                                                                                                                                                             19:36
Running tests at level 1                                                                                                                                                                                                                                                                           19:36
Test-module import failures:                                                                                                                                                                                                                                                                       19:36
Module: timeclock.tests                                                                                                                                                                                                                                                                            19:36
NameError: global name 'doctest' is not defined                                                                                                                                                                                                                                                    19:36
Total: 0 tests, 0 failures, 0 errors                                                                                                                                                                                                                                                               19:36
Test-modules with import problems:                                                                                                                                                                                                                                                                 19:37
timeclock.tests                                                                                                                                                                                                                                                                                    19:37
I got something similiar:                                                                                                                                                                                                                                                                          19:37
please look at http://ypal.net/zope3class/TestsPy again                                                                                                                                                                                                                                            19:37
the problem was that we were using explicit python imports, but making implicit function calls                                                                                                                                                                                                     19:41
as in, if you import zope.testing.doctest, you cant say just doctest.DocFileSuite(....) but have to write zope.testing.doctest.DocFileSuite(.....)                                                                                                                                                 19:42
$python bin/test -vpu --dir timeclock 19:43 Running tests at level 1 19:43 Running unit tests: 19:43 Running: 19:43 1/1 (100.0%) /home/jelkner/zope3/lib/python/timeclock/README.txt 19:43 Error in test /home/jelkner/zope3/lib/python/timeclock/README.txt 19:43 Traceback (most recent call last): 19:43 File "/usr/lib/python2.4/unittest.py", line 251, in run 19:43 self.setUp() 19:43 File "/usr/local/src/Zope3/src/zope/testing/doctest.py", line 2179, in setUp 19:43 self._dt_setUp(test) 19:43 File "/home/jelkner/zope3/lib/python/timeclock/tests.py", line 7, in setUp 19:43 setup.placefulSetUp() 19:43 NameError: global name 'setup' is not defined 19:43 Ran 1 tests with 0 failures and 1 errors in 0.052 seconds. 19:43 yes, you have to fix all of them. which means instead of just setup.placefulSetUp, write zope.app.testing.setup.placefulSetUp() 19:43 and the same for the teardown function... it should be zope.app.testing.setup.placefulTearDown() 19:44 and your test_suite function should look like this: 19:44 def test_suite(): 19:44 return unittest.TestSuite(( 19:44 zope.testing.doctest.DocFileSuite(README.txt, 19:44 setUp = setUp, 19:44 tearDown = tearDown, 19:45 globs = {'pprint': zope.testing.doctestunit.pprint}, 19:45 optionflags = zope.testing.doctest.NORMALIZE_WHITESPACE | 19:45 zope.testing.doctest.ELLIPSIS), 19:45 )) 19:45$ python bin/test -vpu --dir timeclock                                                                                                                                                                                                                                                             19:45
Running tests at level 1                                                                                                                                                                                                                                                                           19:45
Running unit tests:                                                                                                                                                                                                                                                                                19:45
Running:                                                                                                                                                                                                                                                                                           19:45
Failed doctest test for README.txt                                                                                                                                                                                                                                                                 19:45
----------------------------------------------------------------------                                                                                                                                                                                                                             19:46
Failed example:                                                                                                                                                                                                                                                                                    19:46
from timeclock.person import Person                                                                                                                                                                                                                                                                19:46
Exception raised:                                                                                                                                                                                                                                                                                  19:46
Traceback (most recent call last):                                                                                                                                                                                                                                                                 19:46
File "/usr/local/src/Zope3/src/zope/testing/doctest.py", line 1256, in __run                                                                                                                                                                                                                       19:46
compileflags, 1) in test.globs                                                                                                                                                                                                                                                                     19:46
File "", line 1, in ?                                                                                                                                                                                                                                                       19:46
from timeclock.person import Person                                                                                                                                                                                                                                                                19:46
ImportError: No module named person                                                                                                                                                                                                                                                                19:46
Ran 1 tests with 1 failures and 0 errors in 0.116 seconds.                                                                                                                                                                                                                                         19:46
yeah, a failing test!                                                                                                                                                                                                                                                                              19:46
Exellent! your test is working perfectly!                                                                                                                                                                                                                                                          19:46
pcardune: i have a question about running this                                                                                                                                                                                                                                                     19:46
i want to work in $HOME/zope3/lib/python/timeclock 19:47 but i need to run the test from$HOME/zope3                                                                                                                                                                                                                                                        19:47
moving back and forth is a pain                                                                                                                                                                                                                                                                    19:47
can we fix this?                                                                                                                                                                                                                                                                                   19:47
so that tests can be run from our development directory?                                                                                                                                                                                                                                           19:47
they actually can be run from the development directory                                                                                                                                                                                                                                            19:48
if you are in the timeclock folder, just type                                                                                                                                                                                                                                                      19:48
../../../bin/test -vpu --dir timeclock                                                                                                                                                                                                                                                             19:48
pcardune, I think I finally understand what is wrong.  and the docs are the problem.                                                                                                                                                                                                               19:49
jelkner, the only thing worse than no docs is wrong docs... :^)                                                                                                                                                                                                                                    19:50
python $HOME/zope3/bin/test -vpu --dir timeclock works too 19:50 from anywhere 19:51 jelkner, on your system. 19:51 jelkner, anywhere does not include my system so you are wrong. 19:51 flint: on any system setup with our instructions 19:51 that was the *assumption* in the docs 19:52 if you depart from those instructions, you need to 19:52 jelkner, the instructions are wrong. 19:52 A). know enough to make adjustments 19:52 B). suffer and complain 19:52 you choose B 19:53 jelkner, you should set up timeclock in the user's directory, not the whole zope3 tree. 19:53 well, i think the class is pretty much over for today... I will send out a tar file to all of you with the timeclock package and everything you should have in it 19:53 *** ignas has joined #schooltool 19:53 pcardune: thanks again 19:53 pcardune, thanks for the help. 19:53 *** Yuy has joined #schooltool 19:54 am I back on? 19:54 yuy: yes linda 19:54 pcardune, why did we set up and individual instance of zope3 in each user space? 19:54 just in time to get our homework assignment 19:54 pcardune, I'm reading the logs for this irc noe will be in contact. 19:54 tiredbones: i'm going to turn this into a lesson and put it on the wiki 19:54 the way that zope3 setup on my machine was in /home/zope 19:55 flint: so that they each have their own instance to run... its kind of like each person having their own notebook in a math class 19:55 pcardune: homework? 19:55 pcardune, the issue is that my copy of zope did not set that way. and this is the root of the problem. 19:55 jelkner, wiki address? 19:55 tiredbones: http://ypal.net/zope3class 19:55 pcardune, I recommend that we get this licked as homework. 19:55 i'll send out the homework assignment with the tar.gz file of the timeclock app as it should be now 19:56 in the next 20 minutes or so 19:56 pcardune, I so much wanted to ask questions about chapter 13, and I instead got blindsided by this installation issue 19:56 pcardune: what does your schedule look like for tomorrow? 19:56 my calendar says presidents day 19:56 i'll give you a call so we can go over this 19:56 yes 19:57 will you be available any time? 19:57 i have off 19:57 so my schedule is flexible 19:57 in the morning i suppose, around this time 19:57 ok, 11 am my time? 19:57 flint: you can ask me all the questions you want as soon as this class is over, i'll stick around 19:57 am I wrong in saynig that a default installation of zope3 would set up in /home/zope? 19:57 jelkner: 1pm your time 19:58 so what's the homework? 19:58 ok 19:58 Yuy: i'll send it out by email 19:58 jelkner: could you give me the emails of everyone who is in the class? 19:58 great! 19:58 pcardune, we can fix this to work generally... 19:58 pcardune, flint@flint.com 19:58 i'm in a hotel room now and i need to leave 19:58 i'll get back to you tomorrow 19:59 bye everyone! 19:59 jelkner, what hotel room are you in? 19:59 ok, well, before everyone leaves, could they give me their email addresses? 19:59 bye jelkner 19:59 arellethram@gmail.com 19:59 *** jelkner has quit IRC 19:59 pcardune, can I send you my email address? 19:59 tiredbones: absolutely 19:59 robertjellison@earthlink.net, or eeblefish@gmail.com. I don't check that often though, should I? 20:00 pcardune, the idea of each of us having a "math book" is ok but would not a link from a common "math book" work better? 20:00 eeblefish: which one do you check more often? i'll send it there. 20:00 The latter one, I guess, eeblefish@gmail.com. Thanks : ) 20:01 flint: why would it work better? 20:01 are you going to send it within the next half hour? or can I check my mail tomorrow or something? 20:01 pcardune, this is like the default password thing in ubuntu install. 20:01 Yuy: i will send it in the next half hour, but you are free to check your mail tommorow 20:01 because it is then a comon link that all share. 20:01 flint: but then there won't be active learning... again with the metaphor... the teacher writes everything on the chalkboard, and everyone gets to see it... but if they want to learn anything and remember anything, it is probably a good idea for them to write down whats on the chalk board 20:02 pcardune, you would have timeclock in your local directory or your ~/src/timeclock and work on it from there. 20:03 pcardune, are all the copies of timeclock linked? mine is not. 20:03 ultimately the best thing would be for everyone to have their own copy of everything, on their own computer, and we work with gobby 20:03 where are we supposed to have this src/ folder? 20:04 the copies of timeclock are not linked 20:04 Yuy: don't worry about that, it's already set up for you 20:04 Yuy, you see on maddog you do, on my own system I do not. 20:05 flint: zope works in two ways, as a python package and as an actual server 20:05 well, that folder's not in my zope3/ folder 20:05 pcardune, the default path for the server is /home/zope 20:05 and the path works from there fine. 20:05 you might want to run 5 zope servers on your computer... but they should all be using the same python packages to run 20:05 Yuy: the src folder is located where zope is installed. your zope3 folder is just an instance of zope 20:06 ubuntu installed those common packages in /home/zope 20:06 pcardune, believe me I would not have put them there... 20:07 flint: yeah... neither would I... that is kind of strange 20:07 flint: anyways, as long as the python path points to that directory, then the zope python package is installed 20:07 flint, you could delete it all and go to the Zope site to dowload is where you want. 20:08 so, back to running 5 servers on the same machine... they are different servers, with different databases, but they all run with the same python package... 20:08 pcardune, flint: anything else I need to stay around for? 20:08 I can get the IRC log later 20:08 Yuy: nope, you are free to go 20:08 class dismissed 20:08 *** Yuy has quit IRC 20:09 *** eeblefish has quit IRC 20:10 so, on maddog, that is how it's been set up. each user has their own zope server to mess around with 20:10 but they all use the same python package 20:10 flint: does that make sense? 20:10 pcardune, I sent you my email address. 20:11 *** lhuynh has quit IRC 20:12 tiredbones: ok great 20:13 pcardune, jeff just called and yelled at me for 5 minutes. you got a phone number? 20:13 pcardune, I'll run my own copy of Zope so that you folks don't have to bother with setting up things on your server. 20:14 the python package is not the problem. python is loading and running just fine 20:14 tiredbones: good 20:14 tiredbones, that is what got me in dutch with the group. 20:14 flint: yeah i do 20:14 i'll email it to you 20:14 pcardune, but I am proud of this. I suspect that there is a problem with the setup. thanks for the number. Glad that I can still get elkner worked up. 20:15 did you ever doubt that you couldn't? 20:16 pcardune, elkners instructions begin with "# cd$HOME/zope3/lib/python                                                                                                                                                                                                                             20:16
"                                                                                                                                                                                                                                                                                                  20:16
pcardune, and I am truly sorry I pissed you off.                                                                                                                                                                                                                                                   20:16
so each person has a lib python?                                                                                                                                                                                                                                                                   20:16
~/lib/python                                                                                                                                                                                                                                                                                       20:17
flint: oh no, you didn't make me angry or anything.  there is a problem, its just something that should be handled in a query ;)                                                                                                                                                                   20:17
flint: yes, each person has a lib/python                                                                                                                                                                                                                                                           20:17
so, when you create a zope instance you can add whatever python packages to your zope instance... they live in $ZOPE_INSTANCE_HOME/lib/python 20:18 where ever your zope instance home happens to be 20:18 ok let me move my stuff from /home/zope/lib/python/timeclock to this place 20:19 pcardune, Was Feb. 12 the first class you had? 20:19 tiredbones: yes 20:19 tiredbones, well not exactly but lets say so. 20:19 flint: what you should do is a make a zope instance for yourself in your home directory 20:20 i bet the mkzopeinstance executable is even in your path already 20:20 pcardune, So if I read everything and do all the assignments I should be ok? 20:21 tiredbones: yeah 20:21 now I have in my home directory "/home/flint/lib/python/timeclock 20:21 " 20:21 here is the problem: 20:22 |flint@docbox:~/lib/python/timeclock$ cd /usr/local/src/Zope3/src                                                                                                                                                                                                                                 20:22
bash: cd: /usr/local/src/Zope3/src: No such file or directory                                                                                                                                                                                                                                      20:22
pcardune, is this a problem?                                                                                                                                                                                                                                                                       20:23
not necessarily                                                                                                                                                                                                                                                                                    20:23