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