[00:25:31] ** pythonhead has left IRC ("Client exiting") [01:59:37] ** whit has joined us [02:02:59] ** whit has left IRC (Client Quit) [02:07:03] ** whit has joined us [02:07:11] ** whit has left IRC (Client Quit) [02:35:23] ** hazmat has joined us [04:02:47] [connected at Wed Aug 10 04:02:47 2005] [04:02:47] <> *** Looking up your hostname... [04:02:47] <> *** Checking ident [04:02:47] <> *** Found your hostname [04:03:20] <> *** No identd (auth) response [04:03:20] <> *** Your host is zelazny.freenode.net[zelazny.freenode.net/6667], running version hyperion-1.0rc5 [04:03:20] [I have joined #peak] [05:01:53] ** hazmat has left IRC ("This computer has gone to sleep") [11:25:32] ** whit has joined us [11:28:37] ** MFen has joined us [11:28:42] hello [11:28:47] ** whit has left IRC (Client Quit) [11:29:02] is this the python enterprise application kit? [11:29:09] or something to do with mountain climbing [11:29:27] if the former, my question: has there been any work done on self-installing eggs? [11:30:11] i.e. completely self-contained. my immediate need is for one that can run assuming python is already on the system, but eventually i suspect someone will want one that comes with python [11:42:15] Have you read about Phillip's work on easy_install? [11:42:56] (And yes, this is not a mountain-climbing channel. :-)) [11:43:25] erikrose: yeah, but doesn't it require easy_install? [11:44:43] fwics, easy_install makes it possible to install an egg from a url without downloading anything first [11:44:54] the model i'm looking for is you download the egg, then run it, and it's installed now [11:44:58] That sounds right. I haven't use it. [11:45:02] i have [11:45:23] Then I probably can't tell you anything new. [11:45:27] see, i have these servers [11:45:47] they all run a bunch of services and need a bunch of python software installed and there's, you know, setup involved [11:46:16] mmhmm [11:46:16] i want to be able to put a file on a network, or on a cd, and say "type this command line and the server will be installed" [11:46:32] Are you using a package manager? [11:46:40] they're ubuntu [11:46:54] You couldn't just make an apt package for your stuff? [11:47:08] been that route [11:47:17] No fun? [11:47:22] running an apt archive is a lot of maintenance, besides which whoever's doing the installing has to know to edit sources.list [11:47:33] true [11:47:47] Though I suppose one could pass in sources on the commandline (guessing). [11:48:09] nah, that's not how apt works [11:48:25] it has to download an archive listing, and shuffle it with all the other listings it knows about to get a global package list [11:48:32] has to do that in two steps [11:48:53] i suppose there must be a way somewhere to install a package from a url [11:49:33] but it would be even easier if i could just hand them some removable media and say "your server's on here, run this" [11:50:17] Just off the top of my man page, you could, I suppose, pass in a custom config file with apt-get -c. That's ugly, though. [11:50:57] I'm leaning toward making easy_install part of your standard server build. [11:51:31] sure, but it has to get there first [11:51:45] If you don't want to do that, I guess you could ship it with your Python code and have it delete itself when it's done. That's ugly, too, though. [11:51:52] i.e. something still has to come before it [11:51:54] Oh, wait. [11:52:01] I think I finally see what you're getting at. [11:52:22] You want 5 words you can throw at a shell and have your PYthon stuff install itself from a remote server? [11:52:55] remote or local [11:53:08] An*other* server, in any case [11:53:18] the worst case scenario is the whole network just burned down, and they're installing from scratch [11:53:30] and all they have is my CD, with the command line printed on the face [11:53:43] (it's a small office) [11:53:56] And why not throw easy_install on the CD? [11:54:21] good point [11:54:30] :-) [11:55:26] so how would i really leverage that? cram a bunch of eggs onto the CD? [11:55:58] can eggs do interesting stuff while they're installing, like run apt-get or modify config files? [11:56:09] I couldn't tell ya. [11:56:26] hmm [11:56:31] If you have network access, though, easy_install should be able to yank down most of the eggs for you. [11:57:42] at least one of the things this program has to check is whether there's network access :) [11:57:57] Ah. :-) [11:57:58] but that's trivially done without easy_install [12:02:22] So, does that solve your problem? [12:02:29] i think i can work with that [12:02:35] Nifty! [12:02:39] i was thinking in terms of a single file [12:02:56] but the actual use case is a single piece of removable media, and i can put all kinds of stuff on there [12:03:36] Files are arbitrary containers, anyway. You can always mash a bunch of them into an archive if you need to for some disgusting reason. [12:03:50] Mac OS X treats some folders as files. Whatever. [12:04:00] In fact, it treats some files as folders, too. ;-) [12:04:10] As does reiserFS [12:04:17] reiserfs4 does [12:04:25] Huzzah for reiserFS! [12:04:27] that would be useful, but too bad. [12:04:55] if it's not part of the standard ubuntu install, i can't rely on it [12:05:01] happily, python is [12:05:09] Yeah, it's too much work for your purpose, anyway. [12:22:54] ** pje has joined us [12:24:07] Hi there. [12:24:46] Got SQLDM calling oidFor correctly, btw. Got rid of a bunch of code and even simplified the interface. Nice design on the peak.storage stuff! [12:52:08] ** sprout has joined us [12:53:36] Yow. Just noticed I signed onto the wrong IRC network. [12:53:53] i.e., I meant to sign on to the one for my job. :) [13:04:31] hehe [13:04:35] Lucky me [13:13:23] MFen, FYI, but you can use ez_setup.py as a frontend to EasyInstall, as long as it's run from a directory with a setuptools egg of the right version present. [13:13:50] pje: that sounds like what i want [13:14:43] Oops, I spoke incorrectly. [13:15:04] the 'use_setuptools()' function does that, but not main() [13:16:32] I guess you'd need a separate script that imports use_setuptools from ez_setup and calls that. [13:16:41] ok. [13:16:51] Or alternately, put the setuptools egg on PYTHONPATH before running ez_setup [13:16:55] i can't just use easy_install? [13:17:07] You still have to have the egg on sys.path [13:17:31] ah, right. [13:17:45] If the idea is just to dump eggs on a CD-ROM [13:17:53] eggs and other stuf [13:18:19] Yeah, well, if you have an installation shell script, it can put setuptools on PYTHONPATH and then run ez_setup.py [13:18:35] At that point, you have no "build" needed to make your CD [13:18:41] just dump eggs and ez_setup.py on there [13:18:46] And your script. [13:19:18] right [13:19:34] By the way, it's possible in principle to make eggs "eggsecutable" on platforms that have #! shell scripting. [13:19:51] hehe [13:19:51] well for now it only has to work with ubuntu linux [13:19:57] so, #! and python are all over that [13:20:20] You can prepend a #!/bin/sh script that ends with an exec to the start of an .egg [13:21:27] The zip directory is read from the end of the file so it doesn't interfere. [13:21:58] an exec to the start of an egg? [13:22:06] Yeah, put a header like this: [13:22:08] #!/bin/sh [13:22:22] PYTHONPATH=$0 exec python2.4 -c "...." [13:22:50] Put that in a file, then "cat headerfile some.egg >eggsecutable.egg" [13:23:18] ok, but what's in -c? [13:23:20] Note that it has to keep the .egg extension if you use any pkg_resources stuff on it. [13:23:25] Whatever you want. :) [13:23:36] "from somewhere import main; main()" for example [13:23:55] but that doesn't magically start running the egg [13:23:58] technically you should probably have a $@ or something after the -c [13:24:18] You import something that's in the egg. [13:24:24] this strikes me as something you should write up and put on the site :) [13:24:45] OH. PYTHONPATH=$0 [13:25:11] ok, i get it now. maybe i'll write it up and send it to you [13:25:15] Cool. [13:25:31] I actually used this to distribute earlier versions of EasyInstall/setuptools [13:25:56] But it got to be a pain doing two versions. [13:27:06] Also, I think there were some problems that I had; I think they were specific to trying to use this as an install mechanism for EasyInstall itself though. [13:27:25] i see [13:27:57] The biggest weakness is more that if you don't have pkg_resources available, it doesn't do much good to just put this header on any old egg [13:28:21] I see it being most useful for "baskets", which are zip files that contain .egg directories inside. [13:29:09] Basically, if you took the setuptools egg zipfile, and you added subdirectories in it for other .eggs, then you'd have a "basket" that, when put on sys.path, would be able to import setuptools and then discover any other eggs in the basket. [13:30:15] well, that's the idea [13:30:33] So your '-c' might be 'from pkg_resources import run_script; run_script("MyEgg", "main_script")' [13:30:39] for the python stuff, anyway, just to get the ball rolling [13:30:50] other resources might be .debs or shell scripts to run or something [13:40:36] btw, does ubuntu do the crazy debian thing of not including distutils? [13:41:04] yep [13:41:05] Because pkg_resources won't run without the distutils. [13:41:10] oh damb. [13:41:37] They're going to be well and truly screwed if Python 2.5 includes pkg_resources. :) [13:41:46] Maybe that'll convince them the policy is brain-dead. [13:42:16] it is brain-dead. i don't understand it at all [13:42:27] it has to do with gcc being optional, i think [13:42:40] but distutils doesn't really "require" gcc. it could be Recommended or something [13:43:11] In any case the distutils have tons of stuff that's unrelated to gcc. [13:43:32] I could see having a separate package for the python headers, and make that package require gcc [13:43:43] But the distutils is in the stdlib, it belongs there, period. [13:44:15] yep [13:44:37] Anyway, if you're targeting such a thing, then you're going to need to include the python-devel package or whatever it's called on your CD as well. [13:44:56] * MFen sighs [13:45:20] at least that's just one line in the shell script to dpkg -i it [13:47:40] I suggest you contact whoever maintains those packages and make the case for keeping distutils in the stdlib, and putting only headers in the devel package [13:47:58] I would do it myself, but I don't use Debian or ubuntu so I'm not one of their users. [13:48:18] Maybe if enought users speak up (and volunteer to implement the fix), it would change. [13:49:19] The irony is that it surely must be *more work* for them to split the distutils *out*. [13:50:44] debian developers are no shirks when it comes to doing unnecessary work [13:50:57] Ah. :) [15:36:25] ** pje_ has joined us [15:54:16] ** pje has left IRC (Read error: 110 (Connection timed out)) [16:07:01] FYI, erikrose, a feature's 'isChangeable' tells you if it's writable [16:07:19] Yup! I ran into that the other day when making my derived attributes. [16:07:50] I'm not yet sure the semantics exactly match what my sqldm needs to know. [16:08:54] It's for fields that can only be set at construction time. [16:09:06] My readOnlyFields can't even be set at new-row time. [16:09:14] Also, you might want to look at attribute metadata [16:09:18] They're fields that the DB has to figure out, like timestamps and autoincrements. [16:09:24] Now that is an idea. [16:09:40] What do I read to learn about that? [16:09:49] http://svn.eby-sarna.com/PEAK/src/peak/binding/attributes.txt?view=markup [16:09:54] Thanks! [16:10:33] Probably what you want is to make a class for an "SQLSchema" or "SQLMapping" [16:10:43] And then give it methods that return metadata objects [16:10:49] e.g. myschema=SQLSchema() [16:11:08] binding.metadata(some_field = myschema.Field('blah', ...), ...) [16:12:13] That might even be a better way to define the SQL-attr mappings. [16:12:14] Or, binding.declareMetadata(SomeModelClass, some_field=...) [16:12:23] Yes, it would. [16:12:28] That's why I mentioned it. :) [16:12:32] :-D [16:12:40] Also, model attributes can set a 'metadata' attribute that does the same thing. [16:12:58] But you can also make a module that just consists of a bunch of 'binding.declareMetadata(ModelClass, ...)' calls [16:13:13] Meaning you can have more than one SQL schema for a given model. [16:13:17] It seems better to keep the model and storage concerns decoupled, no? [16:13:51] Yes, that's what I'm saying. That's why you want a "schema" object to hold the mapping in. [16:14:19] What threw me off was "model attributes can set a 'metadata' attribute that does the same thing". [16:14:42] I'm just noting that it's an option, not recommending that it be used in all cases. [16:14:47] Ah, gotcha. [16:15:02] However, if it's tied to a particular 'schema' instance, then it doesn't stop you from having alternate schemas. [16:15:30] So the harm is minimal, IMO [16:16:04] In that scenario, the schema instance would come along and overwrite the model's original metadata with its own? Is that how that works? [16:16:27] Or is the metadata per-instance instead of per-class, or what? [16:16:36] No, what happens is that you get a callback when metadata is declared, telling you what class and attribute the metadata was declared on. [16:16:48] You then use that callback to populate a mapping table in your schema instance. [16:17:29] That's how the options framework does its thing. [16:17:39] Although it has only one global schema, in effect. [16:17:42] I think I have some code to read. [16:19:35] Another place where you could make more use of the existing metadata is foreign keys. [16:19:57] Attributes know what type they reference, so all you need to know is which types are other Elements. [16:20:16] And then you can use the storage.DMFor() keys to look up their DMs. [16:23:04] That would save me hard-coding DM names into stateForRelations(); is that what you're saying? [16:24:03] Yep. [16:24:08] nifty [16:24:15] It would also eliminate hardcoding attributes in there. [16:24:15] OAOO [16:24:22] eh? [16:24:27] Once And Only Once [16:24:37] Ah. I prefer DRY. :) [16:24:42] (Don't Repeat Yourself) :) [16:25:01] Also, your _load should raise InvalidKeyError, not KeyError. [16:25:21] spiffy; thanks [16:25:37] that will make dm.get(key) work properly [16:25:55] This is good. [16:26:07] using dm.__getitem__ is deprecated for anything other than foreign key references. [16:26:39] Ah, really? [16:26:55] Yeah, didn't you see my post when I added those new features for add() and remove() [16:27:05] The tutorial needs updating, I'm afraid. [16:27:07] I'm actually a few revisions behind. [16:27:26] I develop on Mac and deploy on Windows, and it's a pain to get all the various compilers to behave. [16:27:43] The primary DM interface is now get(), add(), and remove() [16:27:55] But it's time I upgraded. I did know about the add/remove stuff (and even suggested some of it), but I didn't catch the __getitem__ deprecation. [16:28:07] http://peak.telecommunity.com/snapshots/ has prebuilt windows eggs. [16:28:14] Ahhhhh. :-DDDD [16:28:23] Gloriousness. [16:28:43] The problem with __getitem__ is that it returns ghosts, but usually in code you want to know if the object exists or not, not get a ghost now and an error later. [16:28:46] That's going to do wonders for PEAK's acceptance (even if that's not what you're gunning for). [16:29:21] newItem() is also deprecated; now you just make objects and .add() them. [16:30:18] Yep, knew that part [16:30:35] Does the old stuff still work, or will I have to eat an elephant? [16:30:41] Also, your current _thunk() looks redundant; you should just raise ValueError. [16:30:50] Yes, the deprecated things still work. [16:31:04] Or NotImplementedError. [16:31:13] For that matter, just don't define _thunk() at all. :) [16:31:27] Ah yes, it does check "if ob._p_jar is self", doesn't it? :-) [16:31:50] You should steal my docstring for _thunk, though, which I paraphrase from you yesterday. [16:32:09] I spent a lot of time trying to figure out what it was supposed to do. [16:45:51] Say, pje_, where does DMFor() get its information? [16:46:19] DMFor is a *key* [16:46:36] See the bulletins example for how to use it and define the lookups [16:46:48] ok; thx [16:46:56] bulletins.ini has a "Component Factories" section that declares the dm's. [16:47:09] That's what I was afraid of. [16:47:39] Don't mind me. Just an irrational fear of config files. I'll get over it. ;-) [17:08:05] You can declare them in an object that's a parent component. [17:08:29] i.e binding.Make(SomeDMClass, offerAs=[storage.DMFor(SomeModelClass)]) [19:29:21] ** MFen has left us [20:50:52] ** whit has joined us [21:23:22] ** whit has left IRC (Read error: 110 (Connection timed out)) [21:56:28] ** sprout has left IRC ("Snak 5.0 IRC For Mac - http://www.snak.com") [22:09:34] ** pje_ has left IRC ("Client exiting")