summaryrefslogtreecommitdiff
blob: 744b3d661a96bb76b41175f2c3bc7c85f8aea589 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
diff -Naur Gato/Embedder.py Gato-patched/Embedder.py
--- Gato/Embedder.py	2005-05-28 10:36:48.000000000 +0000
+++ Gato-patched/Embedder.py	2005-12-04 20:24:05.000000000 +0000
@@ -59,14 +59,14 @@
                                   theGraphEditor.G.yCoord[v], 1)
         
         #----------------------------------------------------------------------
-import whrandom
+import random
 
 def RandomCoords(G):
     G.xCoord={}
     G.yCoord={}
     for v in G.vertices:
-        G.xCoord[v]=whrandom.randint(10,990)
-        G.yCoord[v]=whrandom.randint(10,990)
+        G.xCoord[v]=random.randint(10,990)
+        G.yCoord[v]=random.randint(10,990)
     return 1
     
 class RandomEmbedder(Embedder):
@@ -454,7 +454,7 @@
     for d in list.values():
         Coord2=500-(len(d)-1)*yDist/2
         for v in d:
-            G.xCoord[v]=Coord1+whrandom.randint(-20,20)
+            G.xCoord[v]=Coord1+random.randint(-20,20)
             G.yCoord[v]=Coord2
             Coord2=Coord2+yDist 
         Coord1=Coord1-xDist
diff -Naur Gato/Gato.py Gato-patched/Gato.py
--- Gato/Gato.py	2005-05-28 10:36:48.000000000 +0000
+++ Gato-patched/Gato.py	2005-12-04 20:24:05.000000000 +0000
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.3
+#!/usr/bin/env python2.4
 ################################################################################
 #
 #       This file is part of Gato (Graph Animation Toolbox) 
@@ -40,7 +40,7 @@
 import traceback
 import os
 import bdb
-import whrandom
+import random
 import re 
 import string
 import StringIO
@@ -1588,7 +1588,7 @@
             
         if v == None:
             if default == None:
-                v = whrandom.choice(self.graph.vertices)
+                v = random.choice(self.graph.vertices)
             else:
                 v = default
         if visual is not None:
@@ -1613,7 +1613,7 @@
             
         if e == None:
             if default == None:
-                e = whrandom.choice(self.graph.Edges())
+                e = random.choice(self.graph.Edges())
             else:
                 e = default
                 
diff -Naur Gato/GatoFile.py Gato-patched/GatoFile.py
--- Gato/GatoFile.py	2005-05-28 10:36:48.000000000 +0000
+++ Gato-patched/GatoFile.py	2005-12-04 20:24:05.000000000 +0000
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.3
+#!/usr/bin/env python2.4
 ################################################################################
 #
 #       This file is part of Gato (Graph Animation Toolbox) 
diff -Naur Gato/GraphCreator.py Gato-patched/GraphCreator.py
--- Gato/GraphCreator.py	2005-05-28 10:36:48.000000000 +0000
+++ Gato-patched/GraphCreator.py	2005-12-04 20:24:05.000000000 +0000
@@ -36,7 +36,7 @@
 
 from Graph import *
 from Embedder import *
-import whrandom
+import random
 
 class Creator:
     """ This class provides an abstract Creator as
@@ -202,7 +202,7 @@
     
     m=2
     while index < n:
-        e=Edges[whrandom.randint(0,m-1)]
+        e=Edges[random.randint(0,m-1)]
         v=G.vertices[index]
         index=index+1
         
@@ -297,7 +297,7 @@
         Edges=CompleteEdges(G,n,direction)
         
         for i in range(0,m):
-            pos=whrandom.randint(0,len(Edges)-1)
+            pos=random.randint(0,len(Edges)-1)
             G.AddEdge(Edges[pos][0],Edges[pos][1])
             del Edges[pos]
             
@@ -386,7 +386,7 @@
         Edges=MaximalPlanarEdges(G,n,direction)
         
         for i in range(0,m):
-            pos=whrandom.randint(0,len(Edges)-1)
+            pos=random.randint(0,len(Edges)-1)
             G.AddEdge(Edges[pos][0],Edges[pos][1])
             del Edges[pos]
             
@@ -578,7 +578,7 @@
                     if direction==0: 
                         G.AddEdge(v,new_v)
                     else:
-                        if whrandom.randint(0,1):
+                        if random.randint(0,1):
                             G.AddEdge(v,new_v)
                         else:
                             G.AddEdge(new_v,v)
@@ -640,9 +640,9 @@
                                      float((float(degree)**(height-h)-1)/
                                            (degree-1))))
                 max_nodes=min(n-G.Order()-height+h+1,len(nodes[h])*degree)     
-            nodes_nr=whrandom.randint(min_nodes,max_nodes)
+            nodes_nr=random.randint(min_nodes,max_nodes)
             for i in range(0,nodes_nr):
-                pos=whrandom.randint(0,len(nodes[h])-1)
+                pos=random.randint(0,len(nodes[h])-1)
                 v=nodes[h][pos]
                 children_nr[v]=children_nr[v]+1
                 if children_nr[v]==degree:
@@ -652,7 +652,7 @@
                 if direction==0:
                     G.AddEdge(v,new_v)
                 else:
-                    if whrandom.randint(0,1):
+                    if random.randint(0,1):
                         G.AddEdge(v,new_v)
                     else:
                         G.AddEdge(new_v,v)
diff -Naur Gato/Gred.py Gato-patched/Gred.py
--- Gato/Gred.py	2005-05-28 10:36:48.000000000 +0000
+++ Gato-patched/Gred.py	2005-12-04 20:24:05.000000000 +0000
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.3
+#!/usr/bin/env python2.4
 ################################################################################
 #
 #       This file is part of Gato (Graph Animation Toolbox) 
@@ -50,7 +50,7 @@
 from tkFileDialog import askopenfilename, asksaveasfilename
 from tkMessageBox import askokcancel
 import tkSimpleDialog 
-import whrandom
+import random
 import string
 import sys
 import os
@@ -768,7 +768,7 @@
         for e in self.G.Edges():
             for i in xrange(count):
                 if d.result[i][0] == 1:
-                    val = whrandom.uniform(d.result[i][1],d.result[i][2])
+                    val = random.uniform(d.result[i][1],d.result[i][2])
                     if self.G.edgeWeights[i].QInteger():
                         self.G.edgeWeights[i][e] = round(int(val))
                     else:
diff -Naur Gato/TextTreeWidget.py Gato-patched/TextTreeWidget.py
--- Gato/TextTreeWidget.py	2005-05-28 10:36:48.000000000 +0000
+++ Gato-patched/TextTreeWidget.py	2005-12-04 20:24:05.000000000 +0000
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.3
+#!/usr/bin/env python2.4
 ################################################################################
 #
 #       This file is part of Gato (Graph Animation Toolbox)