diff venner.py @ 1:cc6707a1e044 draft default tip

added fixes from Brad Langhorst; https://bitbucket.org/account/notifications/read/3443176/patch-for-proportional-venn-tool-in-galaxy; added tool_dependencies for Mako template untested
author Ido Tamir <ido.tamir@imp.ac.at>
date Mon, 24 Sep 2012 16:46:21 +0200
parents 8ea9b4e5a389
children
line wrap: on
line diff
--- a/venner.py	Wed Jun 22 03:28:25 2011 -0400
+++ b/venner.py	Mon Sep 24 16:46:21 2012 +0200
@@ -27,6 +27,7 @@
         cleanname = re.sub("/","",name)
         self.name = urllib.quote(cleanname, safe="%/:=&?~#+!$,;'@()*[]")
         self.dict = {}
+    
     def read(self):
         dict = {}
         lineNr = 0
@@ -88,13 +89,12 @@
      <title>Venn diagram ${title}</title>
   </head>
   <body>
-     <h3>${ title }</h3>
      <div>
         <img src="${ url }"/>
      </div>
      <div>
         <table>
-           <tr><th>Segment</th><th>Count</th></tr>
+           <tr><th>Set</th><th>Count</th></tr>
            <tr><td>${ one }</td><td>${ n.one_keys }</td></tr>
            <tr><td>${ two }</td><td>${ n.two_keys }</td></tr>
            <tr><td>${ one } \ ${ two }</td><td>${ n.one_only }</td></tr>
@@ -104,7 +104,7 @@
      </div>
   </body>
 </html>"""
-        result = Template(template).render(one=self.one.name, two=self.two.name, n=numbers, title=self.title, url=self.toUrl())
+        result = Template(template).render(one=urllib.unquote(self.one.name), two=urllib.unquote(self.two.name), n=numbers, title=self.title, url=self.toUrl())
         return(result)
 
 
@@ -158,13 +158,12 @@
      <title>Venn diagram ${title}</title>
   </head>
   <body>
-     <h3>${ title }</h3>
      <div>
         <img src="${ url }"/>
      </div>
      <div>
         <table>
-           <tr><th>Segment</th><th>Count</th></tr>
+           <tr><th>Set</th><th>Count</th></tr>
            <tr><td>${ one }</td><td>${ n.one_keys }</td></tr>
            <tr><td>${ two }</td><td>${ n.two_keys }</td></tr>
            <tr><td>${ three }</td><td>${ n.three_keys }</td></tr>
@@ -179,7 +178,7 @@
      </div>
   </body>
 </html>"""
-        result = Template(template).render(one=self.one.name, two=self.two.name, three=self.three.name, n=numbers, title=self.title, url=self.toUrl())
+        result = Template(template).render(one=urllib.unquote(self.one.name), two=urllib.unquote(self.two.name), three=urllib.unquote(self.three.name), n=numbers, title=self.title, url=self.toUrl())
         return(result)