2 from xml
.dom
import minidom
, XMLNS_NAMESPACE
3 from zeroinstall
.injector
.namespaces
import XMLNS_IFACE
6 _template
= """<?xml version="1.0" ?>
7 <?xml-stylesheet type='text/xsl'
8 href='http://0install.net/2006/stylesheets/interface.xsl'?>
10 <interface xmlns="http://zero-install.sourceforge.net/2004/injector/interface">
12 <summary>cures all ills</summary>
14 A longer, multi-line description of the behaviour of the
15 program goes here. State clearly what the program is for
16 (clearly enough that people who don't want it will
19 Use a blank line to separate paragraphs.
22 <!-- Optionally, uncomment this to specify an icon: -->
23 <!-- <icon href='http://site/icon.png' type='image/png'/> -->
25 <!-- Optionally, uncomment this to give the address of
26 the signed master interface: -->
27 <!-- <feed-for interface='http://site/interface'> -->
29 <!-- Set 'main' to the relative path of your default
30 executable within the implementation's directory.
31 E.g.: "myprog" or "bin/myprog" -->
33 <!-- List any libraries your program needs here -->
35 <requires interface="http://site/library">
36 <environment insert="python" name="PYTHONPATH"/>
40 <!-- List all implementations here.
41 For local interfaces, '.' is a relative path from this
42 interface file to the directory containing the program.
43 Usually, you can just leave it as '.'.
45 <implementation id="." version="0.1" released='Snapshot'/>
51 assert not os
.path
.exists(f
)
52 name
= os
.path
.basename(f
)
53 return _template
% (name
.split('.', 1)[0])