Skip to content
Snippets Groups Projects
Commit e7fc11f2 authored by Phil's avatar Phil
Browse files

Added RandPool

parent 93d313d3
No related branches found
No related tags found
No related merge requests found
...@@ -507,10 +507,19 @@ class RandSingString(RandSingularity): ...@@ -507,10 +507,19 @@ class RandSingString(RandSingularity):
"foo.exe\\", ] "foo.exe\\", ]
class RandPool(RandField):
def __init__(self, *args):
"""Each parameter is a volatile object or a couple (volatile object, weight)"""
pool = []
for p in args:
w = 1
if type(p) is tuple:
p,w = p
pool += [p]*w
self._pool = pool
def _fix(self):
r = random.choice(self._pool)
return r._fix()
# Automatic timestamp # Automatic timestamp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment