web/hosts/issues graph.py,1.1,1.2

Stefan Seefeld <[email protected]>
Newsgroups gmane.comp.video.fresco.cvs
Message-ID <[email protected]>
Update of /cvs/fresco/web/hosts/issues
In directory purcel:/tmp/cvs-serv15192/hosts/issues

Modified Files:
	graph.py 
Log Message:
some fixes to make the script syntactically correct. It's still not working, though...

Index: graph.py
===================================================================
RCS file: /cvs/fresco/web/hosts/issues/graph.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- graph.py	9 Jan 2003 19:10:44 -0000	1.1
+++ graph.py	21 Jan 2003 05:05:45 -0000	1.2
@@ -104,6 +104,7 @@
 form = cgi.FieldStorage()
 type = form.getvalue('type')
 id = form.getvalue('id')
+output = form.getvalue('output')
 
 os.putenv('DOTFONTPATH', '/org/fresco.org/share')
 
@@ -112,61 +113,60 @@
 def visit(type, id, first):
     if not type+id in list:
         list[len(list)+1:len(list)+1] = [type+id]
-        items = dot_file.get_items(db, type)
-        dot_file.write_node(file, type, id, items.get(id, 'title'), items.get(id, 'status'), items.get(id, 'priority'), first)
+        items = get_items(db, type)
+        write_node(file, type, id, items.get(id, 'title'), items.get(id, 'status'), items.get(id, 'priority'), first)
         
         if type == 'task':
-            items = dot_file.get_items(db, 'task')
+            items = get_items(db, 'task')
             for solve in items.get(id, 'solves'):
-                dot_file.write_solve(file, type, id, 'bug', solve)
+                write_solve(file, type, id, 'bug', solve)
                 visit('bug', solve, 0)
-            items = dot_file.get_items(db, type)
+            items = get_items(db, type)
 
         for supersede in items.get(id, 'superseder'):
-            dot_file.write_supersede(file, type, id, type, supersede)
+            write_supersede(file, type, id, type, supersede)
             visit(type, supersede, 0)
                     
         for depend in items.get(id, 'dependson'):
-            dot_file.write_depend(file, type, id, type, depend)
+            write_depend(file, type, id, type, depend)
             visit(type, depend, 0)
 
-db = dot_file.open_db()
+db = open_db()
 (file, child_stdout) = os.popen2('dot -Tsvg')
-dot_file.write_header(file, type, id)
+write_header(file, type, id)
 
 visit(type, id, 1)
 
-dot_file.write_footer(file, id)
+write_footer(file, id)
 file.close()
 
 if output == 'png':
-    print "Content-type: image/png\n"
+    print 'Content-type: image/png\n'
 elif output == 'svg':
-    print "Content-type: image/svg+xml\n"
+    print 'Content-type: image/svg+xml\n'
     print '<?xml version="1.0" standalone="yes"?>'
     print '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000802//EN"'
     print '  "http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd">'
 elif output == 'mif':
-    print "Content-type: application/vnd.mif\n"
+    print 'Content-type: application/vnd.mif\n'
 elif output == 'gif':
-    print "Content-type: image/gif\n"
-elif output == 'imap': # you aren't using these two as a CGI script are you?
-elif output == 'ismap':
-elif output == 'cmap':
-    print "Content-type: text/html\n"
-    print "<?xml version="1.0"?>"
-    print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"
-    print "<html xmlns=\"http://www.w3.org/1999/xhtml\">"
-    print "<head>"
-    print "  <title>" + type + id + "</title>"
-    print "</head>"
-    print "<body>"
-    print "  <map name=\"" + type + id + "_graph\">"
+    print 'Content-type: image/gif\n'
+# you aren't using these two as a CGI script are you?
+elif output == 'imap' or output == 'ismap' or output == 'cmap':
+    print 'Content-type: text/html\n'
+    print '<?xml version="1.0"?>'
+    print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
+    print '<html xmlns="http://www.w3.org/1999/xhtml">'
+    print '<head>'
+    print '  <title>' + type + id + '</title>'
+    print '</head>'
+    print '<body>'
+    print '  <map name="' + type + id + '_graph">'
 
 print child_stdout.read()
 
 if output == 'cmap':
-    print "  </map>"
-    print "  <img src=\"" + os.environ['SCRIPT_NAME'] + "?type=" + type + "&id=" + id + "&output=png\" usemap=\"#" + type + id + "_graph\" border=\"0\" />"
-    print "</body>"
-    print "</html>"
+    print '  </map>'
+    print '  <img src="' + os.environ['SCRIPT_NAME'] + '?type=' + type + '&id=' + id + '&output=png" usemap="#' + type + id + '_graph" border="0" />'
+    print '</body>'
+    print '</html>'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.