Hi

Mathieu SCHROETER wrote:
> popcorn/backends/xine/player.py:
> script = os.path.join(os.path.dirname(__file__), 'main.py')
>
> epg/sources/__init__.py:
> if f.startswith('_') or f.startswith('config_') or not f.endswith('.py')
>
> beacon/server/parser.py:
> if not plugin.endswith('.py') or plugin == '__init__.py'
>
> etc, (there are still others examples)..

Yes. Sometime we start a new process and need to give python the file
to start (popcorn), sometimes we want to make it possible to extend a
module so we don't hardcode the module names and search instead (epg
and beacon).

> I would like use only pyc scripts, and it is not possible without a lot
> of patches. GeeXboX is a livecd and all is loaded in memory, and
> globally, pyc are smaller (and surely faster).
> Do you have a solution for that? 

I don't know. Maybe we can assume that we also have a pyc file and use
pyc and not py everywhere. But maybe not because we could also have
pyo files only.

> I have not a lot of idea in Python, but I think than to write hard
> path in the scripts is not a good idea. Like others programming
> languages.

The idea behind this is not to hardcode stuff. The path is taken
during runtime and even modules are searched for during runtime. This
is a very generic way of doing it.

Maybe one idea would be to function to get all python files in a dir
as dict: name_without_suffix: name_with_suffix. So we could start
dict['main'] or interate over all python files.

Could this work?


Dischi


-- 
There ought to be a better way to start the day than by getting up in
the morning.

Attachment: pgpGX6y9cSg1y.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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to