[11:09] <sabdfl> how do i use the arch-tag line at the top of a file?
[11:25] <lalo> sabdfl: first you have to obtain an unique id from arch, and I don't know how to do that
[11:25] <sabdfl> what's the line used for?
[11:27] <lalo> arch doesn't use the filenames to "index" its metadata; it use an unique id for each file
[11:27] <lalo> so that it can track renames and moves
[11:34] <sabdfl> that much i understood, so i am curious what the tag inside the file is used for
[11:34] <lalo> ah
[11:35] <lalo> there are two ways to associate an id with a file; either in a separate file (that's what "tla add foo" does) or as a tagline inside the file
[11:35] <lalo> if you're in a source tree, "ls .arch-ids" will show you the id files
[11:37] <sabdfl> so i can just not put the tagline into a file, and use tla add as usual?
[11:38] <sabdfl> i'm moving some of the soyuz objects from doap.py to a new soyuz.py
[11:38] <sabdfl> where do i need to register that new file and its classes?
[11:38] <lalo> if you put the tag you don't need to use tla add anymore - it's already added
[11:39] <lalo> personally I prefer to use separate files (arch calls that "explicit" ids) all the time, but I think that's a matter of taste
[11:40] <lalo> where is doap.py?
[11:40] <sabdfl> i also prefer the separate id's
[11:40] <sabdfl> lib/canonical/database
[11:40] <sabdfl> i found configure.zcml
[11:40] <sabdfl> is there anywhere else?
[11:41] <lalo> let me check
[11:43] <lalo> *possibly* pages.zcml and sql.zcml - you'd have to check case by case
[11:43] <lalo> (I mean class by class)
[11:43] <sabdfl> and do i need to import this new file (import soyuz) anywhere?
[11:43] <sabdfl> or does the configure.zcml take care of that?
[11:43] <lalo> no, zcml takes care of that
[11:53] <sabdfl> erm, and what's the pqm mailing address?
[11:53] <sabdfl> pqm@chinstrap?
[11:53] <lalo> pqm@chinstrap.warthogs.hbd.com
[11:53] <lalo> yes
[01:20] <SteveA> run uuidgen to make a new uid
[01:54] <sabdfl> hey steve
[01:55] <sabdfl> SteveA: 
[01:55] <sabdfl> having fun now
[01:57] <daf> sabdfl: Dwayne has invited me to meet with him in London on Monday
[01:57] <sabdfl> daf: cool, come on over
[01:58] <daf> will do :)
[01:58] <sabdfl> daf: when are you planning to move your db access classes into lib/canonical/database/rosetta.py?
[01:59] <daf> sabdfl: I'll file a bug on that now
[02:00] <sabdfl> daf: i'm creating the base file
[02:00] <sabdfl> i'd like to clean things up a little
[02:01] <sabdfl> SteveA: when I send mail to arch-pqm it seems to be sending it as "mark@slinky" instead of mark@hbd.com, any idea how to fix that?
[02:01] <daf> sabdfl: try adding an entry to /etc/email-addresses
[02:01] <dilys> New bug 2036 for Launchpad/Rosetta: Rosetta database classes should be moved to canonical.database.rosetta
[02:02] <sabdfl> daf: what sort of entry?
[02:02] <daf> sabdfl: does the file exist already?
[02:02] <sabdfl> nope
[02:03] <daf> hmm, maybe Postfix doesn't use it then
[02:03] <sabdfl> hmm... should I purge and reinstall postfix?
[02:03] <daf> I'd ask somebody who knows it better than I do first :)
[02:04] <daf> sabdfl: by the way, could you take a look at https://wiki.canonical.com/RosettaAlphaAnnouncement when you have the time?
[02:12] <sabdfl> daf: looks good
[02:13] <daf> sabdfl: groovy
[02:13] <sabdfl> i'd like the alpha to be at rosetta.shuttleworthfoundation.org
[02:13] <daf> instead of (rather than as well as) at rosetta.ubuntulinux.org?
[02:13] <sabdfl> want to delay the penny dropping at red hat hq
[02:13] <daf> right
[02:14] <sabdfl> daf: we'll open up rosetta.ubuntulinux.org as soon as we actually announce
[02:14] <daf> right
[02:14] <daf> do I need to change the announcement in any way?
[02:14] <sabdfl> but if it leaks, i'd like it to leak in a way that isn't immediately connected to ubuntu
[02:14] <daf> I think the only other change we'd need to make is to the DNS
[02:14] <daf> oh, and the Apache config would need tweaking
[02:15] <sabdfl> i'll get thomas onto it
[02:16] <sabdfl> (dns), apace will need tweaking by our admins@
[02:17] <daf> right
[02:30] <SteveA> do you have a file called /usr/bin/\[ in ubuntu?
[02:34] <spiv> SteveA: yes.
[02:36] <spiv> SteveA: it's part of coreutils, apparently.
[02:36] <spiv> There's even a man page for it...
[02:43] <daf> isn't it identical to /usr/bin/test
[02:43] <daf> ?
[03:37] <sabdfl> ok, how do i setup a new page under the /malone/?
[03:39] <sabdfl> i guess i need to understand the traversal logic
[03:39] <sabdfl> where is that enshrined?
[04:04] <SteveA> sabdfl: if you just want a new single page, then use a <page ... > directive.  See malone/pages.zcml
[04:06] <sabdfl> SteveA: i'm trying to fix /malone/sourcepackage/firefox/
[04:08] <SteveA> I can't chat -- being dragged out to do some shopping :-/   May be around a bit later
[04:10] <sabdfl> ok, chat then
[04:11] <sabdfl> anybody else around to help with traversal?
[04:28] <sabdfl> why do some interfaces just inherit from Interface, others from IAddFormCustomization?
[04:45] <sabdfl> -
[04:45] <sabdfl> -
[05:21] <stub> sabdfl: Create a file /etc/postfix/canonical containing just a line like 'mylocalusername mark.shuttlework@canonical.com'
[05:21] <stub> sabdfl: Then add the line 'canonical_maps = hash:/etc/postfix/canonical' to the end of /etc/postfix/main.cf
[05:22] <sabdfl> stub: i think it's solved with an /etc/mailname of hbd.com
[05:22] <stub> sabdfl: Then run 'postmap /etc/postfix/canonical'
[05:22] <sabdfl> methinks we will need to tweak the postfix setup for Hoary to make this easier for users
[05:22] <stub> sabdfl: That would work too :-)
[05:23] <sabdfl> well, it only works because my local user is the same as my email@hbd.com
[05:23] <stub> sabdfl: It would involve another installation question - 'what is your email address?'
[05:23] <sabdfl> i wonder if .mailrc or .muttrc can be set to override all that anyhow
[05:24] <sabdfl> glad you're back, i'm doing battle with zope3
[05:24] <stub> re: IAddFormCustomization - the Z3 form generation machinery requires some hooks to work. That interface defines them
[05:25] <sabdfl> and sqlobject
[05:25] <stub> sabdfl: no idea about .mailrc etc.
[05:25] <sabdfl> given the SourcepackageContainer glass
[05:25] <sabdfl> how do i fix the traversal to /sourcepackage/mozilla-firefox/?
[05:26] <sabdfl> i'll try to do a pqm merge quickly...
[05:27] <sabdfl> so back to SourcepackageContainer
[05:28] <sabdfl> currently, it seems to __getitem__ on the basis of a package name
[05:28] <sabdfl> leaving aside the thorny problem of multiple packages with the same name
[05:28] <sabdfl> the current select looks like this:
[05:29] <sabdfl> return self.table.select(self.table.q.name == name)[0] 
[05:29] <sabdfl> where self.table = Sourcepackage
[05:29] <sabdfl> now, Sourcepackage has no name, just a sourcepackagename
[05:29] <sabdfl> so it seems what's required is a slightly smarter search
[05:30] <stub> The way I know to do that off the top of my head is to do sourcepackagename = SourcepackageName.select(SourcepackageName.q.name == name)
[05:31] <stub> Then return self.table.select(self.table.q.sourcepackagename == sourcepackagename)[0] 
[05:31] <stub> (ie. two steps) There might be a more efficient way of doing it in SQLObject, but I'm not familiar with it.
[05:32] <stub> (SourcepackageName is defined in canonical.database.doap if it isn't already imported)
[05:33] <sabdfl> what's self.table.q?
[05:33] <sabdfl> i've moved the Sourcepackage / Binpackage etc objects from doap.py to a new soyuz.py
[05:34] <sabdfl> and will do the same for rosetta shortly
[05:35] <stub> sqlobject magic (or the sqlbuilder bit of it). self.table is a class (subclass of sqlobject). the 'q' stands for query - I don't know the technical reason the syntax needs to be like that. The expression generates a SQL where clause (in this case just 'name = "thesourcepackagename"'). 
[05:36] <stub> You can just stick a raw SQL clause in there if you like, but you have to ensure you currectly quote everything in that case.
[05:37] <stub> (so return self.table.select('sourcepackagename in (select id from sourcepackagename where name = %s)' % sqlrepr(name)) might work as a single query version
[08:51] <sabdfl> how do we pass the connection to an SQLObject?
[08:51] <sabdfl> i'm trying to set up a test harness where i can get quick access to one of our db objects at the python prompt
[09:02] <sabdfl> hmm... sqlobject 0.6 seems to have many fixes. are we close to merging that?
[09:02] <sabdfl> and sending our fixes upstream? he's calling for patches
[09:04] <spiv> sabdfl: https://bugzilla.warthogs.hbd.com/bugzilla/show_bug.cgi?id=2020
[09:05] <sabdfl> spiv: thanks
[09:05] <spiv> And to answer the earlier question, SourcePackage.select('Sourcepackage.sourcepackagename = SourcepackageName.id AND SourcepackageName.name = '%s'" % quote(name))
[09:06] <sabdfl> spiv: do you know how best to tell an SQLObject what connection to use?
[09:07] <spiv> It depends :)
[09:07] <spiv> For this case, I think passing it explicitly to as a keyword arg would do.
[09:08] <spiv> (i.e. Foo.select(..., connection=your_connection) )
[09:08] <spiv> Or possibly use SQLBase.initZopeless
[09:09] <sabdfl> where do i find SQLBase?
[09:10] <sabdfl> ah, got it
[09:12] <sabdfl> now how do i use it?
[09:13] <spiv> SQLBase.initZopeless(connectionForURI('postgres:///exampledb'))
[09:13] <spiv> https://wiki.canonical.com/SQLObjectGuide is fairly complete these days.
[09:14] <sabdfl> fsck, i've spent all evening banging on this, should have checked the wiki first, hey
[09:18] <daf> spiv: hmm, perhaps canonical.lp.initZopeless should be documented somewhere also
[09:19] <spiv> daf: Oh, right, good idea.  
[09:19] <daf> spiv: also, you had some ideas about transactionality for standalone scripts
[09:20] <sabdfl> more fun and games
[09:20] <spiv> daf: Yeah, they're largely still ideas ;)
[09:20] <sabdfl> if i import sqlbase and use SQLBase.initZopeless, then try to import another module which also import sqlbase...
[09:20] <sabdfl> Traceback (most recent call last):
[09:20] <sabdfl>   File "harness.py", line 26, in ?
[09:20] <sabdfl>     from soyuz import *
[09:20] <sabdfl>   File "/home/mark/projects/ubuntu/code/launchpad/lib/canonical/database/soyuz.py", line 27, in ?
[09:20] <sabdfl>     from canonical.database.sqlbase import SQLBase, quote
[09:20] <sabdfl>   File "/home/mark/projects/ubuntu/code/launchpad/lib/canonical/database/sqlbase.py", line 7, in ?
[09:20] <sabdfl>     class SQLBase(SQLOS):
[09:20] <sabdfl>   File "/home/mark/projects/ubuntu/code/launchpad/lib/sqlobject/main.py", line 179, in __new__
[09:20] <sabdfl>     classregistry.registry(newClass._registry).addClass(newClass)
[09:20] <sabdfl>   File "/home/mark/projects/ubuntu/code/launchpad/lib/sqlobject/classregistry.py", line 69, in addClass
[09:20] <sabdfl>     raise ValueError("class %s is already in the registry"
[09:20] <sabdfl> ValueError: class SQLBase is already in the registry
[09:21] <spiv> sabdfl: !
[09:21] <daf> ewww
[09:21] <daf> haven't seen that before
[09:21] <sabdfl> so tell me about canonical.lp.initZopeless?
[09:21] <spiv> sabdfl: Somehow SQLObject thinks there's two classes with the name SQLBase, which is odd.
[09:21] <daf> sabdfl: that's a wrapper around SQLBase.initZopeless, which calls it with the host and dbname from canonical.lp
[09:22] <daf> sabdfl: to avoid us duplicating DB names in the code
[09:22] <spiv> (which defaults to launchpad_test)
[09:22] <daf> (and localhost)
[09:23] <spiv> sabdfl: Where's harness.py?
[09:23] <sabdfl> so i can just import canonical.lp and then run canonical.lp.initZopeless()?
[09:23] <daf> exactly
[09:23] <spiv> In canonical.database?  Ah, I see the problem, I think.
[09:23] <sabdfl> spiv: it's what i'm writing, it will setup a connection and have the objects ready then end
[09:23] <sabdfl> so you can do python -i harness.py
[09:23] <spiv> Change line 26 of harness.py to "from canonical.database.soyuz import *"
[09:24] <sabdfl> then immediately canonical.database.doap.Project.get(1)
[09:24] <spiv> Relative imports are bad :)
[09:24] <sabdfl> ok, so everything has to be "canonical.*"?
[09:25] <spiv> Yep, otherwise you can get situations where Python thinks 'sqlbase' and 'canonical.database.sqlbase' are two entirely differnt modules.
[09:25] <sabdfl> what's the correct python path setup?
[09:25] <sabdfl> ah, as we saw
[09:25] <spiv> Which seems to be what just bit you.
[09:26] <spiv> From the root of launchpad, PYTHONPATH=lib is what you want.
[09:28] <sabdfl> ok, it seems to be working, but i'll let someone else figure out the path stuff. phew, thanks
[09:31] <sabdfl> btw, i have a feeling that the 0.6 release fixes some of the problems with fields that end in "id"
[09:31] <sabdfl> man, sqlobject does weird things to you
[09:31] <sabdfl> sourcepackageName becomes sourcepackage_name arbitrarily
[09:31] <sabdfl> i see now there's method behind the madness, but it remains madness
[09:32] <spiv> That'd be nice.. and someone added a patch to sourceforge today to improve selectBy and foreign keys, so you can pass SQLOjbects, not just ids.  The implementation looks a bit dodgy, but hopefully it'll get fixed up and included.
[09:33] <spiv> Yeah, I don't like the default naming "style" much, and it's not completely overrideable.
[09:33] <spiv> I just always explictly set dbName and so on everywhere to avoid that.
[09:52] <sabdfl> any idea why vim keeps dropping to the next line when my line gets too long?
[09:55] <spiv> What does ":set tw?" report?  Perhaps try ":set tw=0", if I'm understanding what you mean?
[09:56] <spiv> (although if you're editing python, 80 columns is what our style guide says)
[09:56] <spiv> (er, I mean 78 :)
[10:13] <sabdfl> spiv: my tw=76
[10:14] <sabdfl> does that normally jump down a line when you are making a long one?
[10:14] <sabdfl> because the resulting code then does not parse in Python
[10:14] <sabdfl> even if it looks neater
[10:14] <sabdfl> daf: could you answer a traversal question for me?
[10:16] <daf> I'll try :)
[10:17] <daf> sabdfl: if you're having trouble with long lines, you have to either use () or \ to tell Python that a logical line is extended over more than one physical line
[10:19] <spiv> e.g. x = (foo, foo,
[10:19] <sabdfl> daf: so i need to let vim split the line, then put in a \?
[10:19] <spiv>          foo)
[10:19] <spiv> Python's happy with that.
[10:19] <daf> sabdfl: I prefer to put () rather than \
[10:19] <sabdfl> i haven't seen () used like that
[10:19] <daf> sabdfl: Python effectively ignores newlines inside parentheses
[10:20] <sabdfl> oh, that's sweetly inconsistent :-)
[10:20] <spiv> I'm having trouble of thinking of when I have written long lines that don't involve parens...
[10:20] <sabdfl> so here's the traversal question
[10:20] <sabdfl> hold on, there it isn't
[10:25] <sabdfl> hmmm... death by traceback :-)
[10:29] <dilys> New bug 2037 for Launchpad/Rosetta: main search form should search products as well as projects
[10:41] <sabdfl> whoop! managed to lose those tracebacks