Looking for IT consultant?
If you are looking for skilled software developer or devops engineer, contact me! I just might be able to help you. Reach me at: karol at karoltomala dot com
Author Archives: Wolverine
Force Midnight Commander to exit in current directory
I have some Gentoo systems that have mc installed, but it’s default behaviour is to exit to the directory it was run from. I wanted to change this, because most of the time I’m using it to navigate the filesystem … Continue reading
Why the all famous “cloud” is not an answer?
Edit: Seems like my post is irrelevant since there are projects like Tahoe-LAFS and Ceph. Being lucky to own a new machine capable of running multiple virtual systems, I have decided to try few of them I wasn’t able to … Continue reading
Posted in Random
Leave a comment
Fancier logging in Python (with module and method/function names)
As Python programmers most of us know the old good logging module in Python standard library. This is somewhat really good and useful library for debugging and logging the behavior of the program, but I found it somewhat lacking. What … Continue reading
Python GUI in Linux frame buffer
I was recently wondering about how can I display some graphics in Linux frame buffer with Python. It seems that if your text terminal is initialized in frame buffer mode (most of modern distributions do this), what you need is … Continue reading
Posted in Game Programming, Linux, Programming, Python
Tagged console, directfb, display, frame buffer, gui, mode, pygame, Python, sdl
21 Comments
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
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 attribute error, mako, pylons, Python, strict, template context
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
PocketSpinx voice recognition with GStreamer and Mandriva
I’ve recently bumped upon an open source speech recognition software for Linux based on the CMU Sphinx project called PocketSphinx. Unfortunately standard Mandriva repositories doesn’t have this PocketSphinx library in the 64 bit arch version. So I’ve downloaded SphinxBase and … Continue reading
Using SQLAlchemy-Migrate with Elixir model in Pylons
I’ve recently come across the database schema migration toolkit that builts on top of the awesome SQLAlchemy ORM library named SQLAlchemy-Migrate. Since I’m working mostly on Pylons projects with extensive schema written using SQL Elixir, I was wondering if I … Continue reading
Posted in Elixir, Programming, Pylons, Python, SQLAlchemy
13 Comments
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