Viewing Category : programming

Post thumbnail of Force gui updates during long callbacks or internal operations in pygtk or gtk
28 May 2010
Continue reading Force gui updates during long callbacks or internal operations in pygtk or gtk

Force gui updates during long callbacks or internal operations in pygtk or gtk

This faq is the most useful pygtk resource you will find. The full documentation is great for looking up which methods to use or what’s available in one class or another, but it’s the little nooks and crannies that are always left out by most pygtk resource sites that I …

Post thumbnail of Rotate and change the font size of a GTK Label object
30 April 2010
Continue reading Rotate and change the font size of a GTK Label object

Rotate and change the font size of a GTK Label object

Although the PyGTK Reference Manual is extremely helpful in figuring out how to use gtk objects, there’s not a whole lot of information about setting properties on gtk.Label objects readily available. Some hard-to-find yet simple tasks are setting the font size of a label and rotating the text. Pango is your friend, so don’t forget to include him.

Post thumbnail of Generate python code from Glade XML files
22 April 2010
Continue reading Generate python code from Glade XML files

Generate python code from Glade XML files

Why can’t I find a code generator that works? Tepache is a code sketcher for python that uses pygtk and glade, but it is broken and it looks like it hasn’t been updated since July 2005 anyway. Gladex was broken out of the box. Autocode does not like my glade and the documentation is limited.

Post thumbnail of How to reverse a list or string in Python
14 April 2010
Continue reading How to reverse a list or string in Python

How to reverse a list or string in Python

So easy, and it works with lists too. Won’t work with dictionaries but it should work with any hash-able type.

Post thumbnail of qemu-ifup and qemu-ifdown network configuration scripts
8 April 2010
Continue reading qemu-ifup and qemu-ifdown network configuration scripts

qemu-ifup and qemu-ifdown network configuration scripts

These two scripts are called when you start a qemu or kvm virtual machine. I removed the openvpn –mktun and –rmtun commands because qemu handles it for you.

Post thumbnail of Installing Pylons and BlastOff - YUM alternative to easy-install
23 February 2010
Continue reading Installing Pylons and BlastOff - YUM alternative to easy-install

Installing Pylons and BlastOff - YUM alternative to easy-install

The Pylons web framework is aimed at making webapps and large programmatic website development in Python easy. Pylons combines the very best ideas from the worlds of Ruby, Python and Perl, providing a structured but extremely flexible Python web framework. BlastOff is a Pylons application template providing a working site skeleton configured with SQLAlchemy, mako, repoze.who, ToscaWidgets, TurboMail, and WebFlash.

Post thumbnail of Remove files after svn add but before committing
10 February 2010
Continue reading Remove files after svn add but before committing

Remove files after svn add but before committing

You’ve added a whole directory to get checked into subversion, and then realized you forgot to remove the binaries, or perhaps you had some hidden files, .nfs0001 or thumbs.db or something else you just don’t want to commit. There’s two ways to undo this situation.

Post thumbnail of Rpmbuild check-rpaths can break spec files
20 January 2010
Continue reading Rpmbuild check-rpaths can break spec files

Rpmbuild check-rpaths can break spec files

Rpmbuild’s RPATH feature is used to search libraries outside of standard paths. They are given to the linker at buildtime. If the developers of the code you’re trying to turn into an RPM did not take any of these considerations into account when they write their programs then you may be forced to skip check-rpath.

Post thumbnail of subprocess.popen and static define in Python
13 January 2010
Continue reading subprocess.popen and static define in Python

subprocess.popen and static define in Python

I like os’s subprocess.Popen() to run shell commands from within my Python code. I also like to define TRUE and FALSE to use as return values. Now I know what you’re thinking: there’s no such thing as ‘C’s #define in python because there’s no compiler to swap out of all your substitutions at compile time. However, it’s just as easy to achieve the same results.

Post thumbnail of Subversion repository dependencies with svn:externals
6 January 2010
Continue reading Subversion repository dependencies with svn:externals

Subversion repository dependencies with svn:externals

Here’s how to use svn propset with single or multiple dependencies along with the pre-revprop-change hook setup. It was a pain in the butt at first because it just didn’t make sense, but now I get it.

 Page 3 of 7 « 1  2  3  4  5 » ...  Last » 
Powered by Wordpress   |   Lunated designed by ZenVerse