/[qa]/trunk/pts/www/bin/sources_to_xml.py
ViewVC logotype

Diff of /trunk/pts/www/bin/sources_to_xml.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1411 by jeroen, Mon Jun 12 17:38:52 2006 UTC revision 1412 by hertzog, Fri Sep 8 07:41:08 2006 UTC
# Line 11  import os.path, rfc822, email, email.Uti Line 11  import os.path, rfc822, email, email.Uti
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).
# Line 107  def update_sources_info(m, dist): Line 108  def update_sources_info(m, dist):
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")

Legend:
Removed from v.1411  
changed lines
  Added in v.1412

  ViewVC Help
Powered by ViewVC 1.1.5