Changeset 19


Ignore:
Timestamp:
11/09/06 14:38:50 (5 years ago)
Author:
christian
Message:

Corrected timezone and XML namespace issues

Location:
sitemap-plugin/trunk/sitemap
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sitemap-plugin/trunk/sitemap/api.py

    r18 r19  
    7979    path = '/sitemap.xml' 
    8080     
     81    ns = "http://www.google.com/schemas/sitemap/0.84" 
     82     
    8183    def get_descriptions(self): 
    8284        """Return an array of sitemap contributions""" 
     
    108110        doc = Document() 
    109111        urlset = doc.createElement("urlset") 
    110         doc.appendChild(urlset) 
     112        a = doc.createAttribute('xmlns') 
     113        a.value = self.ns 
     114        urlset.setAttributeNode(a) 
    111115        for c in self.contributors: 
    112116            for ressource_data in c.get_data(req): 
    113117                urlset.appendChild(ressource_data.to_node(doc)) 
    114118 
     119        doc.appendChild(urlset) 
    115120        req.send_response(200) 
    116121        req.send_header('Content-Type', 'text/xml;charset=UTF-8') 
  • sitemap-plugin/trunk/sitemap/wiki.py

    r18 r19  
    6262                if author == 'trac': 
    6363                    continue 
     64            entry_time = datetime.datetime.utcfromtimestamp(post_time) 
    6465            d.append(RessourceData( 
    6566                                  href(req.href.wiki(pagename)), 
    66                                   datetime.datetime.utcfromtimestamp(post_time), 
     67                                  entry_time.strftime("%Y-%m-%dT%H:%M:%SZ"), 
    6768                                  self.frequency, 
    6869                                  self.priority 
Note: See TracChangeset for help on using the changeset viewer.