python

Not a good start

This is going to be one of those days.  I decided to install a python package called Plex that we use in a few places.  It looked like a coworker was misusing it a little, so I wanted to understand more.  I took a quick look at the tarball contents and was instantly annoyed.

[kylev@kylev-dt tmp]$ tar tzf Plex-1.1.5.tar.gz
[ Bunch of stuff scrolls off]
tests/._test6.py
tests/test6.py
tests/._test7.in
tests/test7.in
tests/._test7.out
tests/test7.out
tests/._test7.py
tests/test7.py
tests/._test8.in
tests/test8.in
tests/._test8.out
tests/test8.out
tests/._test8.py
tests/test8.py
tests/._test9.in
tests/test9.in
tests/._test9.out
tests/test9.out
tests/._test9.py
tests/test9.py

What jumps out at me is the damn ._ files everywhere. Crud, the author did this on a Mac, which in certain cases (and versions of tar) will include these annoying extra empty files. No big deal, it’s just annoying. Maybe I’ll talk to the maintainer later and have him fix it.

Let’s get on with it and get this baby installed:

[kylev@kylev-dt tmp]$ tar xzf Plex-1.1.5.tar.gz
[kylev@kylev-dt tmp]$ cd Plex-1.1.5.tar.gz

Wait, what the hell? Why did tab-completion give me the tarball again? Oh, damnit! While being distracted and annoyed with the OSX dot-underscore files, I failed to notice that this tarball doesn’t have a top level container directory! Argh, it has just spewed files all over instead of being neatly contained. No big deal, I’m in my ~/tmp directory so I probably didn’t over-write anything important. Time to clean things up:

[kylev@kylev-dt tmp]$ tar tzf Plex-1.1.5.tar.gz | xargs rm
rm: cannot remove `./._Iconr': No such file or directory
rm: cannot remove `Iconr': No such file or directory
rm: cannot remove `Plex/': Is a directory
rm: cannot remove `doc/': Is a directory
rm: cannot remove `examples/': Is a directory
rm: cannot remove `tests/': Is a directory

Bah, I could have used rm -rf, but I didn’t want to trash the whole examples or doc directories in case I had one not created by this package. Let’s just clean up the last bits one by one.

[kylev@kylev-dt tmp]$ rmdir ._Icon^M

What did tab-completion just do with… facepalm! The tarball contained a directory with a carriage-return in the name! Time to fire up emacs dired to finish cleaning up.

That was one troublesome tarball. It can only get better from here, right?

Tags:

Tuesday, December 2nd, 2008 Day in the Life, Geekdom No Comments

Pylons on Fedora 8

I’ve started playing with Pylons and like it so far. It has the rails-ish routing system, but doesn’t have some of the nonsense. Additionally, it’s designed to be open and adaptable, letting you plug in your own ORM or eschew using one entirely (unlike Django which seems to really want you to use their badly crippled ORM).

To make things easier for people running Fedora 8 or other RPM-based Linux distros, I’ve created some spec files and F8 RPMs to let you install Pylons in an RPM-friendly way. The other dependencies (like python-simplejson) can be found already via yum. Try them, and let me know what you think; I may submit these for F9.

Update: These have been submitted for review.

Tags: , ,

Friday, April 11th, 2008 Geekdom No Comments

All in order

I swear I have rare moments of clarity. I was really happy when I finally realized how a non-recursive in-order binary tree traversal would work. It’s a piece of CS trivia that I continually forget. I’m also pleased to realize how easy it is to write in python as an iterator class. 16 lines, with comments and some white space.
› Continue reading

Tags:

Friday, January 7th, 2005 Geekdom Comments Off

Fun with python properties

I ran into an oddity of something I wanted to do with python properties while playing with my music server the yesterday. After a little futzing, I found a way around my problem. Read on to find out how to do python properties and inheritance.
› Continue reading

Tags:

Wednesday, October 13th, 2004 Geekdom Comments Off

Archives