diff options
author | wjv <wjv@FreeBSD.org> | 2001-09-03 18:45:18 +0800 |
---|---|---|
committer | wjv <wjv@FreeBSD.org> | 2001-09-03 18:45:18 +0800 |
commit | ff15e86d6fdb4f1a0ab2c720f8e0f4fc18cb80d3 (patch) | |
tree | 8ddaab1a6068be93f5cb02120cb3d64fa57d829e /math/py-gato | |
parent | f4a130a180c2541da4426ff65890fe2f1b688238 (diff) | |
download | freebsd-ports-gnome-ff15e86d6fdb4f1a0ab2c720f8e0f4fc18cb80d3.tar.gz freebsd-ports-gnome-ff15e86d6fdb4f1a0ab2c720f8e0f4fc18cb80d3.tar.zst freebsd-ports-gnome-ff15e86d6fdb4f1a0ab2c720f8e0f4fc18cb80d3.zip |
Add py-gato 0.96.g, a Python-based toolbox to visualise algorithms
on graphs.
Diffstat (limited to 'math/py-gato')
-rw-r--r-- | math/py-gato/Makefile | 50 | ||||
-rw-r--r-- | math/py-gato/distinfo | 1 | ||||
-rw-r--r-- | math/py-gato/files/patch-Gato.py | 57 | ||||
-rw-r--r-- | math/py-gato/files/patch-GatoUtil.py | 13 | ||||
-rw-r--r-- | math/py-gato/files/patch-Graph.py | 11 | ||||
-rw-r--r-- | math/py-gato/files/patch-GraphUtil.py | 85 | ||||
-rw-r--r-- | math/py-gato/files/patch-Gred.py | 38 | ||||
-rw-r--r-- | math/py-gato/pkg-comment | 1 | ||||
-rw-r--r-- | math/py-gato/pkg-descr | 16 | ||||
-rw-r--r-- | math/py-gato/pkg-plist | 60 |
10 files changed, 332 insertions, 0 deletions
diff --git a/math/py-gato/Makefile b/math/py-gato/Makefile new file mode 100644 index 000000000000..6872c8f65224 --- /dev/null +++ b/math/py-gato/Makefile @@ -0,0 +1,50 @@ +# New ports collection makefile for: py-gato +# Date created: 31 August 2001 +# Whom: Johann Visagie <wjv@FreeBSD.org> +# +# $FreeBSD$ +# + +PORTNAME= gato +PORTVERSION= 0.96.g +CATEGORIES= math python +MASTER_SITES= http://www.zpr.uni-koeln.de/~gato/Download/ +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} +DISTNAME= Gato-${PORTVERSION:U:C|\.([^.]*)$|\1|} +EXTRACT_SUFX= .tar + +MAINTAINER= wjv@FreeBSD.org + +RUN_DEPENDS= ${PYTHON_SITELIBDIR}/_tkinter.so:${PORTSDIR}/x11-toolkits/py-tkinter + +USE_PYTHON= yes +WRKSRC= ${WRKDIR}/Gato +GATO_DIR= ${PREFIX}/lib/${PYTHON_VERSION}/site-packages/Gato +EXAMPLESDIR= ${PREFIX}/share/examples/${PORTNAME} +CPIO= cpio --quiet -pdum -R + +pre-build: + @ ${TOUCH} ${WRKSRC}/__init__.py + +do-build: + @ ${PYTHON_CMD} ${PYTHON_LIBDIR}/compileall.py ${WRKSRC} + @ ${PYTHON_CMD} -O ${PYTHON_LIBDIR}/compileall.py ${WRKSRC} + +do-install: + @ ${MKDIR} ${GATO_DIR} + @ cd ${WRKSRC} && find *.py *.pyc *.pyo \ + -name Gato.py\* -o -name Gred.py\* -o -print \ + | ${CPIO} ${BINOWN}:${BINGRP} ${GATO_DIR} +.for script in Gato Gred + @ ${INSTALL_SCRIPT} ${WRKSRC}/${script}.py ${PREFIX}/bin/${script} +.endfor + +post-install: +.if !defined(NOPORTDOCS) + @ ${MKDIR} ${EXAMPLESDIR} +.for egfile in *.alg *.pro *.cat + @ ${INSTALL_DATA} ${WRKSRC}/${egfile} ${EXAMPLESDIR} +.endfor +.endif + +.include <bsd.port.mk> diff --git a/math/py-gato/distinfo b/math/py-gato/distinfo new file mode 100644 index 000000000000..d28a097282cb --- /dev/null +++ b/math/py-gato/distinfo @@ -0,0 +1 @@ +MD5 (Gato-0.96G.tar) = c0c942acf0961847b07fb9a6cd7e535c diff --git a/math/py-gato/files/patch-Gato.py b/math/py-gato/files/patch-Gato.py new file mode 100644 index 000000000000..c9ff38cbbaab --- /dev/null +++ b/math/py-gato/files/patch-Gato.py @@ -0,0 +1,57 @@ +--- Gato.py.orig Wed May 16 13:16:55 2001 ++++ Gato.py Mon Sep 3 12:26:21 2001 +@@ -38,7 +38,6 @@ + import bdb + import whrandom + import re +-import regsub + import string + import StringIO + import tokenize +@@ -49,13 +48,13 @@ + from ScrolledText import ScrolledText + + +-from Graph import Graph +-from GraphUtil import * +-from GraphDisplay import GraphDisplayToplevel +-from GatoUtil import * +-from GatoGlobals import * +-from GatoDialogs import AboutBox, SplashScreen, HTMLViewer +-import GatoIcons ++from Gato.Graph import Graph ++from Gato.GraphUtil import * ++from Gato.GraphDisplay import GraphDisplayToplevel ++from Gato.GatoUtil import * ++from Gato.GatoGlobals import * ++from Gato.GatoDialogs import AboutBox, SplashScreen, HTMLViewer ++from Gato import GatoIcons + + # put someplace else + def WMExtrasGeometry(window): +@@ -67,7 +66,7 @@ + + NOTE: Does not work with tk8.0 style menus, since those are + handled by WM (according to Tk8.1 docs) """ +- g = regsub.split(window.geometry(),"+") ++ g = re.split("\+", window.geometry()) + trueRootx = string.atoi(g[1]) + trueRooty = string.atoi(g[2]) + +@@ -1159,11 +1158,11 @@ + self.algoGlobals['A'] = self.GUI.graphDisplay + # XXX + # explictely loading packages we want to make available to the algorithm +- modules = ['DataStructures', +- 'AnimatedDataStructures', +- 'AnimatedAlgorithms', +- 'GraphUtil', +- 'GatoUtil'] ++ modules = ['Gato.DataStructures', ++ 'Gato.AnimatedDataStructures', ++ 'Gato.AnimatedAlgorithms', ++ 'Gato.GraphUtil', ++ 'Gato.GatoUtil'] + + for m in modules: + exec("from %s import *" % m, self.algoGlobals, self.algoGlobals) diff --git a/math/py-gato/files/patch-GatoUtil.py b/math/py-gato/files/patch-GatoUtil.py new file mode 100644 index 000000000000..7cdcf9b766a1 --- /dev/null +++ b/math/py-gato/files/patch-GatoUtil.py @@ -0,0 +1,13 @@ +--- GatoUtil.py.orig Wed May 16 13:16:56 2001 ++++ GatoUtil.py Mon Sep 3 12:14:42 2001 +@@ -40,8 +40,8 @@ + + def extension(pathAndFile): + """ Return ext if path/filename.ext is given """ +- import regsub +- return regsub.split(stripPath(pathAndFile),"\.")[1] ++ import re ++ return re.split("\.", stripPath(pathAndFile))[1] + + def stripPath(pathAndFile): + """ Return filename.ext if path/filename.ext is given """ diff --git a/math/py-gato/files/patch-Graph.py b/math/py-gato/files/patch-Graph.py new file mode 100644 index 000000000000..6d0e4937efbf --- /dev/null +++ b/math/py-gato/files/patch-Graph.py @@ -0,0 +1,11 @@ +--- Graph.py.orig Wed May 16 13:16:57 2001 ++++ Graph.py Fri Aug 31 17:12:01 2001 +@@ -31,7 +31,7 @@ + # + ################################################################################ + +-from regsub import split ++from re import split + from GatoGlobals import * + from DataStructures import Point2D, VertexLabeling, EdgeLabeling, EdgeWeight + from math import log diff --git a/math/py-gato/files/patch-GraphUtil.py b/math/py-gato/files/patch-GraphUtil.py new file mode 100644 index 000000000000..8c652aaaee22 --- /dev/null +++ b/math/py-gato/files/patch-GraphUtil.py @@ -0,0 +1,85 @@ +--- GraphUtil.py.orig Wed May 16 13:16:58 2001 ++++ GraphUtil.py Mon Sep 3 12:21:49 2001 +@@ -31,7 +31,7 @@ + # + ################################################################################ + +-from regsub import split ++from re import split + from GatoGlobals import * + from Graph import Graph + from DataStructures import Point2D, VertexLabeling, EdgeLabeling, EdgeWeight, VertexWeight, Queue +@@ -223,13 +223,13 @@ + break + + if lineNr == 2: # Read directed and euclidian +- splitLine = split(line[:-1],';') +- G.directed = eval(split(splitLine[0],':')[1]) +- G.simple = eval(split(splitLine[1],':')[1]) +- G.euclidian = eval(split(splitLine[2],':')[1]) +- intWeights = eval(split(splitLine[3],':')[1]) +- nrOfEdgeWeights = eval(split(splitLine[4],':')[1]) +- nrOfVertexWeights = eval(split(splitLine[5],':')[1]) ++ splitLine = split(';',line[:-1]) ++ G.directed = eval(split(':',splitLine[0])[1]) ++ G.simple = eval(split(':',splitLine[1])[1]) ++ G.euclidian = eval(split(':',splitLine[2])[1]) ++ intWeights = eval(split(':',splitLine[3])[1]) ++ nrOfEdgeWeights = eval(split(':',splitLine[4])[1]) ++ nrOfVertexWeights = eval(split(':',splitLine[5])[1]) + for i in xrange(nrOfEdgeWeights): + G.edgeWeights[i] = EdgeWeight(G) + for i in xrange(nrOfVertexWeights): +@@ -237,33 +237,33 @@ + + + if lineNr == 5: # Read nr of vertices +- nrOfVertices = eval(split(line[:-2],':')[1]) # Strip of "\n" and ; ++ nrOfVertices = eval(split(':',line[:-2])[1]) # Strip of "\n" and ; + firstVertexLineNr = lineNr + 1 + lastVertexLineNr = lineNr + nrOfVertices + + if firstVertexLineNr <= lineNr and lineNr <= lastVertexLineNr: +- splitLine = split(line[:-1],';') ++ splitLine = split(';',line[:-1]) + v = G.AddVertex() +- x = eval(split(splitLine[1],':')[1]) +- y = eval(split(splitLine[2],':')[1]) ++ x = eval(split(':',splitLine[1])[1]) ++ y = eval(split(':',splitLine[2])[1]) + for i in xrange(nrOfVertexWeights): +- w = eval(split(splitLine[3+i],':')[1]) ++ w = eval(split(':',splitLine[3+i])[1]) + G.vertexWeights[i][v] = w + + E[v] = Point2D(x,y) + + if lineNr == lastVertexLineNr + 1: # Read Nr of edges +- nrOfEdges = eval(split(line[:-2],':')[1]) # Strip of "\n" and ; ++ nrOfEdges = eval(split(':',line[:-2])[1]) # Strip of "\n" and ; + firstEdgeLineNr = lineNr + 1 + lastEdgeLineNr = lineNr + nrOfEdges + + if firstEdgeLineNr <= lineNr and lineNr <= lastEdgeLineNr: +- splitLine = split(line[:-1],';') +- h = eval(split(splitLine[0],':')[1]) +- t = eval(split(splitLine[1],':')[1]) ++ splitLine = split(';',line[:-1]) ++ h = eval(split(':',splitLine[0])[1]) ++ t = eval(split(':',splitLine[1])[1]) + G.AddEdge(t,h) + for i in xrange(nrOfEdgeWeights): +- G.edgeWeights[i][(t,h)] = eval(split(splitLine[3+i],':')[1]) ++ G.edgeWeights[i][(t,h)] = eval(split(':',splitLine[3+i])[1]) + + lineNr = lineNr + 1 + +@@ -345,7 +345,7 @@ + if not line: + return retval + +- token = filter(lambda x: x != '', split(line[:-1],"[\t ]*")) ++ token = filter(lambda x: x != '', split("[\t ]*",line[:-1])) + + if len(token) == 1 and token[0] == ']': + return retval diff --git a/math/py-gato/files/patch-Gred.py b/math/py-gato/files/patch-Gred.py new file mode 100644 index 000000000000..cc10c754f8cd --- /dev/null +++ b/math/py-gato/files/patch-Gred.py @@ -0,0 +1,38 @@ +--- Gred.py.orig Wed May 16 13:16:58 2001 ++++ Gred.py Mon Sep 3 12:01:13 2001 +@@ -31,16 +31,16 @@ + # last change by $Author: schliep $. + # + ################################################################################ +-from Graph import Graph +-from DataStructures import EdgeWeight, VertexWeight +-from GraphUtil import OpenCATBoxGraph, OpenGMLGraph, SaveCATBoxGraph, WeightedGraphInformer +-from GraphEditor import GraphEditor ++from Gato.Graph import Graph ++from Gato.DataStructures import EdgeWeight, VertexWeight ++from Gato.GraphUtil import OpenCATBoxGraph, OpenGMLGraph, SaveCATBoxGraph, WeightedGraphInformer ++from Gato.GraphEditor import GraphEditor + from Tkinter import * +-from GatoUtil import stripPath, extension, gatoPath +-from GatoGlobals import * +-import GatoDialogs +-import GatoGlobals +-import GatoIcons ++from Gato.GatoUtil import stripPath, extension, gatoPath ++from Gato.GatoGlobals import * ++from Gato import GatoDialogs ++from Gato import GatoGlobals ++from Gato import GatoIcons + from ScrolledText import * + + from tkFileDialog import askopenfilename, asksaveasfilename +@@ -51,7 +51,8 @@ + import sys + import os + +-import GraphCreator, Embedder ++from Gato import GraphCreator ++from Gato import Embedder + + class GredSplashScreen(GatoDialogs.SplashScreen): + diff --git a/math/py-gato/pkg-comment b/math/py-gato/pkg-comment new file mode 100644 index 000000000000..c741ebb9a96c --- /dev/null +++ b/math/py-gato/pkg-comment @@ -0,0 +1 @@ +A Python-based toolbox to visualise algorithms on graphs diff --git a/math/py-gato/pkg-descr b/math/py-gato/pkg-descr new file mode 100644 index 000000000000..2f45a321aa5e --- /dev/null +++ b/math/py-gato/pkg-descr @@ -0,0 +1,16 @@ +Paraphrasing the website: + Gato - the Graph Animation Toolbox - is software [toolkit] which visualizes + algorithms on graphs. + - Graphs are mathematical objects consisting of vertices, and edges + connecting pairs of vertices. + - Algorithms might find a shortest path - the fastest route - or a minimal + spanning tree or solve one of other interesting problems on graphs: + maximal-flow, weighted and non-weighted matching and min-cost flow. + - Visualisation means linking cause - the statements of an algorithm - + immediately to an effect - changes to the graph the algorithm has as its + input - by terms of blinking, changing colors and other visual effects. + +Author: Alexander Schliep <schliep@zpr.uni-koeln.de> +WWW: http://www.zpr.uni-koeln.de/~gato/ + +-- Johann Visagie <wjv@FreeBSD.org> diff --git a/math/py-gato/pkg-plist b/math/py-gato/pkg-plist new file mode 100644 index 000000000000..274d75c61fba --- /dev/null +++ b/math/py-gato/pkg-plist @@ -0,0 +1,60 @@ +%%PORTDOCS%%share/examples/gato/BFS.alg +%%PORTDOCS%%share/examples/gato/BFS.pro +%%PORTDOCS%%share/examples/gato/DFS.alg +%%PORTDOCS%%share/examples/gato/DFS.pro +%%PORTDOCS%%share/examples/gato/sample.cat +bin/Gato +bin/Gred +lib/%%PYTHON_VERSION%%/site-packages/Gato/AnimatedAlgorithms.py +lib/%%PYTHON_VERSION%%/site-packages/Gato/AnimatedAlgorithms.pyc +lib/%%PYTHON_VERSION%%/site-packages/Gato/AnimatedAlgorithms.pyo +lib/%%PYTHON_VERSION%%/site-packages/Gato/AnimatedDataStructures.py +lib/%%PYTHON_VERSION%%/site-packages/Gato/AnimatedDataStructures.pyc +lib/%%PYTHON_VERSION%%/site-packages/Gato/AnimatedDataStructures.pyo +lib/%%PYTHON_VERSION%%/site-packages/Gato/DataStructures.py +lib/%%PYTHON_VERSION%%/site-packages/Gato/DataStructures.pyc +lib/%%PYTHON_VERSION%%/site-packages/Gato/DataStructures.pyo +lib/%%PYTHON_VERSION%%/site-packages/Gato/Embedder.py +lib/%%PYTHON_VERSION%%/site-packages/Gato/Embedder.pyc +lib/%%PYTHON_VERSION%%/site-packages/Gato/Embedder.pyo +lib/%%PYTHON_VERSION%%/site-packages/Gato/GatoDialogs.py +lib/%%PYTHON_VERSION%%/site-packages/Gato/GatoDialogs.pyc +lib/%%PYTHON_VERSION%%/site-packages/Gato/GatoDialogs.pyo +lib/%%PYTHON_VERSION%%/site-packages/Gato/GatoGlobals.py +lib/%%PYTHON_VERSION%%/site-packages/Gato/GatoGlobals.pyc +lib/%%PYTHON_VERSION%%/site-packages/Gato/GatoGlobals.pyo +lib/%%PYTHON_VERSION%%/site-packages/Gato/GatoIcons.py +lib/%%PYTHON_VERSION%%/site-packages/Gato/GatoIcons.pyc +lib/%%PYTHON_VERSION%%/site-packages/Gato/GatoIcons.pyo +lib/%%PYTHON_VERSION%%/site-packages/Gato/GatoTest.py +lib/%%PYTHON_VERSION%%/site-packages/Gato/GatoTest.pyc +lib/%%PYTHON_VERSION%%/site-packages/Gato/GatoTest.pyo +lib/%%PYTHON_VERSION%%/site-packages/Gato/GatoUtil.py +lib/%%PYTHON_VERSION%%/site-packages/Gato/GatoUtil.pyc +lib/%%PYTHON_VERSION%%/site-packages/Gato/GatoUtil.pyo +lib/%%PYTHON_VERSION%%/site-packages/Gato/Graph.py +lib/%%PYTHON_VERSION%%/site-packages/Gato/Graph.pyc +lib/%%PYTHON_VERSION%%/site-packages/Gato/Graph.pyo +lib/%%PYTHON_VERSION%%/site-packages/Gato/GraphCreator.py +lib/%%PYTHON_VERSION%%/site-packages/Gato/GraphCreator.pyc +lib/%%PYTHON_VERSION%%/site-packages/Gato/GraphCreator.pyo +lib/%%PYTHON_VERSION%%/site-packages/Gato/GraphDisplay.py +lib/%%PYTHON_VERSION%%/site-packages/Gato/GraphDisplay.pyc +lib/%%PYTHON_VERSION%%/site-packages/Gato/GraphDisplay.pyo +lib/%%PYTHON_VERSION%%/site-packages/Gato/GraphEditor.py +lib/%%PYTHON_VERSION%%/site-packages/Gato/GraphEditor.pyc +lib/%%PYTHON_VERSION%%/site-packages/Gato/GraphEditor.pyo +lib/%%PYTHON_VERSION%%/site-packages/Gato/GraphUtil.py +lib/%%PYTHON_VERSION%%/site-packages/Gato/GraphUtil.pyc +lib/%%PYTHON_VERSION%%/site-packages/Gato/GraphUtil.pyo +lib/%%PYTHON_VERSION%%/site-packages/Gato/PlanarEmbedding.py +lib/%%PYTHON_VERSION%%/site-packages/Gato/PlanarEmbedding.pyc +lib/%%PYTHON_VERSION%%/site-packages/Gato/PlanarEmbedding.pyo +lib/%%PYTHON_VERSION%%/site-packages/Gato/PlanarityTest.py +lib/%%PYTHON_VERSION%%/site-packages/Gato/PlanarityTest.pyc +lib/%%PYTHON_VERSION%%/site-packages/Gato/PlanarityTest.pyo +lib/%%PYTHON_VERSION%%/site-packages/Gato/__init__.py +lib/%%PYTHON_VERSION%%/site-packages/Gato/__init__.pyc +lib/%%PYTHON_VERSION%%/site-packages/Gato/__init__.pyo +@dirrm lib/%%PYTHON_VERSION%%/site-packages/Gato +%%PORTDOCS%%@dirrm share/examples/gato |