*** jelkner has joined #schooltool | 00:50 | |
*** jelkner has joined #schooltool | 00:51 | |
jelkner | anyone here know how to reach albertas? | 00:51 |
---|---|---|
jelkner | he was supposed to meet us here at ACC for dinner | 00:52 |
jelkner | but i don't have a phone number for him | 00:52 |
jelkner | he was due to arrive at 5:30 pm | 00:52 |
jelkner | 20 minutes ago | 00:52 |
*** ignas has quit IRC | 01:07 | |
*** jelkner has quit IRC | 01:23 | |
*** jfroche_ has quit IRC | 01:39 | |
*** wrobel has quit IRC | 04:01 | |
*** lisppaste5 has quit IRC | 05:45 | |
*** lisppaste5 has joined #schooltool | 05:49 | |
*** pcardune has joined #schooltool | 08:22 | |
Fujitsu | pcardune: Thanks for doing the Zope 3 classes. I find them very good :) | 08:36 |
pcardune | thanks | 08:36 |
*** pcardune has quit IRC | 09:46 | |
*** Aiste has quit IRC | 10:17 | |
*** jinty has joined #schooltool | 13:07 | |
*** filip101 has joined #schooltool | 16:50 | |
filip101 | a litle question here | 16:51 |
filip101 | when does the lesson start? | 16:51 |
filip101 | * the zope lesson | 16:52 |
*** wjohnsto has joined #schooltool | 16:59 | |
*** filip101 has left #schooltool | 16:59 | |
*** jelkner has joined #schooltool | 18:00 | |
*** jfroche_ has joined #schooltool | 18:02 | |
*** tdoggette has joined #schooltool | 18:10 | |
*** alga has joined #SchoolTool | 18:21 | |
*** alga has quit IRC | 18:24 | |
*** Matty has joined #schooltool | 18:29 | |
*** pcardune has joined #schooltool | 18:40 | |
*** Matty is now known as Matty_T | 18:42 | |
*** mlinnell has joined #schooltool | 18:43 | |
Lumiere | 'morning all | 18:50 |
*** cpcarey11 has joined #schooltool | 18:51 | |
Matty_T | hi thomas | 18:53 |
*** Lumiere changes topic to "SchoolTool development | IRC logs at http://source.schooltool.org/irclogs/ | Dev meetings Mon, 14:30 UTC (16:30 EET) | Use http://paste.lisp.org/new/schooltool for pasting | pcardune's Zope class, Saturdays at noon US/Eastern (GMT-5)" | 18:56 | |
* tdoggette salutes | 18:59 | |
*** kjcole has joined #schooltool | 18:59 | |
Lumiere | as with 2 weeks ago... | 18:59 |
Lumiere | last time I wasn't asleep at this time of the morning | 19:00 |
jelkner | Good morning everyone | 19:00 |
Lumiere | I opened #cando-help... | 19:00 |
*** aelkner has joined #schooltool | 19:01 | |
jelkner | can everyone please type: /me is <your name> | 19:01 |
* cpcarey11 is Chris Carey | 19:01 | |
* kjcole is Kevin Cole | 19:01 | |
Lumiere | please continue to use it for getting help and etc. | 19:01 |
jelkner | we need to take attendance | 19:01 |
* jelkner is Jeff Elkner | 19:01 | |
* Lumiere is insane... | 19:01 | |
* mlinnell is mary | 19:01 | |
jelkner | if you used a different nick the last 3 weeks i need to know | 19:02 |
*** AVN` has joined #schooltool | 19:02 | |
jelkner | i'm keeping records of attendance | 19:02 |
*** Preetam has joined #schooltool | 19:02 | |
*** smamo has joined #schooltool | 19:02 | |
*** jhancock has joined #schooltool | 19:02 | |
*** Mounika has joined #schooltool | 19:02 | |
* jhancock is James | 19:03 | |
* pcardune Paul Carduner | 19:03 | |
* jhancock is James Hancock | 19:03 | |
* smamo is Shitaye Mamo | 19:03 | |
* AVN` is Chris Beacha, | 19:03 | |
* tdoggette is Thomas Doggette | 19:03 | |
*** Matty_T is now known as myeatman | 19:03 | |
pcardune | who is Mounika? | 19:03 |
Mounika | mounika garlapati | 19:03 |
* aelkner is Alan ELkner | 19:04 | |
jelkner | ok, teach, take it away | 19:04 |
pcardune | hello everybody | 19:04 |
pcardune | welcome to the *fourth* week of the class | 19:04 |
pcardune | as before, we are going to briefly go over what we did last week | 19:05 |
pcardune | so, last week we created our first auto generated edit form | 19:05 |
pcardune | we also learned how to build the user interface into the ZMI using macros | 19:05 |
pcardune | finally, we added more attributes to our Contact object. | 19:05 |
pcardune | Today we will learn how to automatically test the code that we have already written using both unit tests and functional tests. So far, we have been testing our code, but only manually - by clicking on links in the ZMI and trying it out for ourselves. | 19:06 |
pcardune | Although this can work fine for a *really* small project, it is always best to write automated tests that can do more tests, more thuroughly, much faster. | 19:06 |
pcardune | Automated testing is also a vital step in the process of Test Driven Development, which in turn is a vital part of the practice of eXtreme Programming. | 19:06 |
pcardune | So far we have not done any test driven development and we have really been very bad XP'ers. But it was important to sidestep testing at first so as to not overcomplicate the first steps in creating a zope application. | 19:06 |
pcardune | In future projects, what we do in this lesson should be done before any of the other lessons. | 19:07 |
pcardune | An important aspect about testing in zope is that today people predominantly use what are called DocTests. As you can probably guess, DocTests combine both documentation and tests. | 19:07 |
pcardune | Imagine that you were walking someone through how your program works. In essence, as you walked through it with the person, you would also be trying out every feature - and therefore testing it. Doctests just take this process and formalize it into something that can be automated. | 19:07 |
pcardune | In zope3, looking at doctests is a fantastic way to learn about how something works and how to use it. | 19:08 |
Lumiere | dumb question: is there a copy of the current code I could grab? | 19:08 |
pcardune | Lumiere, yeah, check the lesson web page, there are tarballs | 19:08 |
Lumiere | kk | 19:08 |
pcardune | But enough blabbing for now, let's get on with it. | 19:08 |
pcardune | Before we write the actual tests, we are going to have to do a bit of set up. The first thing to do is to create a file called tests.py. The file should look like this: | 19:09 |
pcardune | And remember, this is all in the zcontact directory | 19:09 |
pcardune | what happened to the paste bot? | 19:09 |
pcardune | ok, i'll just paste it in here, it's not very long | 19:10 |
pcardune | import unittest | 19:10 |
pcardune | import zope.testing.doctest | 19:10 |
pcardune | def test_suite(): | 19:10 |
pcardune | return unittest.TestSuite(( | 19:10 |
pcardune | zope.testing.doctest.DocFileSuite('README.txt', | 19:10 |
pcardune | optionflags=zope.testing.doctest.NORMALIZE_WHITESPACE | | 19:10 |
pcardune | zope.testing.doctest.ELLIPSIS), | 19:10 |
pcardune | )) | 19:10 |
pcardune | here is a link to the paste: http://paste.lisp.org/display/36665 | 19:11 |
Lumiere | http://paste.lisp.org/new/schooltool | 19:11 |
lisppaste5 | pcardune pasted "tests.py" at http://paste.lisp.org/display/36666 | 19:12 |
pcardune | The main purpose of this file is to specify where our doctests will be located; specifically it says to look in the README.txt file. | 19:13 |
pcardune | The one function called test_suite returns a TestSuite object. The constructor for the TestSuite object takes as its first argument, a tuple of tests, or other test suites. | 19:13 |
pcardune | That is, test suites can be nested inside each other. | 19:13 |
pcardune | In this case, We only pass a tuple with one test suite, a DocFileSuite object, to the constructor. | 19:13 |
pcardune | All the tests will be contained in a file called README.txt. It is standard practice to put most unit tests in files called README.txt, although sometimes you will find them in other files - but always with a .txt extension. | 19:14 |
pcardune | The optionflags keyword argument specifies some options for how the test should be run, we will talk about what these options do after we have written the actual tests. | 19:14 |
pcardune | The next thing to do is to create and edit the README.txt file. Here we will be testing the most basic aspects of our objects. At the moment we only have one object - the Contact object, so the test won't be very long. In the README.txt file, write the following: | 19:15 |
lisppaste5 | pcardune pasted "README.txt" at http://paste.lisp.org/display/36667 | 19:15 |
pcardune | So far our doctest looks more like documentation that tests. At the top of every doctest you should always put a header describing something about the program or module being tested. The underlined sections are headers, one for the entire file, and one for each segement of the test. Depending on what editor you are using, it is possible to have syntax highlight for the headers, which makes them easy to find when you are looking for a specific set | 19:17 |
pcardune | of tests. | 19:17 |
pcardune | If anyone needs a second to catch up, let me know | 19:17 |
pcardune | Continue editing README.txt by adding the following: | 19:17 |
AVN` | gib me a second | 19:18 |
lisppaste5 | pcardune annotated #36667 with "README.txt continued1" at http://paste.lisp.org/display/36667#1 | 19:18 |
pcardune | As you should notice, what we have just written looks like a session from a python shell! Doctests work just like using the python shell, except that you get to write what the output should be, and you get to annotate what your commands are with documentation. | 19:19 |
pcardune | So let's talk a bit about how these tests work. The doc testing module, which processes these kinds of files, parses the file looking for bits of python code (whatever follows >>> ). | 19:20 |
Lumiere | so everything indented (your standard indentation amount) is code | 19:20 |
Lumiere | or does indentation not matter? | 19:20 |
pcardune | I put the >>> part two spaces in | 19:20 |
pcardune | all the documentation is not indented | 19:21 |
pcardune | but the python code snippets are indented | 19:21 |
pcardune | back to the python snippets. The doctest will run these snippets of python line by line. If there is output underneath a snippet, then it checks to see if the output written in the doctest is what python actually would output had you written the command in a python interpretor shell. | 19:21 |
pcardune | If they don't match, then an error is thrown and your test failed. | 19:22 |
pcardune | If any of you have written unit tests in other languages, this is just like an assert statement | 19:22 |
pcardune | except the assertion is implied by what you write in the "python prompt" | 19:22 |
pcardune | The first thing you should always test for your object is that it actually implements the IContact interface. We make sure that an instance of the object provides the interface, and that the class definition of the object implements the interface. | 19:22 |
pcardune | You may remember us talking about the difference between implements and provides... don't worry to much about it, it is mostly just a matter of nomenclature | 19:23 |
pcardune | Now let's move on and add just a few more tests: | 19:23 |
lisppaste5 | pcardune annotated #36667 with "README.txt continued2" at http://paste.lisp.org/display/36667#2 | 19:24 |
lisppaste5 | pcardune annotated #36667 with "README.txt - THE WHOLE FILE" at http://paste.lisp.org/display/36667#3 | 19:25 |
pcardune | Here we test that the attributes specified in the IContact itnerface actually exist in the implementation (Contact). They should be initialized to empty unicode strings. Remember that the constructor for the Contact class did not take any arguments to specify these values from the beginning. | 19:25 |
pcardune | Now let's try running these tests. To run the tests we will be using the zope test runner, which actually searches through a directory tree for tests and runs all of them automatically. To run the test, go to the top directory of your zope3 instance. For those following along with maddog accounts, it should be /home/yourname/zope3/. | 19:26 |
pcardune | Then type the following: | 19:27 |
pcardune | bin/test -uvvp -s zcontact | 19:27 |
Lumiere | uh so ~/zope/bin/test ? | 19:28 |
Lumiere | or zope3 | 19:28 |
pcardune | The u part stands for unit tests, vv part stands for "very verbose", and the p option gives a progress bar. The -s option allows us to search a particular package for tests. What the testrunner actually looks for are files called tests.py - not for README.txt. That is why we have to specify the README.txt file in the tests.py file. | 19:28 |
pcardune | Lumiere, is it zope or zope3? one or the other, whichever makes sense... | 19:29 |
pcardune | you shouldn't have both | 19:29 |
Lumiere | I have a different setup from most | 19:29 |
pcardune | Lumiere, oh | 19:29 |
Lumiere | I think I have zope, they have zope3 | 19:29 |
pcardune | ok | 19:29 |
pcardune | We often only want to test one python package (in the case that we have several in our instance), so the -s option is one to remember. The output of running the tests should look something like this: | 19:29 |
pcardune | Running tests at level 1 | 19:30 |
pcardune | Running unit tests: | 19:30 |
pcardune | Running: | 19:30 |
pcardune | Ran 1 tests with 0 failures and 0 errors in 0.032 seconds. | 19:30 |
pcardune | If you don't get this than there is either something wrong with your code, or wrong with the test | 19:31 |
pcardune | Now try changing some line in the tests, or some line in your Contact class so that the tests fail. Then run the tests again and see what happens. | 19:31 |
Lumiere | in the README.txt, make sure there are blank lines between python test code and text that describes things or the tester will think your description is part of a test (or vice versa) | 19:32 |
pcardune | thanks Lumiere | 19:32 |
*** jfroche_ has quit IRC | 19:33 | |
pcardune | someone should chat a *small* snippet of the output of a failed test so we all can see | 19:33 |
Lumiere | ValueError: line 20 of the docstring for README.txt has inconsistent leading whitespace: 'In providing the ``IContact`` interface, a ``Contact`` instance has the' | 19:33 |
AVN` | Module: zcontact.tests | 19:34 |
AVN` | ValueError: line 19 of the docstring for README.txt has inconsistent leading whitespace: 'In providing the ``IContact`` interface, a ``Contact`` instance has the' | 19:34 |
Lumiere | heh | 19:34 |
pcardune | normally, we would write failing tests first, | 19:35 |
lisppaste5 | Lumiere pasted "Another doctest error" at http://paste.lisp.org/display/36669 | 19:35 |
Preetam | ---------------------------------------------------------------------- | 19:35 |
Preetam | File "/home/pdsouza/zope3/lib/python/zcontact/README.txt", line 17, in README.txt | 19:35 |
Preetam | Failed example: | 19:35 |
Preetam | interfaces.IContact.implementedBy(Contact) | 19:35 |
Preetam | Expected: | 19:35 |
Preetam | False | 19:35 |
Preetam | Got: | 19:35 |
Preetam | True | 19:35 |
pcardune | ok, that's all very good | 19:35 |
pcardune | so, normally we would write failing tests first | 19:35 |
pcardune | then we would make changes to the code to make the test pass again | 19:35 |
pcardune | that way we know that the test is passing because of what we wrote in the code (and not because the test was incorrectly written for example) | 19:36 |
pcardune | Now that we have tested our Contact object, we will start testing our user interface. | 19:36 |
pcardune | Testing the user interface has historically been much more complicated because automating clicks on a screen is tricky business, and making sure the page looks a certain way is equally tricky. As of now, you can't have a super intelligent robot with eyes that does everything for you. | 19:37 |
pcardune | But not to worry, doctests will come to our aid once again. | 19:37 |
pcardune | When the zope testrunner runs functional tests, it looks for files called ftests.py, so the first thing we will do is create and edit the ftests.py file. It should look like this: | 19:37 |
lisppaste5 | pcardune pasted "ftests.py" at http://paste.lisp.org/display/36670 | 19:38 |
pcardune | We always put functional tests in a separate file from the unit tests, because they often take much longer to run and we often want to run each separately. So, as the ftests.py file suggests, create and edit the browser.txt file. | 19:39 |
pcardune | The browser.txt file is going to have the same format as the README.txt and will work just like typing stuff into a python interpreter shell. | 19:39 |
lisppaste5 | pcardune pasted "browser.txt part1" at http://paste.lisp.org/display/36672 | 19:39 |
pcardune | To start us off, type what i pasted above into the browser.txt file: | 19:40 |
pcardune | Zope provides us with a great way to write functional tests using a fake browser. The Browser class that we just imported works just like a real browser that allows us to go back and forward, click on links, enter information into forms, and so on. | 19:41 |
pcardune | If you want to know how this works, and at the same time see a really excellent example of what a (unit) doctest should look like, look at /usr/local/src/Zope3/src/zope/testbrowser/README.txt, which is the README.txt file for the testbrowser package in zope. | 19:41 |
pcardune | Now let's move on with the test. The next thing to write is: | 19:42 |
aelkner | you mean (functional) doctest, right? | 19:42 |
lisppaste5 | pcardune annotated #36672 with "browser.txt part2" at http://paste.lisp.org/display/36672#1 | 19:43 |
pcardune | no, the file i pointed to is a unit doctest | 19:43 |
aelkner | ok, i see. | 19:44 |
pcardune | We first isntantiate a browser object. Then we log in by adding an Authorization header. When running functional tests, the default login is username: mgr and password: mgrpw. Next | 19:44 |
pcardune | we set handleErrors to false so that when there is a problem with displaying a page, the test will throw an error and stop - rather than the zope server just serving up a page that says System Error. | 19:45 |
pcardune | Note that we use the url http://localhost/manage to access the ZMI. When running the functional tests, the browser object does not connect to an actual zope server you are running, so the url is faked to always be localhost, on the default port 80. | 19:46 |
AVN` | do we need to start the zope server to run funtional tests? | 19:46 |
pcardune | AVN`, nope, the functional test starts a fake zope server automatically | 19:46 |
pcardune | Now we will write our first real test (which is going to fail). Let's say that once we've logged into the ZMI, and click on the Z Contact link in the add menu, instead of just creating an empty contact object right there, we want to be taken to a form that allows us to intialize the information to store in the contact. | 19:47 |
pcardune | Rather than implementing this right off the bat, we will write a functional test that describes the behavior we would like. | 19:48 |
pcardune | Now add the following to browser.txt: | 19:48 |
lisppaste5 | pcardune annotated #36672 with "browser.txt part3" at http://paste.lisp.org/display/36672#2 | 19:48 |
pcardune | So, if we were in a real browser, what we would have done to test out this feature is to find the link that says 'Z Contact' (this is the getLink part), and click on it (the .click() part). | 19:49 |
pcardune | Next, we expect that the page this link takes us to has Controls (form input elements), with the labels 'Last Name' and 'First Name'. | 19:49 |
pcardune | We can then type our name into these input fiels by setting the value attribute of the Control. | 19:49 |
pcardune | Finally we will type in the name of our object as it should appear in the ZMI, which is in the field add_input_name. | 19:50 |
pcardune | When a form element does not have a label associated with it, we have to specify the exact name of the element. | 19:50 |
pcardune | Finally we should be able to click on an 'Add' button to actually add the form. | 19:51 |
pcardune | Go ahead and run this test. To do so, type in the shell | 19:51 |
pcardune | bin/test -fvvp -s zcontact | 19:51 |
pcardune | This time we have an f instead of a u, which stands for functional tests. | 19:51 |
lisppaste5 | Lumiere pasted "ftest error" at http://paste.lisp.org/display/36673 | 19:53 |
pcardune | Lumiere, there is a problem with the way your zope is set up | 19:54 |
pcardune | this works on maddog though | 19:55 |
Lumiere | I am on maddog... | 19:55 |
Lumiere | *asks aelkner* | 19:55 |
pcardune | Lumiere, i thought you said you had a different set up than everyone else? | 19:55 |
Lumiere | it's still a default instance | 19:56 |
pcardune | is anyone else getting the: no such file or directory, ftesting.zcml error? | 19:56 |
AVN` | I got an error also | 19:56 |
mlinnell | I got a different error | 19:57 |
pcardune | you should be getting an error... just not one about ftesting.zcml | 19:57 |
AVN` | its in browser.getControl('Add').click() | 19:57 |
pcardune | ok, then you are fine | 19:57 |
pcardune | it is only a problem if you see | 19:58 |
pcardune | IOError: [Errno 2] No such file or directory: '/home/jstraw/zope/lib/python/zcontact/ftesting.zcml' | 19:58 |
pcardune | or something to that effect, all other errors are to be expected (it is a failing test after all) | 19:58 |
Lumiere | make sure you run tests from the top directory of the zope instance... (reminder) | 19:58 |
pcardune | Note that running this short test takes quite a bit of time because the functional tests start up a fake zope server and intialize a fake empty database. | 19:59 |
pcardune | This test should fail because we have not actually implemented the code to make it work. This is called Test Driven Development, because the failing tests drive what we implement. | 20:00 |
pcardune | So now let's make this test pass! Implementing an add form is a lot like implementing an edit form, which we did in class last week. To do this, we will have to edit the configure.zcml file. So open it up for editing. | 20:00 |
pcardune | Then add the following tag: | 20:01 |
*** jinty has quit IRC | 20:01 | |
pcardune | <browser:addform | 20:01 |
pcardune | label="Add Contact" | 20:01 |
pcardune | name="addContact.html" | 20:01 |
pcardune | permission="zope.ManageContent" | 20:01 |
pcardune | schema="zcontact.interfaces.IContact" | 20:01 |
pcardune | content_factory="zcontact.contact.Contact" | 20:01 |
pcardune | /> | 20:01 |
pcardune | The difference from the editform tag to pay attention to is that we do not have a for attribute, and we now have a content_factory attribute. The content_factory specifies the constructor for our object, which in this case is just the __init__ method of the Contact class. | 20:02 |
pcardune | Finally, we will have to change one more thing: the addMenuItem tag. You should add the following attribute to the addMenuItem tag: | 20:04 |
pcardune | view="addContact.html" | 20:04 |
pcardune | This attribute tells the addMenuItem tag to point to the addform we just created. | 20:05 |
Lumiere | can you paste your configure.zcml file | 20:05 |
Lumiere | so we can see context | 20:05 |
pcardune | sure | 20:05 |
lisppaste5 | pcardune pasted "configure.zcml" at http://paste.lisp.org/display/36675 | 20:06 |
pcardune | Now rerun the test and all should work well. Feel free to start up your zope instance and check it out manually for yourself by adding a contact through the ZMI. | 20:07 |
pcardune | Now we are going to take a short 5 minute break because I believe jelkner has some announcements. | 20:07 |
jelkner | briefly, i wanted to find out if anyone has questions about the next steps in the internship process | 20:08 |
jelkner | ? | 20:08 |
tdoggette | I do! | 20:09 |
jelkner | tdoggette: yes? | 20:09 |
tdoggette | We are continuing with the online meetings, yes? | 20:09 |
jelkner | meetings? | 20:09 |
tdoggette | After that, when summer comes, who among us becomes a proper intern? | 20:09 |
tdoggette | Classes, that is. | 20:09 |
tdoggette | Like this one. | 20:09 |
jelkner | yes, class will continue until summer | 20:10 |
jelkner | btw. there is no class on feb 24 | 20:10 |
jelkner | the teacher will be at pycon | 20:10 |
myeatman | so will everyone who is still attending the classes be considered an intern? or is there a selection process? | 20:10 |
jelkner | our goal is to include everyone who successfully completes class as an intern | 20:11 |
jelkner | the only stipulation is that you really need to understand what is taught, not just attend | 20:11 |
myeatman | of course | 20:11 |
jelkner | you all are doing a fantastic job! | 20:12 |
myeatman | tyvm | 20:13 |
jelkner | that's all i have, any other questions? | 20:13 |
myeatman | when is the food arriving? | 20:13 |
jelkner | at 2 pm | 20:13 |
myeatman | yay! | 20:13 |
jelkner | not during class ;-) | 20:13 |
AVN` | there is food? | 20:13 |
jelkner | for those who are here | 20:14 |
AVN` | internet food? | 20:14 |
tdoggette | Say, is there going to be a test at the end of this? | 20:14 |
tdoggette | Not about food, about zope. | 20:14 |
jelkner | yes | 20:14 |
tdoggette | Oh MAN! | 20:14 |
tdoggette | There goes my life plan. | 20:14 |
jelkner | i'll work that out with the teacher | 20:15 |
jelkner | it won't kill anyone | 20:15 |
jelkner | but it will keep everyone honest | 20:15 |
jelkner | in other words, make sure you don't just show up at class, but spend some time during the week making sure you understand what was learned. | 20:15 |
tdoggette | Pssh. Comprehension. | 20:16 |
jelkner | other questions? | 20:16 |
jelkner | ok, back to you, teach | 20:16 |
myeatman | you gave everyone specific ports. what were those again? | 20:16 |
myeatman | nvm im good | 20:17 |
pcardune | Now back to more functional test writing. After adding the zcontact object with the addform, we should be able to click on a link to it that takes us to a page displaying information stored in contact. | 20:18 |
pcardune | So let's write that as a functional test. Add the following lines to browser.txt: | 20:18 |
lisppaste5 | pcardune annotated #36672 with "browser.txt part4" at http://paste.lisp.org/display/36672#3 | 20:18 |
pcardune | The three dots are called ellipses'. They are basically wild cards in functional tests. The browser.contents attribute holds all the html returned to the browser. We don't care so much about what the *exact* html is, so we use an ellipses as a wild card for any html. | 20:20 |
pcardune | Finally we will add one more test for the edit form. This should look like this: | 20:22 |
lisppaste5 | pcardune pasted "browser.txt part5" at http://paste.lisp.org/display/36676 | 20:23 |
pcardune | go ahead and run the test again and make sure everything passes | 20:24 |
lisppaste5 | pcardune annotated #36676 with "browser.txt THE WHOLE THING" at http://paste.lisp.org/display/36676#1 | 20:24 |
pcardune | are there any questions so far? | 20:25 |
mlinnell | I'm getting an error | 20:25 |
mlinnell | ZopeXMLConfigurationError: File "/home/mlinnell/zope3/etc/ftesting-base.zcml", line 15.2-15.55 | 20:26 |
mlinnell | ZopeXMLConfigurationError: File "/home/mlinnell/zope3/etc/package-includes/zcontact-configure.zcml", line 1.0-1.30 | 20:26 |
mlinnell | ZopeXMLConfigurationError: File "/home/mlinnell/zope3/lib/python/zcontact/configure.zcml", line 14.4-21.5 | 20:26 |
mlinnell | ConfigurationError: ('Invalid value for', 'class', "ImportError: Couldn't import zcontact.browser, No module named browser") | 20:26 |
pcardune | mlinnell, it looks like you forgot to take out the class=zcontact.browser.ContactView attribute from your page registartion in configure.zcml | 20:27 |
pcardune | we did that during the last class | 20:27 |
mlinnell | ah thanks | 20:29 |
Mounika | i keep getting an error | 20:30 |
Mounika | Traceback (most recent call last): | 20:30 |
Mounika | File "/home/mgarlapa/zope3/lib/python/zcontact/ftests.py", line 1, in ? | 20:30 |
Mounika | import zope.app.testing.fuctional | 20:30 |
Mounika | ImportError: No module named fuctional | 20:30 |
mlinnell | you spelled functional wrong | 20:30 |
Mounika | ahhh thanks | 20:30 |
pcardune | ok, well the next thing we are going to do is create containers | 20:32 |
pcardune | unfortunately, the next stage of development is going to take more than 30 minutes | 20:32 |
pcardune | and I don't want to stop half way through it | 20:32 |
AVN` | so are we going to do it? | 20:33 |
pcardune | well, no | 20:33 |
pcardune | not today | 20:33 |
myeatman | =( oh well | 20:34 |
pcardune | instead, i think it might be a good idea to have a little review session | 20:34 |
myeatman | ooh. needed | 20:34 |
pcardune | just to make sure you guys are following along | 20:34 |
AVN` | gooood ideaaa | 20:34 |
pcardune | so, how about this, I'm going to ask a question, and I want each of you to private message me the answer | 20:34 |
mlinnell | how do you private message? | 20:35 |
pcardune | although, are all of you registered on freenode? (you can't send private messages without being registered) | 20:35 |
AVN` | no | 20:35 |
mlinnell | I'm not registered | 20:35 |
AVN` | I'm not registered | 20:35 |
cpcarey11 | how do I register? | 20:35 |
myeatman | i dunno, but i don't think so | 20:35 |
Mounika | same | 20:35 |
AVN` | we could just make another channel | 20:35 |
myeatman | too easy to cheat | 20:35 |
AVN` | ? | 20:36 |
AVN` | 2 people in it at a time | 20:36 |
*** pcarduneadsf has joined #schooltool | 20:36 | |
myeatman | oh then yeah that would work | 20:36 |
pcardune | check out http://freenode.net/faq.shtml#nicksetup | 20:36 |
pcardune | to register your nick name | 20:37 |
pcardune | it only takes a second | 20:37 |
pcardune | to send private messages you type \/msg <message here> | 20:38 |
pcardune | (without the \ part) | 20:39 |
pcardune | or sorry, you type \msg pcardune <your message here> | 20:39 |
pcardune | we can spend a minute setting this up as it will come in handy later | 20:39 |
Lumiere | lets try that again ;) | 20:39 |
Lumiere | it's /msg pcardune <message> | 20:39 |
AVN` | ./msg nickserv register (yout password | 20:39 |
AVN` | without the dot | 20:40 |
Lumiere | please read nicksetup anyways | 20:40 |
Mounika | /msg nickserv link <mgarlapa> <mouni> | 20:40 |
Lumiere | Mounika: no <> | 20:40 |
Lumiere | and uh | 20:40 |
Lumiere | no inital space | 20:41 |
Mounika | oka thanks | 20:41 |
Lumiere | and choose a different pass | 20:41 |
Mounika | ok | 20:41 |
Lumiere | because we all just saw that one | 20:41 |
myeatman | lol | 20:41 |
Lumiere | hope you don't use it elsewhere | 20:41 |
Mounika | nope.. | 20:41 |
AVN` | sure you don't | 20:41 |
pcardune | send me a private message when you have been registered so I know you are ready to go | 20:42 |
pcardune | so far five of you have messaged me | 20:43 |
*** pcarduneadsf has quit IRC | 20:43 | |
pcardune | 6... | 20:43 |
pcardune | is anyone not with us? | 20:44 |
pcardune | tdoggette? jhancock? myeatman? smamo? | 20:44 |
pcardune | 7... | 20:44 |
pcardune | ok, close enough | 20:45 |
pcardune | the first question of the day (and this is open book), briefly, what is the purpose of writing an interface? | 20:45 |
pcardune | and don't worry, your life does not depend on your answer to this question, nor does your internship, nor is there a grade... no stress | 20:46 |
pcardune | ok, most of you have given a pretty satisfactory answer | 20:48 |
pcardune | interfaces describe the methods and attributes of a class, while documenting them | 20:48 |
pcardune | ok, the next question is: what is a schema? and how is it different from an interface | 20:49 |
pcardune | a schema extents an interface by allowing us to specify exactly what kind of data an attribute should store. It also allows us to write down a title and description for the attribute (further documentation) | 20:53 |
pcardune | extends* | 20:54 |
pcardune | ok, the next question is: | 20:55 |
pcardune | what is the configure.zcml file for? | 20:55 |
pcardune | the answer i was looking for is, "the configure.zcml file is used to hook a component up to other components in zope, such as browser views and auto generated forms. It also allows us to tell zope about an object and what permissions to use on it" | 20:58 |
pcardune | configure.zcml files can do a lot more than that, but that is all we have talked about so far | 20:59 |
pcardune | just for the record | 20:59 |
pcardune | ok, next question should be easy, what does ZCML stand for/ | 20:59 |
pcardune | ? | 20:59 |
pcardune | ok, well that was the last question now that it is 2pm | 21:00 |
pcardune | so, you are all free to go | 21:01 |
myeatman | answer? | 21:01 |
pcardune | Zope Configuration Markup Language | 21:01 |
pcardune | most folks got it right | 21:01 |
myeatman | FOOOOOOOOD!!!!!!!!!!!!!!!!!!!!!!! | 21:01 |
Preetam | lol | 21:01 |
Lumiere | food is served in the cyber cafe | 21:01 |
jelkner | see you all next week! | 21:01 |
Lumiere | there is cold pizza | 21:01 |
Lumiere | (cheese) | 21:01 |
Preetam | yup, bye | 21:01 |
Lumiere | and subway | 21:01 |
mlinnell | thanks bye | 21:01 |
jelkner | and sandwhiches | 21:02 |
Mounika | thanks bi | 21:02 |
Lumiere | yes... cold pizza... it's left overs from yesterday | 21:02 |
myeatman | thanks so much paul | 21:02 |
pcardune | i'll be eating breakfast | 21:02 |
tdoggette | All you folks not here in reality are missin' out. | 21:02 |
*** cpcarey11 has quit IRC | 21:02 | |
*** Preetam has quit IRC | 21:02 | |
*** myeatman has left #schooltool | 21:02 | |
*** Mounika has quit IRC | 21:02 | |
*** mlinnell has quit IRC | 21:02 | |
*** AVN` has left #schooltool | 21:03 | |
kjcole | pcardune | 21:07 |
kjcole | pcardune, I've been ignoring class again, helping others catch up. Jeff said I should ask you to fix the bzr repository for your lessons. | 21:08 |
pcardune | what is wrong with it? | 21:09 |
kjcole | in particular, deciding which files should be ignored, I guess. | 21:09 |
kjcole | Right now "bzr status" reports several "unknowns". So, the generated files need to be "bzr ignore"-ed, and the rest added. | 21:10 |
pcardune | right | 21:10 |
pcardune | i'm talking to elkner right now, we should be done in not too long | 21:10 |
kjcole | Yeah. He told me to chat with you and then said he was going to call you... To which I said "Let me get this straight. You want me to IRC him | 21:11 |
kjcole | while you phone him?" He said "Yeah". Lucky you. | 21:12 |
pcardune | ok kjcole, i'm off the phone with him | 21:26 |
Lumiere | sec | 21:29 |
kjcole | pcardune, Back. | 21:29 |
pcardune | kjcole, if you run python setup.py clean | 21:30 |
pcardune | then it will remove all the files that should be ignored | 21:30 |
kjcole | pcardune, So... I had started trying to get Jeff to do the "bzr ignore/add/commit" stuff, but he said you'd know it best. | 21:30 |
kjcole | Yeah, but later when they're regenerated, bzr will moan about them being "unknown". So, if you can add a [bzr ignore "*.whatever"] it will pick up on future generating. | 21:31 |
kjcole | (I wasn't sure which files should be ignored, or I would have done it myself.) | 21:32 |
pcardune | but the ignoring is more complicated than just *.whatever | 21:32 |
kjcole | ? | 21:32 |
pcardune | that is, sometimes we want to ignore *.css, and sometimes we don't | 21:33 |
pcardune | it depends on which directory we are in | 21:33 |
pcardune | the setup.py file isn't that complicated | 21:33 |
pcardune | just look at the clean method | 21:33 |
pcardune | and add ignores for everything there | 21:33 |
pcardune | it would be better to ignore lesson*/txtsrc and lesson*/*.css and so forth | 21:34 |
kjcole | OK, will do. (I'm guessing something like [bzr ignore "./lesson*/*.css"] might be part of the answer there. | 21:34 |
pcardune | i don't know if you can specify ignores like that | 21:34 |
pcardune | my only concern is that the setup.py file will change some how and the ignore won't work | 21:35 |
pcardune | besides, is it really that huge a problem to do python setup.py clean before you do bzr stat? | 21:35 |
kjcole | Well, one can always "bzr rm" and change the .bzrignore file if setup.py changes too much. | 21:35 |
pcardune | ok | 21:36 |
kjcole | No, I guess not. The trick then will be to convince Jeff et al to not make the repository do double duty. | 21:36 |
pcardune | well i looked on ganges and did a bzr stat and there is all sorts of weird stuff... apparently index.lore was removed? | 21:37 |
pcardune | that shouldn't be removed | 21:37 |
pcardune | I would rebranch from my copy onto ganges, because that branch is kind of messed up it seems to me | 21:37 |
pcardune | or maybe just do bzr revert | 21:37 |
pcardune | and then bzr pull | 21:37 |
kjcole | OK. I'll assume yours is the master copy. (I haven't been involved at all in the lesson editing. I was merely trying to keep bzr repositories on ganges from being left half-baked.) | 21:38 |
pcardune | yeah | 21:39 |
pcardune | do you know where to get my copy? | 21:39 |
kjcole | Nope. | 21:39 |
pcardune | it used to be on port 81, but now it is on port 80 | 21:39 |
pcardune | http://www.carduner.net/privatebzr/zope3class/ | 21:39 |
kjcole | I'll double-check w/ Jeff to make sure everyone's on the same page, then I'll just wipe and branch off yours. | 21:40 |
pcardune | ok | 21:40 |
kjcole | BTW, you can ignore my email: Eldar showed me what to do w/ deleting the undeletable: I just deleted all the Data.fs* and restarted, as there wasn't much there yet. | 21:41 |
kjcole | (He also suggested a longer way with pdb, but having never used it, I opted for the easier method.) | 21:42 |
*** tdoggette has quit IRC | 21:45 | |
pcardune | ok, well I'm going to go eat breakfast. Call me if you guys need any help on something. | 21:49 |
pcardune | bye | 21:49 |
*** pcardune has quit IRC | 21:49 | |
*** kjcole has quit IRC | 21:50 | |
*** nitromaster101 has joined #schooltool | 22:02 | |
*** nitromaster101 has quit IRC | 22:03 | |
*** nitromaster101 has joined #schooltool | 22:03 | |
*** smamo has quit IRC | 22:17 | |
*** jelkner has quit IRC | 22:19 | |
*** didymo has quit IRC | 22:43 | |
*** nitromaster101 has quit IRC | 22:43 | |
*** filip101 has joined #schooltool | 23:03 | |
*** filip101 has left #schooltool | 23:03 | |
*** filip101 has joined #schooltool | 23:15 | |
filip101 | hey | 23:15 |
filip101 | i missed the lessons so far | 23:15 |
filip101 | because i have real diving lessons to attend to | 23:15 |
filip101 | but i wanted to check what i missed | 23:15 |
filip101 | but nothing is at the lesson website | 23:16 |
filip101 | what's up? | 23:16 |
filip101 | never mind | 23:18 |
filip101 | it's back up | 23:18 |
*** filip101 has quit IRC | 23:38 | |
Fujitsu | Hm, what's this internship thing I see mentioned in the class? | 23:40 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!