Clint Adams: The social music revolution
I accidentally read one
of Adam Kessel's blog posts, and I paused to be annoyed.
Neither vux nor randomplay
have Audioscrobbler support.
56692.17s user 2784.40s system 97% cpu 16:54:01.65 total39189.33s user 2417.85s system 96% cpu 11:57:52.48 total
5 hours less... and the kernel still works fine.
def install(domain, localedir=None, unicode=False):
import __builtin__
t = translation(domain, localedir, fallback=True)
__builtin__.__dict__['_'] = unicode and t.ugettext or t.gettext
__builtin__.__dict__['ngettext'] = unicode and t.ungettext or t.ngettext
(Python 2.4 users may want to have the codeset kwarg as well. Update: Fixed a thinko where I used “self” and meant “t”. Submitted upstream.)
Now with added bonus of not having to import ngettext yourself in every module. (Yeah, using __builtins__ is kind of ugly, but I’m just going for minimum interference with existing code.)
Before:
ncalls tottime percall cumtime percall filename:lineno(function)
1851 0.020 0.000 1.070 0.001 gettext.py:475(ngettext)
After:
ncalls tottime percall cumtime percall filename:lineno(function)
1851 0.000 0.000 0.010 0.000 gettext.py:345(ungettext)
Well, you know, sometimes even a corporate installation decides it needs to be activated. Then you just have to activate it for there is no other way to use it.Great. When I asked him what conditions make such an install so special as to warrant custom treatment, he shrugged. I will not go through the humiliating process of activating Windows over the phone. The Internet activation just times out for some reason unbeknown to me. Thank $DEITY for Linux^WDebian.
Next.