Re: opening a file using a relative path from a subclass in a package

2005-12-07 Thread spike grobstein
I understand why it wasn't working and it makes sense based on the structure of namespaces that python defines, however, I'm just surprised that there isn't some kind of built-in facility for dealing with these types of things. Module packages are a spectacular idea, it is just kinda easy to get c

Re: opening a file using a relative path from a subclass in a package

2005-12-07 Thread spike grobstein
oh, wow. that works!!! thanks for the help! so, since python supports module packages like it does, you'd think that it would have ways of making add-on or extension modules to be more self contained. Thanks, again! -- http://mail.python.org/mailman/listinfo/python-list

opening a file using a relative path from a subclass in a package

2005-12-07 Thread spike grobstein
So, I've got this project I'm working on where the app defines various classes that are subclassed by module packages that act like plugins... I'd like the packages to define a file path for supporting files (graphics, etc) that are stored inside the package. The problem is that the superclass's d

Re: subclassing list

2005-07-31 Thread spike grobstein
>You also need to post the code that raises the error, or no one else can debug it. sorry, I thought I had pasted that line in there, but I guess I missed it. Here's the full code (after modifying it slightly based on your post): #! /usr/bin/env python def circular_list(list): def __getitem_

Re: importing files from a directory

2005-07-11 Thread spike grobstein
my reason for loading both the .py and .pyc files was just in case compiled files were supplied as modules... but I'm gonna disallow that, so yeah. I also got a response in email and I've been dabbling with my code since I posted this and found a slightly better way of handling this plugin system.

importing files from a directory

2005-07-09 Thread spike grobstein
I'm a total Python newbie, so bear with me here... I'm writing a program that has a user-configurable, module-based architecture. it's got a directory where modules are stored (.py files) which subclass one of several master classes. My plan is to have the program go into the folder called "Modul