Blog

  • Monkeypatching Django Admin

    When I started contributing to Mozilla Webdev, I started with Input. The bug that was always a mystery to me was bug 658658. The login page to Django’s admin worked in Django 1.2.3, but didn’t work with 1.3, which is what was in the input vendor. At that time, I didn’t know about monkeypatching Django well enough, or care enough to fix this. Last night, I was scrolling through bzhome (Thanks again Heather!) to find this bug again.

    This is how it looks before I fixed it

    Before fixing

    After 3 hours of working with folks in #webdev, especially jsocol, peterbe), and r1cky, we finally fixed it. The problem was that the monkey patching didn’t catch one case, the login and logout views which where not in django.contrib.admin but in django.contrib.auth. Thanks to everyone’s patience (especially r1cky, since we spent about 1 hour trying various combinations of things), the bug is fixed and I now know a little more about monkeypatching.

    After fixing
  • User Days Poll

    User Days were created to be sets of classes offered during a one day period to teach the beginning or intermediate Ubuntu user the basics in order to get them started using Ubuntu. User Days were born out of a discussion at the Ubuntu Developers Summit in November 2009 regarding Ubuntu Open Week not being targeted enough at users. User Days is hosted over the weekend for many hours at a strech so everyone will be able to participate at some point. Open week, however, is hosted during the week at the fixed time-range.

    This, however, is now changing. From this cycle on, Ubuntu Open Week will be targeted at users. As the organizers of User Days for the past 4 cycles, we’ve been wondering what the community thinks about this – Should we continue User Days or should we not. Please mark your opinion in a quick poll that I’ve created.

  • Launchpad bug titles are everywhere!

    A while back, I wrote about smart autolinkifying in bugs. Last week, at the urging of Brian Murray, I built on top of the work that I’d already done. This time, it grabs all the bug links and sends to the linkchecker and, in addition to the set of invalid bugs, it also returns a set of valid bugs with bug titles! The after effect is a ‘bug 1245’ link in the body of Launchpad like in bug tracker, merge proposals, etc, where bug 1245 is a valid bug number will have its ‘title’ attribute set to the bug title.

    Valid bugs have the 'title' attribute set as bug title and it shows up as a tooltip
  • Write more beautiful python code

    Contributing to more Python projects like Launchpad has also taught me about writing PEP8 compliant code. One is expected to run make lint and fix lint errors.

    Running pep8. Not real code though. I'm not /that/ bad :P

    A major part of the code I write at my day job consist of scripts, which I most often prefer to write in Python (second only to bash). I hate to admit it, but my code is rarely pretty. I just write hacky scripts. I now use pep8 and pyflakes on all the python code that I write. It does look nicer, although occasionally painful to fix 😉 Almost all the time pyflakes help me catch an error in the script even before I run the script.

  • 32-bit binary arrgh

    Running 32-bit binaries on 64-bit machines and it refuses to work? Over the last one month this happened to me several times. Sometimes even disguised as something else. Finally, figured out the solution and noted it down all over the place so I don’t forget.

    Building OpenCity

    The magic words are libc6-1386 and ia32-libs. Oh, and to check if a binary is 32-bit or 64-bit, use the file command.