| 11 |
from xml.dom import implementation, ext |
from xml.dom import implementation, ext |
| 12 |
|
|
| 13 |
from config import dir, odir |
from config import dir, odir |
| 14 |
|
from common import vcs_table |
| 15 |
|
|
| 16 |
# address_from_string takes an address in RFC822 format |
# address_from_string takes an address in RFC822 format |
| 17 |
# and turns it into a tuple of the form (real name, email). |
# and turns it into a tuple of the form (real name, email). |
| 108 |
else: |
else: |
| 109 |
text = doc.createTextNode(m[tag]) |
text = doc.createTextNode(m[tag]) |
| 110 |
child.appendChild(text) |
child.appendChild(text) |
| 111 |
|
# now compute derived information and store it in the xml |
| 112 |
|
if tag[:6] == 'x-vcs-': # add 'parsed' version of VCS info |
| 113 |
|
# e.g. tag[6:] would be 'svn' for 'x-vcs-svn' |
| 114 |
|
if vcs_table.has_key(tag[6:]): |
| 115 |
|
repos_elt = doc.createElement('repository') |
| 116 |
|
root.appendChild(repos_elt) |
| 117 |
|
kind_elt = doc.createElement('kind') |
| 118 |
|
repos_elt.appendChild(kind_elt) |
| 119 |
|
(name, vcsurl) = vcs_table[tag[6:]] |
| 120 |
|
kind_elt.setAttribute('href', vcsurl) |
| 121 |
|
name_txt = doc.createTextNode(name) |
| 122 |
|
kind_elt.appendChild(name_txt) |
| 123 |
|
url_elt = doc.createElement('url') |
| 124 |
|
repos_elt.appendChild(url_elt) |
| 125 |
|
url_txt = doc.createTextNode(m[tag]) |
| 126 |
|
url_elt.appendChild(url_txt) |
| 127 |
# Print the DOM object to a file |
# Print the DOM object to a file |
| 128 |
try: |
try: |
| 129 |
f = open("%s/%s/%s/%s.xml" % (odir, hash, package, dist), "w") |
f = open("%s/%s/%s/%s.xml" % (odir, hash, package, dist), "w") |