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