[08:22] <dpm> good morning all
[08:31] <TLE> good morning
[08:37] <TLE> dpm: while reworking the images site, I stubled in the problem of wanting to index a dictionary with a value that is placed in a variable. I did figure out how to do it, by defining a new tag, but I think it is a little wierd that they decided that it should not be a builtin
[08:38] <TLE> http://stackoverflow.com/a/4661415
[08:39] <dpm> morning TLE
[08:39] <dpm> looking...
[08:39] <TLE> ahh sorry context missing: in a django template
[08:41] <dpm> TLE, are you having the same problem as that guy? I.e. outputing the columns in ordr?
[08:42] <TLE> no, just more general, I loop over a list of keys, and I need to acces data in dictionaries (or rather classes that act like dictionaries) using the value of that key
[08:42] <dpm> ah, I see
[08:42] <TLE> in any case, just thought I would share, as it seems like something you might need everyonce in a while
[08:46] <dpm> TLE, yeah, good to know. This might also work for you: you can override the __getitem__() method of your dictionary-like class to accept that variable and return you the right value
[08:46] <dpm> e.g. http://pastebin.ubuntu.com/874218/
[08:47] <dpm> (a snippet I used a while ago in a class that contains a dict with other classes)
[08:49] <TLE> I don't think that's applicable, the problem is that if you in template say: for key in listofkey then key will contain a value that you could print, but if you try access a dictionary item with: dict.key it will acces dict['key'] and not dict[key]
[08:50] <TLE> do the problem is that whatever I call my getitem method with will never change
[08:50] <TLE> err: so the pro...
[08:50] <dpm> ah, ok, I hadn't understood the issue, I get it now
[08:51] <TLE> in any case, the custom filter solution should work, I was just surprised it wasn't builtin (and will not be)
[08:52] <dpm> gotcha
[08:52] <TLE> dpm: on another note, on this talk of combining apps
[08:52] <dpm> yeah
[08:52] <TLE> how do you develop your stats app, i.e. get a dbase to work with
[08:53] <TLE> locally
[08:54] <dpm> As I'm using postgresql on the server, I'm also now using a postgresql database in my local machine, it's quite easy to set up, and I keep all the details of the connection on a local_settings.py file that I keep outside of revision control.
[08:54] <dpm> and I load from settings.py
[08:54] <dpm> I've also refined a bit more the "ifdefs" to detect the django version
[08:55] <dpm> as on the server it's still 1.1
[08:55] <dpm> http://bazaar.launchpad.net/~dpm/+junk/ubuntu-translations-stats/view/head:/settings.py#L35
[08:55] <dpm> for the ifdefs
[08:55] <dpm> and
[08:56] <dpm> http://bazaar.launchpad.net/~dpm/+junk/ubuntu-translations-stats/view/head:/settings.py#L212
[08:56] <dpm> for the local_settings.py module
[08:56] <dpm> that's where I keep the db connection variables (host, password, database) and the SECRET_KEY
[08:56] <head_victim> dpm & TLE I know you're both looking at translations websites. I just thought I'd share a drupal module (as opposed to your django work) that one of our awesome team members wrote in (I hope he doesn't mind!) http://is.gd/ltbgNL
[08:59] <TLE> dpm: ahh nice, how do you get data in the local dbase, run a script a few time manually or something?
[08:59] <dpm> head_victim, oh, that's really cool, I wished I would have known about this earlier, we could have shared some code! :) I see he's using the same diagram library that I'm using too :)
[09:00] <head_victim> dpm: I know a lot of canonical hosted sites for projects and locos use Drupal is all so thought it was worth a mention
[09:00] <head_victim> I don't think he's happy with the code yet enough to share it but he is planning on putting it up as a module for people to use when it's ready.
[09:01] <dpm> head_victim, yeah, the reason I'm using django is because the data manipulation requires a bit of coding, and it would be a bit difficult to do with Drupal + PHP, apart from the fact that for these kind of things Canonical IS strongly favours django over PHP
[09:02] <head_victim> dpm: I know how to admin a drupal install (barely), writing code is far from my forte so I'll trust you :)
[09:02] <dpm> :-)
[09:02] <dpm> head_victim, I'd also be interested in what TLE is asking: how does he get the data and store it?
[09:02] <TLE> +1
[09:02] <head_victim> I think it's a local cron.
[09:04] <dpm> and do you know if he gets the data from http://people.canonical.com/~dpm/data/ubuntu-l10n/ and processes it?
[09:04] <head_victim> I believe he scrapes LP
[09:05] <TLE> dpm: in any case, how do YOU get data in your local dbase for development?
[09:05] <head_victim> He's not currently online but when he was you two weren't so thought I'd just grab this opportunity to show it :)
[09:06] <head_victim> I can definitely ask him though.
[09:06] <dpm> head_victim, definitely, that's really cool :)
[09:07] <head_victim> I'll try to get him to post details to the ML because that doesn't matter what tz people are on then.
[09:08] <dpm> TLE, I used pg_dump to get the database data from the server at some point, and then imported it into my local database. Then I was good to go. I've also got the same cronjob that calls 'python manage.py importdata' to create a timestamp with the daily translation data, in the same way the server runs it, but in fact I do not need it. For development I just need the DB to be populated with some sample data
[09:09] <TLE> dpm: ahh ok, that sounds easy enough, then I think we should definitely look more at combining at some point, into a more general translation related site
[09:10] <dpm> TLE, yeah, what about something like a 'ubuntu-translations-webapps' project in LP?
[09:11] <dpm> I can create that during the course of the day, and set ubuntu-translations-coordinators as the driver, so that everyone in the team has got commit access
[09:11] <dpm> another nice thing about this is that we could share the CSS styles and the base.html template
[09:11] <TLE> yes, that sounds good, then you can also do your initial code dump of the stuff from your +junk branch
[09:11] <TLE> yes
[09:11] <TLE> exactly
[09:14] <TLE> uh btw, do you have 5 minutes for ... ahh crap my new desk NOW, I'll have to log off for a while
[10:48] <TLE> awesome, new desk that can be raised :D
[10:52] <dpm> ah, cool
[10:54] <dpm> I need to do something with my desk too. It's a proper office desk I got from my previous job when the company was replacing the old ones, but it's too low for me to work with the computer comfortably
[10:55] <dpm> I probably need a new shiny one with lots of things to tweak, but I wouldn't mind doing some DIY on the current one if I knew the best way to raise it :)
[10:56] <TLE> yeah
[10:57] <TLE> we have been slowly replacing the ones at my work with some that can be (motorizerd) raised and lowered, so you can spend a part of the day standing, to avoid those lower back office problems
[11:10] <dpm> TLE, If you are happy with them, I might ask you for the make of those desks at some point. I like the idea of having the possibility of having both a regular and a standing desk in one :)
[11:57] <TLE> dpm: Mine was ordered from a Danish manufacturer, so that'll probably not help you much
[11:57] <dpm> oh, but we live in a global world :)
[11:58] <TLE> also, they are kind of expensive, but if you do all you work a the computer it is probaly worth it
[11:58] <TLE> http://www.efgbondo.dk/products/products.asp?PageID=1954&ArticleNo=A32C07&ArticleID=35947&GroupString=
[11:58] <TLE> I don't think they deliver outside of country borders ;)
[12:00] <dpm> thanks :)
[12:00] <dpm> at least it will serve as reference to see if there is anything similar here
[12:05] <TLE> dpm: I sent you that long overdue email about the AliasMatching for the image app
[12:05] <TLE> just ping me if you have questions
[12:07] <dpm> TLE, yeah, I saw it, thanks. I'll be moving the docs webapp to the Canonistack cloud instead of my own amazon AWS account soon. I'll either put it on a dedicated server or in the same one the stats webapp is running, so when I do the move I'll review the regexps.
[12:08] <TLE> yeah ok, maybe we should see about combining them pretty soon then
[12:08] <TLE> the last stuff I wrote about just using a Alias gets a little more complicated if we have more than one app in a django instance
[12:08] <TLE> but not to much
[12:09] <TLE> we can just symlink the static directory over to the other app and share it
[12:15] <TLE> tell you what, if you can help me get a test instance of you app running, then I might be able to work on moving mine over
[12:16] <TLE> not necessarily right now off course
[12:21] <dpm> TLE, sure. For my own sanity I've written instructions on how to deploy an instance of ul10nstats on a server. I can definitely help you setting up a test instance, you just have to tell me where (in the cloud, on a local virtual server...)
[12:36] <TLE> local virtual probably
[12:38] <TLE> the problem is that'll have to push this to off work hours, so maybe if you show me instructions then I can see how far I can get on my own
[12:39] <TLE> and probably also a dbase dump, where you have set up a admin account for me beforehand, so I can add the images information when I get it up and running and instructions for how to import it
[13:07] <TLE> dpm: have you been talking to someone today about the lang packs?
[13:08] <dpm> TLE, hm, I haven't, and from what I see, the natty full langpack export failed :/ https://translations.launchpad.net/ubuntu/natty/+language-packs
[13:10] <TLE> ok, will you follow up on that?
[13:10] <dpm> yeah, I'm already on it
[13:10] <TLE> then I'll contact pitti about having the oneiric ons copied over to proposed
[13:10] <TLE> err: ones
[13:11] <TLE> you didn't have priviliges for that right?
[13:12] <dpm> no, only archive admins have privileges to upload to the archive
[13:21] <TLE> right
[13:42] <greyback> dpm: ping
[14:28] <dpm> hi greyback
[14:46] <greyback> dpm: hi, need your advice on setting up translations for unity2d. You were talking with tsdgeos yesterday. You recommended a precise-only branch to link with Precise translation, which makes sense. But is there a way to point Precise translations to a series (which then points to a branch)
[14:47] <dpm> greyback, yeah, I think Launchpad only lets you link to series, not to branches anyway, but let me double-check...
[14:47] <greyback> When Precise is released, we immediately branch it into a "precise" branch, which is used only for updates. All work will continue on a trunk
[14:48] <greyback> that precise branch will be our 5.0 series = Precise, so translations will stay Precise-only
[14:49] <dpm> greyback, right, so you can do the switch afterwards, but for now I think enabling translations for the 5.0 series on https://translations.launchpad.net/unity-2d/5.0 would work, right?
[14:49] <greyback> dpm: Yes I think so. Just wanting to check with someone who understands this :)
[14:50] <dpm> greyback, yeah, so the first thing you'll need to do will be:
[14:50] <dpm> 1. Set translations policy for the whole unity-2d project.
[14:50] <dpm> - You do this here: https://translations.launchpad.net/unity-2d/+configure-translations
[14:51] <dpm> - Choose: Launchpad, unity-2d 5.0, Ubuntu Translators, Restricted on the options
[14:51] <dpm> 2. Set up translations (automatic imports and exports) for the 5.0 series
[14:52] <dpm> - You do this here: https://translations.launchpad.net/ubuntu/hardy/+source/unity-2d/+sharing-details
[14:53] <dpm> (not too sure why the /hardy/ part appears in the url, though)
[14:53]  * dpm investigates
[14:53] <greyback> dpm: We have some translated files in the branch, so we import templates & translation files I guess
[14:54] <kelemengabor> dpm: hi, why ubuntu-translators? last week (or so), I told m4n1sh the same for activity-log-manager, but couldn't reason why it is the best - they have launchpad-translators, that's good too, or not good enough?
[14:54] <m4n1sh> I am still not sure what to do
[14:54] <kelemengabor> greyback: while we are at it, you want to fix https://bugs.launchpad.net/ubuntu/+source/unity-2d/+bug/933468 too, right? :)
[14:55] <m4n1sh> but in our case the application is no ubuntu specific
[14:55] <m4n1sh> it has some ubuntu specific code, but those are optional and can be configured via build system
[14:55] <kelemengabor> m4n1sh: AFAIK, in theory, unity-* isn't either ;)
[14:56] <m4n1sh> yes, but still right now it is mostly present in ubuntu
[14:56] <m4n1sh> but alm can be made to run on other distros anytime
[14:56] <m4n1sh> and unity depends on downstreams patches (AFAIK)
[14:56] <greyback> kelemengabor: that's the plan :)
[14:56] <dpm> kelemengabor, both would work. In theory, as upstream projects they should be assigned to launchpad-translators, but Unity is so coupled to Ubuntu that I just suggested ubuntu-translators as it's still the biggest translation group.
[14:57] <dpm> and to make things easier.
[14:57] <kelemengabor> greyback: cool :)
[14:57] <greyback> kelemengabor: thank you for reporting it, we'd not noticed
[14:59] <dpm> greyback, as an additional note on 2. - you can set the import to "import templates only" and the export branch to either the same branch as the imports or a separate one. The import branch is where the .pot files will be fed to Launchpad, and the exports branch where the .po files with the translations will be automatically committed
[14:59] <dpm> greyback, I hope that makes it clearer, if I can help in any way, just let me know
[15:00] <greyback> dpm: that helps hugely, thank you
[15:00] <dpm> cool :)