← Back to team overview

bzr-windows team mailing list archive

Re: Windows Installers now a separate project (call for helpers)

 

John Arbash Meinel пишет:
> Vincent Ladeuil wrote:
>>>>>>> "bialix" == Alexander Belchenko <bialix@xxxxxxx> writes:
> So another alternative is that for a plugin named foo, you create a
> file: foo_setup.py

This is ugly and really not needed.

> Just some thoughts, and why it isn't *just* as trivial as getting
> 'setup.py' working.

Of course, it's not trivial and one have to use black python magic. But it's actually very easy.
You can see it in my branch with proof-of-concept: lp:~bialix/+junk/plugins-setups

The heart of that code is following function:

def importing(filename):
    name = os.path.splitext(filename)[0].replace('\\', '.').replace('/', '.').replace(':', '_')
    m = imp.load_source(name, filename)
    d = {}
    for name in dir(m):
        if not name.startswith('_'):
            d[name] = getattr(m, name, None)
    return d


Vincent: I'm happy to support new API for setup.py in QBzr once it will be documented somewhere.



References