Func – module_loader.py –

March 9, 2009

func

Currently working on Func 0.24-1, I found that comment and following Python codes in the /usr/lib/python2.5/site-packages/func/module_loader.py at Line =~ 100 on Fedora 10

# FIXME: this is probably more complicated than it needs to be -akl
# aka, everything after the module_file_path

if basename[:8] == “__init__”:
modname = dirname
dirname = “”
elif basename[-3:] == “.py”:
modname = basename[:-3]
elif basename[-4:] in [“.pyc”, “.pyo”]:
modname = basename[:-4]

which could be remplaced by :

modname = dirname
dirname = “”
if basename[:8] != “__init__”:
mymodname =basename.split(‘.’)
modname=”.join(mymodname[:1])

Well, do not have the pretension to be better coder than Python developper however if I can help.

Advertisements

3 Responses to “Func – module_loader.py –”

  1. mpdehaan said

    That’s not functionally the same. Now you will pick up more than Python files, which will break the module loader when other content lives in that directory.

    • Frederic Hornain said

      Dear Micheal,

      Ok, I am going to review that part of code.
      Thanks for your feed back.
      Just to let you know my intention was not to be arrogant.
      Thanks for your comprehension.

      BR
      Fred

  2. Not a problem at all… glad to see the interest.

    FYI — If you’re curious about the FIXME, I’d ask on the mailing list rather than Fedora Planet … that’s how such Q&A usually works.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: