comparison light8/sub_analyzer.py @ 73:c74fe7efabc1

Submaster analysis to help with gel pickage
author dmcc
date Thu, 11 Jul 2002 15:27:17 +0000
parents 45b12307c695
children 174b35926067
comparison
equal deleted inserted replaced
72:609cb9ae53b1 73:c74fe7efabc1
1 #!/usr/bin/python
2 from Subs import * 1 from Subs import *
3 from Patch import * 2 from Patch import *
4 from types import TupleType 3 from types import TupleType
5 4
6 from Config import patch, subs 5 from Config import patch, subs
7 6
8 import re 7 import re
9 import Patch 8 import Patch
10 Patch.reload_data(0) 9 Patch.reload_data(0)
10
11 def resolve_name(channelname):
12 "Insure that we're talking about the primary name of the light"
13 return Patch.get_channel_name(Patch.get_dmx_channel(channelname))
11 14
12 subusage = {} 15 subusage = {}
13 16
14 # colors = 'ROGBVndcihs' 17 # colors = 'ROGBVndcihs'
15 colors = 'ndcihs' 18 colors = 'ndcihs'
56 '2-07' : 'finale (broadway)', 59 '2-07' : 'finale (broadway)',
57 } 60 }
58 61
59 sub_to_scene = {} 62 sub_to_scene = {}
60 63
61 # blacklist is a list of *prefixes* to light names that won't be shown 64 blacklist = 'god upfill1 upfill2 upfill3 upfill4 red1 red2 red3 red4 blue1 blue2 blue3 blue4 cycleft cycright sidefill1 sidefill2'.split()
62 blacklist = 'god upfill red blue cyc oran sidefill'.split()
63 blacklist.extend(['side l','side r']) 65 blacklist.extend(['side l','side r'])
64 66
65 for subname, levdict in subs.items(): 67 for subname, levdict in subs.items():
66 if type(subname) == TupleType: 68 if type(subname) == TupleType:
67 subname = subname[0] 69 subname = subname[0]
81 83
82 def twist(l): 84 def twist(l):
83 return [(b,a) for a,b in l] 85 return [(b,a) for a,b in l]
84 86
85 def format_usage(ch, usage): 87 def format_usage(ch, usage):
86 if max([ch.startswith(pre) for pre in blacklist]): 88 if ch in blacklist: return
87 return
88
89 usage=twist(usage) 89 usage=twist(usage)
90 usage.sort() 90 usage.sort()
91 # usage.reverse() 91 # usage.reverse()
92 usage=twist(usage) 92 usage=twist(usage)
93 print "======= %s ======= (%d uses)" % (ch, len(usage)) 93 print "======= %s ======= (%d uses)" % (ch, len(usage))