[tech] uccvend-vendserver patch - VendServer.py executable on install

Mark Tearle mtearle at ucc.asn.au
Sat Mar 7 21:34:54 AWST 2015


Hi Sam

> > Speaking of setuptools, is it really required, or can we roll our own
> > utility that is nicer and does exactly what we need? It will also reduce our
> > dependancies.
> 
> Setuptools has an entry_points option where you can dynamically create
> a script to launch your application[1]. For example, you could have:
> 
> entry_points=[
>     "console_scripts": [
>         "vend-server=VendServer.VendingMachine:main"
>     ]
> ]
> 
> That would run the main() function on execution of the "vend-server"
> command after installation.
> 
> Hope that's useful :)
> 
> Sam.
> 
> [1]
> http://setuptools.readthedocs.org/en/latest/setuptools.html#automatic-script-creation
> 

Thanks, that was just the code snippet I needed to point me in the right
direction.  I've applied the patch attached to this email to repository
for the VendServer.


Mark
PS.  Mitch, do you want to roll it out to production?

-- 
Mark Tearle <mtearle at ucc.asn.au>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-entrypoint-to-setup.py-for-vendserver.patch
Type: text/x-patch
Size: 1782 bytes
Desc: not available
Url : http://lists.ucc.gu.uwa.edu.au/pipermail/tech/attachments/20150307/aeff8dd3/attachment.bin 


More information about the tech mailing list