Changeset 7538


Ignore:
Timestamp:
28/09/10 13:47:26 (9 years ago)
Author:
astephen
Message:

Introduced use of pygments for XML rendering.

Location:
cows_wps/trunk/cows_wps
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cows_wps/trunk/cows_wps/controllers/jobviewer.py

    r7159 r7538  
    55import urllib 
    66import xml.etree.ElementTree as ET 
     7from pygments import highlight 
     8from pygments.lexers import XmlLexer 
     9from pygments.formatters import HtmlFormatter 
    710 
    811from pylons import request, response, session, tmpl_context as c 
     
    224227    def _htmlifyXML(self, xml): 
    225228        "Returns html string that will make XML look ok on HTML page." 
     229 
     230        return highlight(xml, XmlLexer(), HtmlFormatter()) 
    226231        xml1 = xml.replace("<", "&lt;").replace(">", "&gt;").replace("\n", "<br>") 
    227232 
  • cows_wps/trunk/cows_wps/templates/defs.xml

    r7531 r7538  
    2727    from genshi.builder import tag, Element 
    2828    def markupProcessSpecificContent(context): 
    29         PSCElement = tag.ProcessSpecificContent 
     29        PSCElement = tag.ProcessSpecificContent("\n") 
    3030         
    3131        d = context.outputs.get('ProcessSpecificContent') 
     
    3636        items = d.items() 
    3737        items.sort() 
     38 
    3839        for key, value in items: 
    39             PSCElement(Element(key)(value))("\n") 
     40            PSCElement("\t", Element(key)(value))("\n") 
    4041     
    4142        return PSCElement 
  • cows_wps/trunk/cows_wps/templates/ui_template.html

    r7537 r7538  
    66        <title>$title</title> 
    77        <link href="/style/wps_ui.css" rel="stylesheet" type="text/css" /> 
     8        <link href="/style/pygments_xml.css" rel="stylesheet" type="text/css" /> 
    89        <script type="text/javascript" src="/js/ext/jquery-1.3.2/jquery-1.3.2.min.js"></script> 
    910        <script type="text/javascript" src="/js/ui/validate.js"></script> 
Note: See TracChangeset for help on using the changeset viewer.