Category Archives: Coding

Paster server encoding problems

If you have stumbled upon strange unicode encoding errors within Paste server like this one: File “/usr/lib/python2.6/site-packages/paste/httpserver.py”, line 437, in handle_one_request self.wsgi_execute() File “/usr/lib/python2.6/site-packages/paste/httpserver.py”, line 290, in wsgi_execute self.wsgi_write_chunk(chunk) File “/usr/lib/python2.6/site-packages/paste/httpserver.py”, line 150, in wsgi_write_chunk self.wfile.write(chunk) File “/usr/lib64/python2.6/socket.py”, line 292, … Continue reading

Posted in Coding, Programming, Pylons, Python | Tagged , , , , , , | 2 Comments

Pylons, ContextObj attribute error, strict_c and fix

I’ve recently upgraded my Pylons to version 1.0 for the CMS project I’m working on and few things broke as a result. There were some changes in dependency packages as well, most notably changing of url_for to url which had … Continue reading

Posted in Coding, Programming, Pylons, Python | Tagged , , , , , | Leave a comment

How to get class method name in Python?

There are two ways to do this. You can either do: def whoami(): “””Returns name of the method.””” import sys return sys._getframe(1).f_code.co_name def callersname(): “””Returns name of the caller.””” import sys return sys._getframe(2).f_code.co_name Or you can simply do: import inspect … Continue reading

Posted in Coding, Programming, Python | Tagged , , | Leave a comment

How to retrieve current module path in Python?

If you ever wondered how current path for module can be retrieved reliably in Python, there is a relatively simple way to do this. Each module has a __file__ variable that can be used for it. The answer is pretty … Continue reading

Posted in Coding, Programming, Python | Tagged | Leave a comment

Streaming YouTube music videos as MP3 with Python

I’ve been talking with my friend about the idea of standalone YouTube music player in Linux, since we are using YouTube to listen to music very often. There is great wealth of good quality tunes published there and easy access … Continue reading

Posted in Coding, Linux, Programming, Python | Tagged , , , , | 5 Comments

Adding object class method in Python at run-time

Just a quick note about Python. I’ve recently tried to find answer for adding methods dynamically to Python objects created at run-time. I’ve seen solutions that use import new and then new.instancemethod, but it seems this module is deprecated and … Continue reading

Posted in Coding, Programming, Python | Leave a comment

Rabbyt and GTK GLExt example

To clarify my previous post a little I have made a simple example on how to use Rabbyt library with GTK GL Extension. Hope this helps. Cheers all… # /usr/bin/env python # # Rabbyt GTK GLext test # __author__ = … Continue reading

Posted in Coding, Game Programming, Python | Tagged , , , , | Leave a comment

Python, Rabbyt and GTK GLExt

It’s been a while since I wrote something actually useful to anybody here. I’ve decided to take down my personal posts, they are of no interest to anyone except me. Life sometimes sucks for me big time, but I’m moving … Continue reading

Posted in Coding, Galaxy Lords, Game Programming, Python, SpaceX Engine | Tagged , , , , , , , , | 2 Comments

Coding, Galaxy Lords and MOO2 Graphics Viewer

Recently I’ve been doing some pretty hard coding. As you may have already seen in the previous post I’m currently the developer of social-networking site for relatively young company. This is my primary project currently, one that I do for … Continue reading

Posted in Coding, Galaxy Lords, Master Of Orion 2 | 7 Comments

Description of MOO2 graphic formats part 2

It’s been a really long time. Many things changed, some usual and some not so usual twists and turns in my life caused abstinence from writing here. I had time to think about everything and I’ve finally decided to passionately … Continue reading

Posted in Coding, Formats, Hacking, Master Of Orion 2 | Leave a comment