Dirk Meyer wrote:
> I don't think that was such a good idea. Some parser are better an
> than other:
>
> There was a reason why the flac parser was at the end because it had
> some false positive detections. We need some extra attribute about the
> rating of a parser to sort them when checking all possible parser.

Ignore me, I see that the list is still sorted by the register
calls. What is missing is that the register in __init__ or now sorted
in a different way.

>> +    def get_class(self, name):
>> +        if name not in self.classmap:
>> +            # Import the parser class for the given name.
>> +            modname, clsname = name.rsplit('.', 1)
>> +            # FIXME: why aren't relative imports working?
>> +            try:
>> +                module = __import__('kaa.metadata.' + modname, [], [], 
>> [clsname])
>> +                self.classmap[name] = getattr(module, clsname)
>> +            except:
>> +                log.exception('Error importing parser')
>> +                self.classmap[name] = NullParser
>
> Maybe exec('import modname') will work.

exec('import %s as module' % modname) works.


Dischi

-- 
"Your job is being a professor and researcher: That's one hell of a
 good excuse for some of the brain-damages of minix."
        -Linus Torvalds to Andrew Tanenbaum

Attachment: pgp6rl2gfeDqh.pgp
Description: PGP signature

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to