*** Travis has joined #schooltool | 00:19 | |
*** Aiste has joined #schooltool | 00:44 | |
*** Travis has left #schooltool | 01:28 | |
*** wrobel has quit IRC | 01:36 | |
*** Diosan has quit IRC | 01:58 | |
*** wrobel has joined #schooltool | 10:25 | |
*** Aiste has quit IRC | 17:41 | |
*** jelkner has joined #schooltool | 18:01 | |
*** pcardune has joined #schooltool | 18:03 | |
jelkner | morning paul! | 18:03 |
---|---|---|
pcardune | hey | 18:03 |
jelkner | ok, here is what i'm doing | 18:04 |
jelkner | 1. apt-get install zope3 | 18:04 |
jelkner | (on a breezy box) | 18:04 |
pcardune | ok good | 18:04 |
*** flint has joined #schooltool | 18:05 | |
flint | now the right site... | 18:05 |
jelkner | ok, i tried: | 18:05 |
flint | tried what? | 18:05 |
jelkner | /usr/lib/zope3/bin/mkzopeinstance | 18:05 |
jelkner | and here is what happened: | 18:06 |
jelkner | Directory: /home/jelkner/zope3 | 18:06 |
jelkner | Username: jelkner | 18:06 |
flint | we are sort of getting ahead of ourselves... eh? I am 5 minutes late but... | 18:06 |
jelkner | Password: ***** | 18:06 |
jelkner | verify: ***** | 18:06 |
jelkner | Traceback (most recent call last): | 18:07 |
jelkner | File "./mkzopeinstance", line 45, in ? | 18:07 |
jelkner | sys.exit(main(from_checkout=from_checkout)) | 18:07 |
jelkner | File "/usr/lib/python2.4/site-packages/zope/app/server/mkzopeinstance.py", line 48, in main | 18:07 |
jelkner | return app.process() | 18:07 |
jelkner | File "/usr/lib/python2.4/site-packages/zope/app/server/mkzopeinstance.py", line 111, in process | 18:07 |
*** kjcole has joined #schooltool | 18:07 | |
jelkner | os.chown(options.destination, uid, gid) | 18:07 |
jelkner | OSError: [Errno 1] Operation not permitted: '/home/jelkner/zope3' | 18:07 |
jelkner | do i need to make the zope3 directory first? | 18:07 |
pcardune | that may be necessary | 18:07 |
jelkner | but it made it | 18:07 |
jelkner | let me see what's in it... | 18:07 |
jelkner | nothing | 18:08 |
pcardune | try running the mkzopeinstance in ./bin | 18:09 |
pcardune | is there one there? | 18:09 |
pcardune | nvm | 18:10 |
jelkner | no | 18:10 |
pcardune | you did that already | 18:10 |
jelkner | yes | 18:10 |
jelkner | any idea why this won't work? | 18:11 |
kjcole | I'm interpreting things as the mkzopeinstance is trying to behave itself, and doesn't have the privileges to write stuff to a directory owned by ~jelkner | 18:11 |
jelkner | flint: all you missed was apt-get install zope3 | 18:11 |
pcardune | but you are logged in as jelkner no? | 18:12 |
flint | gotcha... | 18:12 |
pcardune | try using root | 18:12 |
jelkner | yes | 18:12 |
jelkner | ok, that's what kevin suggested | 18:12 |
jelkner | not a good practice, but what the hell... | 18:12 |
kjcole | but it wants it to be owned by someone else (hence the os.chown call) | 18:12 |
pcardune | i tried what you just did and it worked for me | 18:12 |
jelkner | i did it as sudo and got a directory owned by zope | 18:13 |
jelkner | should i now chown to jelkner? | 18:13 |
kjcole | i wonder what happens if you try again as jelkner but first add jelkner as a member of the zope group... | 18:14 |
jelkner | ok, pcardune, should i chown? | 18:14 |
pcardune | yes | 18:15 |
jelkner | done | 18:15 |
jelkner | now should we start it? | 18:15 |
jelkner | flint: are you doing this with us? | 18:15 |
pcardune | yes, try starting it | 18:15 |
flint | i am trying to remember where I set up zope3.... | 18:16 |
*** kjcole has quit IRC | 18:16 | |
jelkner | jelkner@gopher:~/zope3/bin$ ./runzope | 18:16 |
jelkner | Traceback (most recent call last): | 18:16 |
jelkner | File "./runzope", line 48, in ? | 18:16 |
jelkner | run() | 18:16 |
jelkner | File "./runzope", line 44, in run | 18:16 |
jelkner | main(["-C", CONFIG_FILE] + sys.argv[1:]) | 18:16 |
jelkner | File "/usr/lib/python2.4/site-packages/zope/app/server/main.py", line 58, in main | 18:16 |
jelkner | setup(load_options(args)) | 18:16 |
jelkner | File "/usr/lib/python2.4/site-packages/zope/app/server/main.py", line 169, in setup | 18:16 |
jelkner | zope.app.appsetup.config(options.site_definition) | 18:16 |
jelkner | File "/usr/lib/python2.4/site-packages/zope/app/appsetup/appsetup.py", line 52, in config | 18:17 |
jelkner | context = xmlconfig.file(file, execute=execute) | 18:17 |
jelkner | File "/usr/lib/python2.4/site-packages/zope/configuration/xmlconfig.py", line 557, in file | 18:17 |
jelkner | context.execute_actions() | 18:17 |
jelkner | File "/usr/lib/python2.4/site-packages/zope/configuration/config.py", line 622, in execute_actions | 18:17 |
jelkner | callable(*args, **kw) | 18:17 |
jelkner | File "/usr/lib/python2.4/site-packages/zope/app/onlinehelp/onlinehelp.py", line 123, in registerHelpTopic | 18:17 |
jelkner | raise ConfigurationError( | 18:17 |
jelkner | zope.configuration.config.ConfigurationExecutionError: zope.configuration.exceptions.ConfigurationError: Help Topic definition /usr/lib/zope3/lib/python/zope/interface/README.txt does not exist | 18:17 |
jelkner | in: | 18:17 |
jelkner | File "/usr/lib/zope3/lib/python/zope/app/apidoc/bookmodule/book.zcml", line 11.4-16.10 | 18:17 |
jelkner | <bookchapter | 18:17 |
jelkner | id="interface" | 18:17 |
jelkner | title="Interfaces" | 18:17 |
jelkner | doc_path="README.txt" | 18:17 |
jelkner | parent="ifaceschema" | 18:17 |
jelkner | /> | 18:17 |
jelkner | flint: are you running breezy? | 18:17 |
jelkner | pcardune: now what? | 18:18 |
pcardune | hmmm | 18:18 |
pcardune | i can't imagine what has gone wrong | 18:18 |
pcardune | i've followed the same steps and everything worked | 18:18 |
srichter | hi guys | 18:18 |
srichter | working on Sunday, eh? | 18:18 |
jelkner | srichter: every sunday | 18:19 |
pcardune | srichter: no... we're working on super bowl sunday | 18:19 |
*** kjcole has joined #schooltool | 18:19 | |
jelkner | srichter: pcardune is teaching flint and i zope3 | 18:20 |
jelkner | we need to start by getting it running | 18:20 |
srichter | jelkner: are you running a checkout? | 18:20 |
jelkner | i'm on a x86_64 breezy box | 18:20 |
jelkner | no | 18:20 |
jelkner | the zope3 breezy package | 18:20 |
srichter | ahhh, ok, we are getting closer | 18:21 |
jelkner | i began with apt-get install zope3 | 18:21 |
srichter | 64bit architectures require you to change the library link | 18:21 |
jelkner | ahh | 18:21 |
jelkner | how do i do that? | 18:21 |
srichter | there were several reports on zope3-dev | 18:21 |
srichter | I forgot, just search the archives | 18:21 |
srichter | it was recent | 18:21 |
jelkner | i have another idea | 18:22 |
jelkner | why don't i try this on another box that isn't x86_64? | 18:22 |
pcardune | jelkner: that would be a good idea | 18:22 |
jelkner | give me 3 minutes | 18:23 |
flint | srichter, actually I am watching jeff flounder around with paul... :^) | 18:23 |
flint | srichter, I am at the same time conspiring with kevin cole... | 18:24 |
flint | kjcole, what I am trying to send you is: http://www.howtoforge.com/samba_setup_ubuntu_5.10 | 18:26 |
jelkner | i tried the same thing on a virtual machine, and the same error occured | 18:28 |
jelkner | srichter: i want to learn zope3, not fart around with setting it up all day. is there an easier way? | 18:29 |
jelkner | should i install from source in my local directory? | 18:29 |
pcardune | installing from source is fairly simple | 18:29 |
*** Aiste has joined #schooltool | 18:30 | |
jelkner | 1. downloaded Zope-3.2.0.tgz from http://www.zope.org/Products/Zope3/3.2.0final | 18:33 |
jelkner | untarred, creating Zope-3.2.0 | 18:34 |
jelkner | cd Zope-3.2.0 | 18:34 |
jelkner | ./configure | 18:34 |
jelkner | giving this output: | 18:34 |
jelkner | ./configure | 18:34 |
jelkner | Configuring Zope installation | 18:34 |
jelkner | Testing for an acceptable Python interpreter... | 18:34 |
jelkner | Python version 2.4.2 found at /usr/bin/python | 18:34 |
jelkner | The optimum Python version (2.4.2) was found at /usr/bin/python. | 18:34 |
jelkner | oops, (after reading README.txt) | 18:35 |
jelkner | ./configure --prefix /home/jelkner/zope3 | 18:35 |
jelkner | make gives a mess of errors | 18:37 |
jelkner | starting with: | 18:37 |
jelkner | Dependencies/persistent-Zope-3.2.0/persistent/TimeStamp.c: In function ‘TimeStamp_raw’: | 18:37 |
jelkner | Dependencies/persistent-Zope-3.2.0/persistent/TimeStamp.c:221: warning: pointer targets in passing argument 1 of ‘PyString_FromStringAndSize’ differ in signedness | 18:37 |
jelkner | Dependencies/persistent-Zope-3.2.0/persistent/TimeStamp.c: In function ‘TimeStamp_laterThan’: | 18:37 |
jelkner | Dependencies/persistent-Zope-3.2.0/persistent/TimeStamp.c:264: warning: pointer | 18:37 |
pcardune | hmm, i'm just using a zope3 checkout | 18:39 |
jelkner | pcardune: can you talk me through setting this up? | 18:40 |
jelkner | this is getting frustrating | 18:40 |
pcardune | i can talk you through the checkout | 18:40 |
pcardune | that is the only kind of zope i have ever installed | 18:40 |
jelkner | let's do that, then | 18:40 |
pcardune | ok | 18:40 |
jelkner | i'm on an x86_64 box | 18:40 |
jelkner | i wonder if i should use the virtual machine instead to play it safe? | 18:41 |
pcardune | sounds like a good idea, i have never built anything on a 64 bit machine... | 18:41 |
jelkner | ok, i'm there, let's go | 18:42 |
pcardune | svn co svn://svn.zope.org/repos/main/Zope3/3.2 Zope3 | 18:42 |
pcardune | cd Zope3; make | 18:42 |
jelkner | hold on, need sudo apt-get install subversion first ;-) | 18:42 |
jelkner | svn co svn://svn.zope.org/repos/main/Zope3/3.2 Zope3 | 18:43 |
jelkner | svn: File not found: revision 41562, path '/Zope3/3.2' | 18:43 |
pcardune | svn co svn://svn.zope.org/repos/main/Zope3/branches/3.2 Zope3 | 18:44 |
pcardune | woops | 18:44 |
jelkner | that worked ;-) | 18:44 |
pcardune | then cd Zope3 | 18:44 |
pcardune | then make | 18:45 |
jelkner | ok, still checking out... | 18:45 |
flint | jeff, take a break and go talk to kevin... | 18:46 |
jelkner | flint: nope | 18:46 |
flint | ok, keving is coming in to you... I am looking for my zope3 instance... standby. | 18:47 |
pcardune | jelkner: how's it going? | 18:52 |
flint | now this is getting interesting.... | 18:53 |
jelkner | ok, here are the dependencies: | 18:54 |
jelkner | 1. subversion | 18:54 |
jelkner | 2. make | 18:54 |
jelkner | 3. gcc | 18:54 |
jelkner | 4. python-dev | 18:54 |
jelkner | 4. libc6-dev | 18:54 |
jelkner | s/4/5 | 18:54 |
jelkner | i think that did it | 18:55 |
pcardune | I usually don't notice dependencies because i've already installed them for whatever other application | 18:55 |
pcardune | so, did you successfully build it then? | 18:55 |
jelkner | yes | 18:55 |
jelkner | but now ./runzope gives me: | 18:56 |
flint | I appear to have Zope 3.20 installed on 64.5.53.104 | 18:56 |
jelkner | python2.4: can't open file 'z3.py': [Errno 2] No such file or directory | 18:56 |
jelkner | so there is more i need to do | 18:56 |
jelkner | what now? | 18:57 |
pcardune | well, first you need to copy sample_principles.zcml to principals.zcml | 18:57 |
pcardune | then type make run | 18:57 |
jelkner | what about the z3.py problem? | 18:58 |
pcardune | do you have z3.py in your Zope3 folder? (you should already) | 18:58 |
jelkner | yes | 18:58 |
jelkner | but runzope can't find it | 18:58 |
jelkner | do i need to make an instance or something? | 18:59 |
pcardune | right... dont run runzope from the bin directory | 18:59 |
pcardune | run it from the root Zope3 directory | 18:59 |
pcardune | so, run bin/runzope | 18:59 |
pcardune | not ./runzope | 18:59 |
jelkner | cp sample_principals.zcml principals.zcml | 19:00 |
jelkner | ./bin/runzope | 19:00 |
flint | paul, what is the default port that zope runs on? | 19:00 |
jelkner | waiting for zope to start.... | 19:00 |
pcardune | flint: 8080 | 19:01 |
flint | pcardune, that is what i thought... | 19:01 |
jelkner | success! | 19:02 |
srichter | yipee! | 19:02 |
pcardune | ok, now you can log in and look around Zope3 if you want | 19:02 |
pcardune | gandalf, 123 is the manager, password by default | 19:02 |
jelkner | log in with? | 19:02 |
flint | jelkner, what url are you on? | 19:02 |
jelkner | cando.yhspatriot.net:8080 | 19:03 |
jelkner | what is the user name? | 19:03 |
pcardune | gandalf | 19:03 |
jelkner | flint: you need your own instance | 19:03 |
pcardune | you can change it by editing principals.zcml if you want | 19:03 |
jelkner | we can't both develop on the same instance at the same time | 19:03 |
jelkner | i'm in, but there isn't much here | 19:04 |
jelkner | oh, wait, clickin on [top] shows a bunch | 19:04 |
jelkner | how can i change the manager account? | 19:05 |
srichter | principals.zcml | 19:05 |
pcardune | don't worry about that for now | 19:06 |
jelkner | why not? | 19:06 |
pcardune | because we aren't going to be using the ZMI or the zope server for a while | 19:06 |
*** Aiste has joined #schooltool | 19:06 | |
jelkner | ok | 19:06 |
jelkner | should i stop the instance then? | 19:06 |
pcardune | we first have to write interfaces, and implementations and tests... and eventually get to browser related stuff | 19:06 |
pcardune | jelkner: yes | 19:07 |
jelkner | ok | 19:07 |
jelkner | done | 19:07 |
jelkner | so, where do we begin now? | 19:07 |
pcardune | well, first we have to create a package | 19:07 |
jelkner | ok | 19:07 |
flint | I get connection refused when attempting cando.yhspatriot.net:8080 | 19:07 |
jelkner | i stopped it | 19:08 |
flint | bad man...:^) | 19:08 |
jelkner | paul just told me too | 19:08 |
jelkner | read, flint! ;-) | 19:08 |
pcardune | add a folder to Zope3/src/ | 19:08 |
jelkner | named TimeClock ? | 19:08 |
pcardune | we want to follow the naming convention | 19:09 |
pcardune | and use lowercase for package names | 19:09 |
jelkner | timeclock | 19:09 |
jelkner | ? | 19:09 |
pcardune | yeah | 19:09 |
srichter | what will timeclock do? | 19:09 |
jelkner | srichter: glad you asked | 19:09 |
pcardune | srichter: keep track of the hours people work when they're working for elkner | 19:09 |
jelkner | it is a work flow application | 19:09 |
jelkner | folks working on cando will use it to "clock-in" and "clock-out" | 19:10 |
jelkner | then dwelsh and i will be able to approve their hours | 19:10 |
jelkner | then it will generate an invoice to arlington schools (kris martini) | 19:10 |
jelkner | then developers get paid! | 19:11 |
flint | always a feature... | 19:11 |
jelkner | srichter: pcardune already told me it involves things he doesn't understand yet | 19:11 |
flint | pcardune, you have time clock as an external (keep in mind I think in zope 2 :^) | 19:12 |
jelkner | so your help will be *greatly* appreciated | 19:12 |
pcardune | jelkner: i just have to read the chapter on workflows | 19:12 |
pcardune | and that wont come till much later | 19:12 |
jelkner | i want to develop it step by step here, so we get a simple tutorial out of it at the same time | 19:12 |
pcardune | we should really get to work on writing an interface or two now | 19:12 |
jelkner | i'll write it up as we go, so others can use this to learn zope3 | 19:12 |
jelkner | ok timeclock exists, now what? | 19:13 |
pcardune | ok, how much of zope component architecture do you know? | 19:14 |
srichter | cool | 19:14 |
jelkner | none | 19:14 |
pcardune | i'd rather you have a conceptual understanding of this rather than just a recipe based one | 19:14 |
jelkner | we are starting from scratch | 19:14 |
srichter | I would not use workflows for the first iteration :-) | 19:14 |
jelkner | no | 19:14 |
srichter | they would make the app a bit harder than necessary for now | 19:14 |
pcardune | srichter: oh yeah, as i said, that will come much later | 19:15 |
jelkner | user story one: user can log in to the time clock | 19:15 |
pcardune | no no | 19:15 |
pcardune | that's to much | 19:15 |
jelkner | no? | 19:15 |
pcardune | user story one: I want a object to represent one piece of a persons record | 19:15 |
jelkner | well, from the customer point of view, if we can't log in, we can't do anything else | 19:15 |
srichter | I agree with Paul :-) | 19:16 |
jelkner | that's not a user story | 19:16 |
pcardune | well, if you can login, and then there is nothing, then you can do nothing... you can't even do anything at a python prompt ;) | 19:16 |
jelkner | user's don't know about objects | 19:16 |
srichter | well, but that's the problem with user storied | 19:16 |
jelkner | it could tell me, "welcome to timeclock" | 19:16 |
srichter | they don't allow you to think API :-) | 19:17 |
srichter | first story: Create | 19:17 |
srichter | first story: Create a Person to be clocked | 19:17 |
jelkner | ok | 19:17 |
jelkner | let's do that | 19:17 |
pcardune | we should just reuse schooltool Person object ;) | 19:18 |
pcardune | ok, so... first thing... all zope objects have interfaces | 19:18 |
pcardune | everything in zope deals with interfaces, i can't stress this enough | 19:18 |
jelkner | we want this to be as simple as possible | 19:18 |
jelkner | and just what is an interface in zope3 terms? | 19:18 |
pcardune | interfaces make things simple because they tell you what an object is supposed to do, without worrying about implementation | 19:19 |
jelkner | are they like java interfaces? | 19:19 |
pcardune | on some level yes | 19:19 |
jelkner | a "contract" that a class must deliver | 19:19 |
pcardune | precisely | 19:19 |
jelkner | ok, i'm good with that | 19:20 |
pcardune | although java interfaces can define variables that all object instances can access but not change. you dont do that with zope interfaces | 19:20 |
jelkner | yes, python is much more permissive, i get that | 19:20 |
pcardune | so, when we create an object, the first thing we want to do is define it's contract, what it can do | 19:21 |
jelkner | this will be just use an honor system | 19:21 |
jelkner | so that the tests can tell you if you are being good or not, yes? | 19:21 |
pcardune | yeah | 19:21 |
flint | ok my copy of zope 3 is at http://64.5.53.104:8080/ | 19:21 |
jelkner | flint: we won't actually need that for a while | 19:22 |
pcardune | we also want to make interfaces minimalistic, we don't want to include superfluous methods, only ones that are integral to the nature of the object we create | 19:22 |
flint | jelkner, this is a class remember, i cannot look at your copy and cannot participate. | 19:22 |
jelkner | you should shell into the directory and create a timeclock directory | 19:22 |
jelkner | that's where we are now | 19:22 |
jelkner | we haven't done anything yet | 19:22 |
pcardune | so, a gradebook interface, wouldn't include methods for looking at grade statistics, as that is not an integral part of what a gradebook *is* | 19:23 |
jelkner | so you haven't missed anything | 19:23 |
flint | ok, my instance is at /home/zope | 19:23 |
flint | is that ok paul? | 19:23 |
pcardune | flint: sure | 19:23 |
jelkner | mkdir /home/zope/src/timeclock | 19:23 |
jelkner | yes? | 19:23 |
pcardune | yes | 19:23 |
pcardune | also touch /home/zope/src/timeclock/__init.py__ to make it a python module | 19:24 |
pcardune | ok, so lets make an interface | 19:24 |
pcardune | all interfaces go into the interfaces.py file | 19:24 |
flint | what do I put in /home/zope/src/timeclock? | 19:24 |
pcardune | *always* | 19:24 |
jelkner | e also touch /home/zope/src/timeclock/__init.py__ to make it a python module | 19:24 |
jelkner | is there only one interfaces.py file? | 19:25 |
pcardune | one per module, yes | 19:25 |
jelkner | and what is a module | 19:25 |
jelkner | ? | 19:25 |
pcardune | module/package | 19:25 |
pcardune | i should say package, they are packages | 19:26 |
jelkner | so, timeclock is a module/package? | 19:26 |
pcardune | yes | 19:26 |
flint | ok, /home/zope/src/timeclock/__init.py__ is an empty module eh | 19:26 |
jelkner | so interfaces.py will go in timeclock | 19:26 |
pcardune | correct | 19:26 |
jelkner | flint: yes | 19:26 |
pcardune | if you look at schooltool, there it is made up of lots of packages, so they don't have an interfaces.py in the root folder. our application is small enough that it doesn't matter | 19:26 |
pcardune | at least at this point | 19:27 |
jelkner | ok | 19:27 |
flint | did I mention elkner that you are a gifted teacher but a terrible student? pcardune have i missed any steps so far? | 19:27 |
*** tiredbones has quit IRC | 19:27 | |
pcardune | flint: nope, just read what's been written so you know whats going on as far as component architecture is concerned | 19:27 |
flint | pcardune, gotcha... | 19:28 |
jelkner | so, we are editing interfaces.py... | 19:28 |
pcardune | ok, so in interfaces.py create a class named IPerson | 19:28 |
pcardune | the naming convention for interfaces is to always have an I at the beginning | 19:28 |
pcardune | all class definitions are camel case with a capital first letter | 19:29 |
pcardune | you also want to import zope.interface | 19:29 |
pcardune | or, from zope.interface import Interface | 19:29 |
jelkner | which one? | 19:30 |
flint | paul, the only file I have created is __init.py__ should I have an interfaces.py as well? | 19:30 |
pcardune | well, either way, it just means your interface will inherit from zope.interface.Interface, or just Interface | 19:30 |
jelkner | if it is all the same to you, let's import zope.interface | 19:30 |
jelkner | that will make it clearer | 19:30 |
pcardune | ok, that is more explicit anyways | 19:30 |
pcardune | flint: yes, create interfaces.py | 19:31 |
pcardune | flint: put at the top "import zope.interface" | 19:31 |
jelkner | flint: edit interface.py | 19:31 |
pcardune | interfaces.py not interface.py | 19:31 |
jelkner | then put (after a blank line): | 19:31 |
jelkner | class IPerson: | 19:31 |
pcardune | IPerson must inherit from zope.interface.Interfaces | 19:31 |
jelkner | ahh | 19:31 |
jelkner | so: | 19:32 |
jelkner | class IPerson(zope.interface.Interfaces): | 19:32 |
pcardune | you also want to include docstrings for everything | 19:33 |
pcardune | this is also convention, but a strict one you *must* follow | 19:33 |
pcardune | you lose 1% off your final grade for every missing docstring | 19:33 |
pcardune | ;) | 19:33 |
pcardune | i'm wondering if we should use gobby | 19:34 |
pcardune | so i can show you better the writing conventions | 19:34 |
pcardune | without typing them all out on #schooltool | 19:34 |
jelkner | next week, yes | 19:34 |
pcardune | ok | 19:34 |
jelkner | one thing about that pcardune | 19:34 |
jelkner | on #schooltool we get a log | 19:35 |
jelkner | that i can find later (we all can) | 19:35 |
jelkner | i can use that to develop this into a tutorial | 19:35 |
jelkner | so we want everything here | 19:35 |
pcardune | well, I would explain everything here, but for illustrative purposes, gobby lends itself better for multiline strings | 19:35 |
jelkner | true | 19:35 |
pcardune | so, for class docstrings, you always start with triple single quotes | 19:36 |
pcardune | and on sentance describing whatever it is you are documenting | 19:36 |
jelkner | class IPerson(zope.interface.Interfaces): | 19:36 |
jelkner | """ | 19:36 |
jelkner | """ | 19:36 |
flint | jelkner, do me a favor, cut and paste what is in your interfaces.py by now... | 19:36 |
pcardune | so, for IPerson it might be '''A Person that in the timeclock application.''' | 19:36 |
jelkner | flint: i just did | 19:37 |
pcardune | you can also include longer explanations below this first sentance with one space in between | 19:37 |
jelkner | except for the import line at the top | 19:37 |
jelkner | question: flint, are you using vim? | 19:38 |
flint | jelkner, I did not see it. I am using vi, maybe vim remapped... | 19:38 |
jelkner | yes | 19:38 |
jelkner | ok, make this your .vimrc file: | 19:38 |
flint | hang on letme switch... | 19:38 |
jelkner | " .vimrc | 19:38 |
jelkner | " | 19:38 |
jelkner | " Created by Jeff Elkner 23 January 2006 | 19:38 |
jelkner | " Last modified 2 February 2006 | 19:38 |
jelkner | " | 19:38 |
jelkner | " Turn on syntax highlighting and autoindenting | 19:38 |
jelkner | syntax enable | 19:38 |
jelkner | filetype indent on | 19:38 |
jelkner | " set autoindent width to 4 spaces (see | 19:38 |
jelkner | " http://www.vim.org/tips/tip.php?tip_id=83) | 19:39 |
jelkner | set et | 19:39 |
jelkner | set sw=4 | 19:39 |
jelkner | set smarttab | 19:39 |
jelkner | " Bind <f2> key to running the python interpreter on the currently active | 19:39 |
jelkner | " file. (curtessy of Steve Howell from email dated 1 Feb 2006). | 19:39 |
jelkner | " Note <f1> is bound to the gnome help system, so Steve's orginal <f1> binding | 19:39 |
jelkner | " won't work. | 19:39 |
jelkner | map <f2> :w\|!python %<cr> | 19:39 |
jelkner | you will now get color syntax highlighting, auto indenting, and <f2> to shell out to python and run your script | 19:39 |
jelkner | note: kjcole get me documenting these things properly ;-) | 19:40 |
pcardune | tell me when you guys are ready to continue | 19:40 |
jelkner | i'm ready | 19:40 |
pcardune | so , now we have to decide what a Person is | 19:41 |
pcardune | what kind of things do we want a person to have | 19:41 |
jelkner | name | 19:41 |
jelkner | userid | 19:41 |
jelkner | password | 19:41 |
jelkner | payrate | 19:42 |
jelkner | address | 19:42 |
jelkner | phone number | 19:42 |
jelkner | 19:42 | |
jelkner | ssn | 19:42 |
*** Aiste has joined #schooltool | 19:43 | |
flint | jelkner, i changed your quotes to hashes will that work? | 19:43 |
jelkner | flint: i don't know | 19:43 |
jelkner | pcardune: i think that's all to start | 19:43 |
pcardune | ok, well, let me comment on that a bit | 19:43 |
jelkner | please! | 19:43 |
pcardune | you want to be considered a person for timeclock... but you aren't going to have a payrate | 19:44 |
pcardune | so, payrate doesn't define a person | 19:44 |
jelkner | we will have different roles | 19:44 |
jelkner | so we want to start with the most general, "mother of all persons" class? | 19:45 |
jelkner | is that where you are going? | 19:45 |
pcardune | right | 19:45 |
jelkner | ok | 19:45 |
jelkner | name | 19:45 |
jelkner | userid | 19:45 |
pcardune | which means, we aren't necessarily going to have address, phone number, etc | 19:45 |
jelkner | password | 19:45 |
pcardune | just name and userid | 19:45 |
jelkner | and password | 19:45 |
pcardune | password is also going to be handled internally within zope | 19:45 |
jelkner | question: if we wanted email to be a requirement, would be add that field here too? | 19:46 |
jelkner | i don't want anyone to use the system whom i have no way of contacting | 19:46 |
jelkner | so a valid email is a requirement... | 19:46 |
jelkner | what do you think? | 19:47 |
pcardune | jelkner: well, that is arguable, but alright | 19:47 |
pcardune | we can always refactor later :) | 19:47 |
jelkner | and we will! ;-) | 19:47 |
jelkner | so: name userid email | 19:48 |
pcardune | in schooltool, they have a separate object for handling additional personal information about a person that uses annotations | 19:48 |
pcardune | jelkner: perfect | 19:48 |
jelkner | we've only got 12 minutes... | 19:48 |
flint | pcardune, in fact the username IS the email | 19:48 |
pcardune | ok, we'll just write this interface then | 19:48 |
jelkner | ahh | 19:48 |
jelkner | that's a great idea | 19:48 |
pcardune | i'm not entirely sure you can have @ for zope usernames | 19:49 |
jelkner | ok, let's check that later | 19:49 |
flint | god help us... what are the consequences of the @? | 19:49 |
jelkner | for now: name userid email | 19:49 |
jelkner | how do we put that in the interface? | 19:49 |
pcardune | @@ is a namespace for views... so putting @@ in a zope3 url performs a view lookup... in any case, there may be consequences | 19:50 |
flint | if the @ causes trouble in the email field will it need quoting? | 19:50 |
pcardune | well, we will start write away by using schema fields | 19:50 |
pcardune | flint: lets not worry about that now, we aren't doing implementation yet | 19:50 |
jelkner | go for it | 19:50 |
pcardune | import zope.schema | 19:50 |
flint | pcardune, hey I am just tickled to get elkners .vimrc... | 19:50 |
flint | in the interfaces.py file right? | 19:51 |
pcardune | yes | 19:51 |
jelkner | so start with: | 19:51 |
pcardune | so, schemas are the attribute part of a contract, and interfaces are the method part of the contract | 19:51 |
jelkner | import zope.interface, zope.schema | 19:51 |
pcardune | another convention, don't use ',' in imports, always have separate lines | 19:52 |
jelkner | ok | 19:52 |
jelkner | import zope.interface | 19:52 |
jelkner | import zope.schema | 19:52 |
pcardune | schemas allow us to define attributes of a class, including what kind of information they store, whether it is numerical, or string, it's kind of like setting a type in java | 19:52 |
pcardune | except we can also attach documentation to each attribute | 19:53 |
flint | will this be included on the final? :^) btw this is good stuff!!! | 19:53 |
pcardune | pg 54 of stephans zope book gives a pretty good overview of that | 19:53 |
pcardune | so, a username is going to be a simple string | 19:54 |
jelkner | that sounds like a homework assignment, good | 19:54 |
flint | page begins with "Jim Fulton" | 19:54 |
pcardune | so we define that in the schema like this: | 19:54 |
jelkner | pcardune: question - is the "schema" the interface? | 19:54 |
*** kjcole has quit IRC | 19:54 | |
pcardune | username = zope.schema.Text( | 19:55 |
pcardune | title=u"some title", | 19:55 |
pcardune | description=u"some description", | 19:55 |
pcardune | required=True) | 19:55 |
jelkner | where? | 19:55 |
pcardune | that goes in the interface | 19:55 |
pcardune | so, schemas and interfaces are conceptually different things, but look exactly the same in code | 19:56 |
pcardune | and are in fact midex in the code | 19:56 |
jelkner | ok, paul, with 3 minutes left, let's sum up | 19:57 |
pcardune | you wont define an IPersonInterface and IPersonSchema, both the methods of the interface, and the attributes of the schema go into IPerson... which is then both an interface and a schema | 19:57 |
jelkner | the interfaces.py file so far: | 19:57 |
jelkner | import zope.interface | 19:57 |
jelkner | import zope.schema | 19:57 |
jelkner | class IPerson(zope.interface.Interfaces): | 19:57 |
jelkner | """ | 19:57 |
jelkner | """ | 19:57 |
jelkner | username = zope.schema.Text( | 19:57 |
jelkner | title=u"some title" | 19:57 |
jelkner | description=u"some description" | 19:57 |
jelkner | required=True) | 19:57 |
jelkner | is that correct? | 19:57 |
pcardune | yes, but dont forget to put in a docstring for the class, and replace the some title and some description with something better ;) | 19:58 |
jelkner | there is a docstring | 19:58 |
pcardune | I'm going to give you homework for next time if that is alright | 19:58 |
jelkner | it is empty | 19:58 |
jelkner | yes | 19:58 |
pcardune | well, write something in the docstring ;) | 19:58 |
jelkner | like? | 19:58 |
jelkner | never mind, i'll figure that out by looking at other examples | 19:59 |
jelkner | we can talk about that next time | 19:59 |
pcardune | like "A Person in timeclock." | 19:59 |
jelkner | can we meet next week at the same time? | 19:59 |
pcardune | sure | 19:59 |
jelkner | sunday at 11 est then | 19:59 |
jelkner | thanks a 10**6 pcardune! | 19:59 |
pcardune | ok, so your "Reading assignment" and i assume you all have stephan's book, or can look at it online... | 19:59 |
jelkner | i have it | 20:00 |
jelkner | so does flint | 20:00 |
pcardune | read chapter 8 | 20:00 |
jelkner | will do | 20:00 |
flint | ok, i get about twenty percent of this.... | 20:00 |
jelkner | and me and my study buddy (flint) will check in with each other during the week ;-) | 20:00 |
pcardune | to page 58 | 20:00 |
jelkner | flint: that's why you have a study buddy | 20:00 |
jelkner | i've got to run | 20:01 |
pcardune | well, actually, read the whole thing | 20:01 |
pcardune | so, read chapter 8 | 20:01 |
jelkner | we will read the whole thing | 20:01 |
flint | jelkner, you are a sick monkey... | 20:01 |
pcardune | that's it | 20:01 |
jelkner | cool | 20:01 |
jelkner | cya | 20:01 |
flint | pcardune, thanks paul... will read chapter 8 and wonder. | 20:01 |
jelkner | and thanks again! | 20:01 |
flint | sksk | 20:01 |
pcardune | and chapter 9 :) | 20:01 |
pcardune | or just glance at chapter 9 | 20:01 |
flint | pcardune, and chapter 9 | 20:01 |
jelkner | one chapter for a week is enought | 20:02 |
pcardune | i know you are busy people | 20:02 |
jelkner | we need to take this slow | 20:02 |
flint | pcardune, I will look at the pictures... | 20:02 |
jelkner | lol | 20:02 |
pcardune | it's 3 pages | 20:02 |
pcardune | and there are no pictures | 20:02 |
flint | hey I had a copy of zope up! I just forgot where. | 20:02 |
jelkner | ok, folks cya next week... | 20:02 |
*** jelkner has quit IRC | 20:02 | |
pcardune | cya on tuesday | 20:02 |
flint | sksk | 20:02 |
*** flint has left #schooltool | 20:02 | |
*** pcardune has quit IRC | 20:58 | |
*** jinty has joined #schooltool | 23:27 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!