User:Which Linden/Office Hours/2007 Sep 20
Jump to navigation
Jump to search
Transcript of Which Linden's office hours:
[11:12] | Which Linden: | Incidentally, I plan to post this transcript if it's cool with you all |
[11:12] | Tao Takashi: | sure :) |
[11:12] | Timeless Prototype: | fine with me |
[11:12] | Which Linden: | OK, that'll be the rule for future office hours |
[11:12] | Tao Takashi: | so I will hopefully find out more about this egg thing ;-) |
[11:13] | Laetizia Coronet is not sure what it is about anyway ;) | |
[11:13] | Which Linden: | The egg thing is totally on my task list |
[11:13] | Tao Takashi: | but I think developing and having it installed on the same machine should be no problem |
[11:13] | Tao Takashi: | PYTHONPATH should still be evaluated |
[11:13] | Which Linden: | Laetizia: python eggs are basically a convenient way to install Python code |
[11:13] | Tao Takashi: | and as said for developing buildout might be of great use |
[11:14] | Which Linden: | Kind of like Perl's CPAN and Ruby Gems |
[11:14] | Tao Takashi: | just give somebody a buildout script and it automatically installs all components needed for running the project |
[11:14] | Which Linden: | Hm.... that is nice |
[11:14] | Laetizia Coronet: | ok... then this is no office hour for me - I was witing for Daniel... |
[11:14] | Tao Takashi: | be it from svn, rpm, tgz, http, ftp whatever |
[11:14] | Which Linden: | Laetizia: oh, no Daniel office hours |
[11:14] | Which Linden: | We'd need to have eggs for Eventlet and Mulib, too |
[11:15] | Laetizia Coronet: | no idea what Python is beyond Monty :) have a good evening |
[11:15] | Which Linden: | You too |
[11:15] | Tao Takashi: | you too, Laetizia :) |
[11:15] | Kitto Flora: | Did I find the supposed Daniel Meeting? |
[11:15] | Tao Takashi: | Python is the best thing on earth though |
[11:15] | Which Linden: | Hah, wow, no, no Daniel here |
[11:15] | Laetizia Coronet: | No Daniel on his spot |
[11:15] | Laetizia Coronet: | Levenhall, the cornfield. Noone there |
[11:15] | Tao Takashi: | Daniel should be somewhere else but I also waited once for him without him coming |
[11:15] | Tao Takashi: | like with Glenn earlier |
[11:15] | Kitto Flora: | Where Daniel meets is a secret? |
[11:16] | Tao Takashi: | and for choosing the storage, zope3 interfaces might be nice |
[11:16] | Laetizia Coronet: | no no it is in Levenhall but e has a bad record for not showing up |
[11:16] | Laetizia Coronet: | bye |
[11:16] | Which Linden: | see ya! |
[11:17] | Tao Takashi: | so you basically declare an interface like IPersistenceManager and then you implement your persister class with implements(IPersistenceManager) |
[11:17] | Tao Takashi: | and then you can register it as a utility and retrieve it again with getUtility(IPersistenceManager) |
[11:17] | Which Linden: | What this reminded me of was that we still are working towards 1.0 with Eventlet and Mulib |
[11:17] | Tao Takashi: | which returns the actual configured implementation of IPersistenceManager |
[11:17] | Tao Takashi: | this has a set of defined methods then |
[11:17] | Which Linden: | Interesting, I'll give it a look |
[11:18] | Tao Takashi: | we really should do Python user Group meetings in here |
[11:18] | Tao Takashi: | I should join that group again and maybe announce something on the mailinglist |
[11:18] | Tao Takashi: | another task I probably won't have time for thouggh ;-) |
[11:18] | Tao Takashi: | in Zope3 we also have the nice concept of adapters |
[11:19] | Tao Takashi: | like if you have a class which does not implement a specific interface, like a getSize() method of an ISize interface |
[11:19] | Which Linden: | So check this page out: http://wiki.secondlife.com/wiki/Eventlet_1.0 |
[11:19] | Tao Takashi: | thn you can write an adapter which adapts the instance of this class to this interface |
[11:19] | Tao Takashi: | simply by writing adapater=ISize(instance) |
[11:19] | Tao Takashi: | and then adapter.getSize() |
[11:20] | Tao Takashi: | which is quite handy and better than subclassing |
[11:20] | Tao Takashi: | because you can configure the correct adapter and you don't need to change the original code of the class |
[11:20] | Which Linden: | Also: http://wiki.secondlife.com/wiki/Mulib_1.0 |
[11:20] | Tao Takashi: | *checking* :) |
[11:21] | Which Linden: | They're just a bunch of links to JIRA tasks, but basically what we're asking for is additions |
[11:21] | Which Linden: | I know people haven't really gotten off the ground with these libraries |
[11:21] | Tao Takashi: | I think they are quite specific for a certain task |
[11:21] | Which Linden: | (except for Baba who's tackling the hardest problem head-on) |
[11:22] | Which Linden: | Hmmmm.... I tend to think of them as quite general, but maybe that's because I have lots of use cases. :-) |
[11:22] | Which Linden: | What's the task you see them as limited to? |
[11:22] | Tao Takashi: | I must admit that I only skimmed them by now ;-) maybe they also simply need more PR |
[11:22] | Tao Takashi: | I need more time ;-) |
[11:22] | Which Linden: | Definitely need that |
[11:22] | Which Linden: | I need more sleep, while we're wishing. :-) |
[11:23] | Timeless Prototype needs more brains, hands and computers | |
[11:23] | Which Linden: | So what should we do for a start? Expand the examples more? |
[11:23] | Tao Takashi: | looking at the examples now :) |
[11:23] | Which Linden: | hah |
[11:23] | Tao Takashi: | do you do doctests? |
[11:23] | Which Linden: | Or maybe include the examples on the front wiki page |
[11:24] | Timeless Prototype: | the examples are bringing clarity to the intent, more examples would be cool |
[11:24] | Tao Takashi: | yes, usually code says more ;-) |
[11:24] | Tao Takashi: | that's also why I like doctests more because these are basically documented examples |
[11:24] | Which Linden: | Timeless: Gotta be careful, though: too many computers is like too many cats: always one getting out of the bag |
[11:24] | Which Linden: | What are doctests? |
[11:24] | Timeless Prototype: | :) |
[11:24] | Which Linden: | *googles* |
[11:25] | Which Linden: | oh, rad! |
[11:25] | Which Linden: | I see, it looks through your source for interactive examples then tries to run them |
[11:25] | Which Linden: | Yeah, we should totally do that |
[11:25] | Tao Takashi: | you can even use them in docstrings |
[11:26] | Tao Takashi: | Plone is mainly doctests these days, explaining interfaces and APIs |
[11:26] | Which Linden: | One problem is that these are networking libraries, so not everything makes sense as an interactive operation |
[11:26] | Which Linden: | I.e. our examples on the wiki use curl |
[11:27] | Which Linden: | I guess you can shell out |
[11:27] | Which Linden: | os.system |
[11:27] | Tao Takashi: | ok, right, there might be limits |
[11:27] | Timeless Prototype: | btw, loved the curl examples, very concise |
[11:27] | Tao Takashi: | and it seems always the biggest problem to work around these limits in tests ;-) |
[11:28] | Which Linden: | Donovan came up with the examples |
[11:28] | Which Linden: | That dude's tagline should be "it's *incredibly* simple" |
[11:28] | Timeless Prototype: | :) |
[11:28] | Which Linden: | We do have unit tests that start up httpd servers for each test |
[11:29] | Which Linden makes a task to convert to/add doctests. | |
[11:30] | Which Linden: | So for chttp, there's this dude who's been helping us with it |
[11:30] | Tao Takashi sees the name Bob Ippolito in the source :) | |
[11:31] | Which Linden: | He should send an intro email to sldev soon. |
[11:31] | Which Linden: | But just so you know, and aren't confused about why seeping.blister is committing to chttp :-) |
[11:31] | Which Linden: | (oh, it's not Bob) |
[11:31] | Which Linden: | Bob is cool, I *wish* he was working on stuff with us |
[11:32] | Tao Takashi: | well, just checking the source ;-) |
[11:32] | Which Linden: | Yeah |
[11:32] | Tao Takashi: | Bob should definitely be cool, heard lots of cool stuff about Mochikit |
[11:33] | Which Linden: | Yeah, mochikit is really nice |
[11:33] | Tao Takashi: | and I know we had a lengthy discussion about which of these libs to ship with Plone |
[11:33] | Which Linden: | And apparently he has something that makes Erlang easier to use, too |
[11:33] | Tao Takashi never had the need to use Erlang | |
[11:34] | Which Linden: | You don't need to use Erlang, Erlang needs to use *you*! |
[11:34] | Which Linden: | (in Soviet Russia) |
[11:34] | Tao Takashi: | ah, ic :-) |
[11:34] | Which Linden: | Timeless, you've been pretty quiet, anything on your mind? |
[11:35] | Timeless Prototype: | IMs! |
[11:35] | Timeless Prototype: | lol |
[11:35] | Which Linden: | Hah |
[11:35] | Tao Takashi: | btw, for the pages you might wan to explain maybe in how these libraries are different from the existing ones |
[11:35] | Which Linden: | Yeah, well, what are the 'competitors'? |
[11:35] | Which Linden: | Twisted |
[11:36] | Which Linden: | httplib |
[11:36] | Tao Takashi: | asyncore? |
[11:36] | Which Linden: | right |
[11:36] | Which Linden: | and mulib sort of gets into django and web frameworks territory |
[11:37] | Tao Takashi: | yes |
[11:37] | Tao Takashi: | at least in a basic sense |
[11:37] | Which Linden: | The major thing about eventlet and mulib is that they make it very easy to do lots of data-passing via http |
[11:38] | Which Linden: | Using it is rather a lot like very easy rpc |
[11:39] | Which Linden: | We should totally put up an example of a client-server application |
[11:39] | Timeless Prototype: | yeah |
[11:39] | Tao Takashi: | maybe a use case, too :-) |
[11:39] | Timeless Prototype: | the things it can hook into - have they been specced yet or are you just thrashing out the mechanism first? |
[11:40] | Which Linden: | Also, as Donovan alluded to, we have libraries that make it possible to speak LLSD with some process, which could potentially mean an all-Python client |
[11:40] | Which Linden: | s/client/viewer/ |
[11:40] | Tao Takashi: | Xan was telling me that during the architecture meeting |
[11:40] | Which Linden: | What do you mean "the things it could hook into"? |
[11:40] | Tao Takashi: | that there are LLSD libs around |
[11:40] | Tao Takashi: | I geuss the use case is backbone |
[11:40] | Tao Takashi: | but the page is empty yet ;-) |
[11:40] | Which Linden: | we just have to figure out the licensing for the llsd libs |
[11:41] | Timeless Prototype: | I've been away, not followed all this stuff about mulib etc |
[11:41] | Which Linden: | Oh, hah, yeah, the backbone page is so sad |
[11:41] | Tao Takashi: | booking gigs for the spotlight I guess :) |
[11:41] | Which Linden: | I don't know if backbone is really a good example, it's really just a registration service for mulib web applications |
[11:42] | Which Linden: | so we have all these independent applications and the backbone coordinates the url space |
[11:42] | Tao Takashi: | I wonder if I can put my PDF generator on eventlet or so |
[11:42] | Tao Takashi: | as it really just needs a very basic web server which takes arguments and calls the PDF generation method |
[11:42] | Tao Takashi: | right now I use TurboGears for it |
[11:43] | Which Linden: | Sounds like a great use case |
[11:43] | Tao Takashi: | but I don't need any mysql, templating etc. |
[11:43] | Which Linden: | Yeah, you just want it to serve up some HTTP |
[11:43] | Tao Takashi: | does mulib expose methods, too? |
[11:43] | Which Linden: | Hey Armand |
[11:44] | Tao Takashi: | or just a handle_get? |
[11:44] | Tao Takashi: | Hi armand |
[11:44] | Which Linden: | Oh, yeah, handle_put, handle_head |
[11:44] | Armand Callisto: | Greetings all |
[11:44] | Which Linden: | you name it |
[11:44] | Timeless Prototype: | hi Armand :) |
[11:44] | Tao Takashi: | ok, but it's not exposing methods then |
[11:44] | Which Linden: | What do you mean "exposing" them? |
[11:44] | Tao Takashi: | like http://localhost:8080/whatever calls whatever() in my class |
[11:44] | Which Linden: | Oh, yeah, it does that |
[11:44] | Tao Takashi: | ok :) |
[11:44] | Armand Callisto: | you mean like posting the proof of concept on the jira? |
[11:45] | Which Linden: | Armand: we're talking about using mulib for web applications, and how best to use it |
[11:45] | Armand Callisto: | oh sweet |
[11:45] | Tao Takashi: | Hey Donova :) |
[11:45] | Tao Takashi: | n |
[11:45] | Tao Takashi: | sorry :) |
[11:45] | Timeless Prototype: | hi Donovan! |
[11:45] | Donovan Linden: | howdy |
[11:45] | Which Linden: | Yo dude |
[11:46] | Tao Takashi: | so now that I know your lastname, it rings a bell :-) |
[11:46] | Timeless Prototype laughs | |
[11:46] | Which Linden: | Tao was just asking about how to get http://localhost:8080/whatever calls whatever() in my class |
[11:46] | Which Linden: | ok, I clearly just copied and pasted that line, badly |
[11:46] | Which Linden is like eliza | |
[11:47] | Tao Takashi: | well, I could actually simply do it myself in handle_get() via getattr() |
[11:47] | Which Linden: | So, I think you're right, you don't expose methods that way, you expose resources |
[11:47] | Which Linden: | Because the url is a noun |
[11:48] | Which Linden: | So you'll want to do different things whether you GET localhost/whatever or PUT |
[11:48] | Which Linden: | or whatever the verb is |
[11:48] | Which Linden: | That is The REST Way (tm) |
[11:48] | Tao Takashi: | the method is a noun |
[11:48] | Donovan Linden: | yeah -- I never liked zope putting the method name in the url |
[11:48] | Tao Takashi: | err verb :) |
[11:49] | Armand Callisto: | ok |
[11:49] | Which Linden: | Yeah, the method is a verb, so each object has 6 verbs |
[11:49] | Which Linden: | (barring http extensions like webdav) |
[11:49] | Tao Takashi will never come back if there are Zope haters around here ;-) | |
[11:50] | Tao Takashi: | but actually somebody implemented REST for Zope3 at the last Snow Sprint |
[11:50] | Which Linden: | No hate here. :-0 |
[11:50] | Tao Takashi: | jk |
[11:51] | Which Linden: | Even Rails has started to implement noun-centric REST apis |
[11:51] | Tao Takashi: | the only thing is that I am not sure how to do it the REST way with my setup ;-) |
[11:51] | Tao Takashi: | as this server really just get's the parameters needed for generating the PDF from the browser |
[11:51] | Which Linden: | Yeah, it's tricky to convert existing applications |
[11:51] | Tao Takashi: | or I construct a filename out of them but that might be long |
[11:52] | Which Linden: | Well, you could have the client POST to get a uuid-based document url |
[11:52] | Tao Takashi: | you mean 2 requests then? |
[11:52] | Which Linden: | then it PUTs to that url the document, and then GETs the url with varying accept headers to choose PDF or original |
[11:52] | Which Linden: | yea, two requests |
[11:53] | Donovan Linden: | I can imagine a PUT of an xml or json content type, and a GET of a pdf content type doing the conversion |
[11:53] | Tao Takashi: | well, it's really the last step in a wizard here, one server does all the wizard work in asking questions about how it should look and gets back with a big dictionary which I put in a hidden field in a form |
[11:53] | Donovan Linden: | yeah, what which said. hehe |
[11:54] | Tao Takashi: | and the last click will then go to another server with this information |
[11:54] | Tao Takashi: | so with the two request I'd need some way of storing data I guess |
[11:54] | Donovan Linden: | the first server can do the PUT to the second server, then tell the browser to GET it |
[11:54] | Tao Takashi: | true, but wouldn't I need some temporary storage? |
[11:55] | Which Linden: | Our development paradigm has been to build a REST backend and then build a front-end that uses HTML |
[11:55] | Which Linden: | So, yeah, in that case the front-end has to have some state |
[11:55] | Which Linden: | Or it could pass it around on every request |
[11:55] | Donovan Linden: | the pdf server would be a persistent store of those xml documents, unless someone deleted them |
[11:55] | Which Linden: | Or, well, only one request, I guess |
[11:56] | Tao Takashi: | well, if I would generate the PDF on PUT it would work by simply refering to it |
[11:56] | Donovan Linden: | yeah exactly |
[11:56] | Tao Takashi: | but actually I wanted to get rid of waiting for the PDF on the original server and a PUT would do that again |
[11:57] | Which Linden: | I guess the PDF itself could be the body of the response to the PUT |
[11:57] | Tao Takashi: | so I guess for now I will simply stay with parameters :) |
[11:57] | Tao Takashi: | it's not a publci API anyway here |
[11:57] | Tao Takashi: | and also mainly just a little test |
[11:58] | Tao Takashi: | so your use case for mulib is mainly to serve an URL dict then? |
[11:58] | Which Linden: | Hoo, no, not really |
[11:58] | Which Linden: | Though that ability is very useful |
[11:58] | Tao Takashi: | see, you should write use cases :) |
[11:58] | Which Linden: | Yeah, we should |
[11:59] | Timeless Prototype nods | |
[11:59] | Donovan Linden: | "REST" is the use case :) |
[11:59] | Which Linden: | Yeah, but that's not enough |
[11:59] | Tao Takashi: | and REST wasn't possible with other frameworks? |
[11:59] | Which Linden: | Aren't you the one who said that Zope *just* got support for REST? |
[11:59] | Donovan Linden: | it is possible, but most frameworks don't have it as the central design principle |
[11:59] | Which Linden: | You have to convince people that REST is a good way to architect things |
[11:59] | Which Linden: | :-) |
[12:00] | Tao Takashi: | I like the concept of resting actually ;-) |
[12:00] | Tao Takashi: | I should do that more :-) |
[12:00] | Armand Callisto laughs | |
[12:00] | Donovan Linden: | I think a major part of REST that people don't understand the power of is content type negotiation |
[12:00] | Tao Takashi: | maybe I am one of them ;-) |
[12:01] | Tao Takashi: | maybe I am too much Zope ;-) |
[12:01] | Donovan Linden: | for example PUT as json and GET as PDF or HTML |
[12:01] | Which Linden: | It's cause everyone is using their browser, which they can't control the Accept header for |
[12:01] | Donovan Linden: | very powerful when you start thinking in that way |
[12:01] | Tao Takashi: | sounds a bit like different views in Zope3 |
[12:02] | Donovan Linden: | yup |
[12:02] | Tao Takashi: | depending on what interface is used for the incoming request (can also be ftp or whatever) content is delivered differently |
[12:02] | Which Linden: | I think mulib really scores on negotiation. I don't even think about it |
[12:02] | Which Linden: | (except when it's broken) |
[12:02] | Armand Callisto: | ....nothing is broken... |
[12:02] | Tao Takashi: | don't break it then ;-) |
[12:03] | Donovan Linden: | Leonard Richardson gave me a good idea about content negotiation in the browser... let the file extension override |
[12:03] | Which Linden: | Yeah, that was a good idea |
[12:03] | Donovan Linden: | for example, PUT to foo.json, then get from foo.pdf |
[12:03] | Donovan Linden: | the actual entity url is foo |
[12:03] | Which Linden: | sucks that you then have to have a mapping from extension to mime-type |
[12:04] | Donovan Linden: | python already has that |
[12:04] | Which Linden: | Oh, well, then |
[12:04] | Tao Takashi: | I think we need to get more Python folks here :) |
[12:04] | Donovan Linden: | example in mulib.resources.File |
[12:04] | Which Linden: | OK then, that's the goal: moar python |
[12:05] | Armand Callisto: | you have a few thousand hard core python folks...just put out an invitation |
[12:05] | Tao Takashi: | and when will you hen start with the pyhton only viewer? :) |
[12:05] | Donovan Linden: | content_type, encoding = mimetypes.guess_type(path) |
[12:05] | Tao Takashi: | or when is it finished is the better question |
[12:05] | Which Linden: | I don't think we have the cycles for a python-only viewer yet |
[12:05] | Tao Takashi: | then I would finally join the viewer development :) |
[12:06] | Tao Takashi: | I'd have some ideas ;-) |
[12:06] | Which Linden: | We'd just make the capability available |
[12:06] | Donovan Linden: | viewer is probably going to stay c++ forever :) |
[12:06] | Tao Takashi: | well, your viewer |
[12:06] | Donovan Linden: | a python viewer would probably be a fork |
[12:06] | Donovan Linden: | zactly |
[12:06] | Tao Takashi: | but a library would be nice for a start |
[12:06] | Which Linden: | True |
[12:06] | Which Linden: | Hey, but our hour is up, so let's pick this up again next week. |
[12:06] | Tao Takashi: | I am not really keen on doing things in C# actually ;-) |
[12:06] | Armand Callisto: | k |
[12:07] | Tao Takashi: | yep, I also need to go home :) |
[12:07] | Tao Takashi: | thanks for hosting :) |
[12:07] | Donovan Linden: | bye :) |
[12:07] | Timeless Prototype: | k tc guys, ty |
[12:07] | Armand Callisto: | Safe journies |
[12:07] | Which Linden: | Thanks all, you were a gret crowd |
[12:07] | Tao Takashi: | thanks :) |
[12:07] | Which Linden: | great |
[12:07] | Which Linden: | Blah, see you later |
[12:07] | Tao Takashi: | :) |
[12:07] | Tao Takashi: | cya |