forked from mju-oss-class/Colorwall
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
36 lines (28 loc) · 1.02 KB
/
run.py
File metadata and controls
36 lines (28 loc) · 1.02 KB
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
#!/usr/bin/env python
import argparse, sys
from wall import Wall
import effects
"""
"""
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-w", "--width", type=int,
action="store", dest="width",
default=8, help="wall width")
parser.add_argument("-t", "--height", type=int,
action="store", dest="height",
default=8, help="wall height")
parser.add_argument("-e", "--effects",
nargs='+', dest="effects",
help="specific effects you wish to run")
args = parser.parse_args()
wall = Wall(args.width, args.height)
if args.effects:
effects_to_run = [getattr(effects, a) for a in args.effects \
if hasattr(effects, a)]
else:
effects_to_run = effects.Effects
for effect in effects_to_run:
new_effect = effect(wall)
print new_effect.__class__.__name__
new_effect.run()