Jason Tackaberry wrote:
> Import parsers on-demand -- significantly speeds up startup time when the
> correct parsers can be discovered by file extensions; 

I don't think that was such a good idea. Some parser are better an
than other:

> -        import audio.ogg
> -        import audio.m4a
> -        import audio.ac3
> -        import audio.pcm
> -        import audio.adts
> -        import video.riff
> -        import video.mpeg
> -        import video.asf
> -        import video.mp4
> -        import video.flv
> -        import image.jpg
> -        import image.png
> -        import image.tiff
> -        import image.bmp
> -        import image.gif
> -        import video.vcd
> -        import video.real
> -        import video.ogm
> -        import video.mkv
> -        import misc.xmlfile
> -
> -        import disc.vcd
> -        import disc.audio
> -        import disc.dvd
> -        import disc.data
> -
> -        import audio.mp3
> -        import audio.webradio
> -        import audio.flac

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.

> +    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.


Dischi

-- 
Claiming that your operating system is the best in the world because
more people use it is like saying McDonalds makes the best food in the
world.

Attachment: pgp4e9BUN11tC.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