Fix opts. Implement opts by dicionary, class implementation can't work this way (bin/CreatePanel.py)
Warning, cannot access the index:
_darcs/index: opening of '_darcs/index' failed: permission denied (Permission denied)
diff -rN -u old-bii_scripts/bin/CreatePanel.py new-bii_scripts/bin/CreatePanel.py
--- old-bii_scripts/bin/CreatePanel.py 2022-12-09 20:22:31.369767654 +0100
+++ new-bii_scripts/bin/CreatePanel.py 2022-12-09 20:22:31.369767654 +0100
@@ -168,13 +168,201 @@
def getWidgetFile(fileName,opts):
(widget,ext) = getFileExt(fileName)
- widgetFileName = ".".join( (widget,opts.type) )
- for path in opts.searchDlPath:
+ widgetFileName = ".".join( (widget,opts['type']) )
+ for path in opts['searchDlPath']:
wdgFile = path+"/"+widgetFileName
if os.path.isfile(wdgFile) == True:
return (widget,wdgFile)
sys.stderr.write(("ERROR: Can't find widget:{} for file:{}\n".format(widgetFileName,fileName)))
return (None,None)
+# Parsed from colors.list by:
+# perl -ne 'printf(" \"%s\":{\"red\":%d,\"green\":%d,\"blue\":%d}\n",$1,$2/256,$3/256,$4/256) if($_=~/static.*\"(.*?)\"\s+\{\s+(\d+)\s(\d+)\s(\d+)/); ' ../../support/APPS/GENERICTEMPLATE/csv2EpicsDbApp/colors.list|sort
+def getColor(color):
+ try: # number means dm2k color number
+ n=int(color)
+ except ValueError:
+ pass
+ else:
+ if n<65: color = "DM2K{}".format(str(n))
+ else: return None
+
+ colors= {
+ "beige-1":{"red":95,"green":95,"blue":82},
+ "beige-2":{"red":118,"green":118,"blue":101},
+ "beige-3":{"red":141,"green":141,"blue":121},
+ "beige-4":{"red":164,"green":164,"blue":141},
+ "beige-5":{"red":186,"green":186,"blue":160},
+ "beige-6":{"red":209,"green":209,"blue":180},
+ "beige-7":{"red":232,"green":232,"blue":200},
+ "beige-8":{"red":255,"green":255,"blue":219},
+ "BGReadback":{"red":235,"green":241,"blue":181},
+ "black":{"red":0,"green":0,"blue":0},
+ "blinkRed":{"red":128,"green":75,"blue":84},
+ "blink White":{"red":255,"green":255,"blue":255},
+ "blue-1":{"red":0,"green":0,"blue":95},
+ "blue-2":{"red":0,"green":0,"blue":148},
+ "blue-3":{"red":0,"green":0,"blue":202},
+ "blue":{"red":0,"green":0,"blue":255},
+ "broen-3":{"red":122,"green":109,"blue":84},
+ "brown-1":{"red":244,"green":218,"blue":168},
+ "brown-2":{"red":183,"green":164,"blue":126},
+ "cyan-1":{"red":0,"green":95,"blue":95},
+ "cyan-2":{"red":0,"green":148,"blue":148},
+ "cyan-3":{"red":0,"green":202,"blue":202},
+ "cyan":{"red":0,"green":255,"blue":255},
+ "Cyan":{"red":0,"green":255,"blue":255},
+ "Disconn/Invalid":{"red":255,"green":255,"blue":255},
+ "DM2K10":{"red":105,"green":105,"blue":105},
+ "DM2K11":{"red":90,"green":90,"blue":90},
+ "DM2K12":{"red":70,"green":70,"blue":70},
+ "DM2K13":{"red":45,"green":45,"blue":45},
+ "DM2K1":{"red":236,"green":236,"blue":236},
+ "DM2K25":{"red":88,"green":147,"blue":255},
+ "DM2K26":{"red":89,"green":126,"blue":225},
+ "DM2K27":{"red":75,"green":110,"blue":199},
+ "DM2K28":{"red":58,"green":94,"blue":171},
+ "DM2K2":{"red":218,"green":218,"blue":218},
+ "DM2K30":{"red":251,"green":243,"blue":74},
+ "DM2K31":{"red":249,"green":218,"blue":60},
+ "DM2K32":{"red":238,"green":182,"blue":43},
+ "DM2K35":{"red":255,"green":176,"blue":255},
+ "DM2K37":{"red":174,"green":78,"blue":188},
+ "DM2K3":{"red":200,"green":200,"blue":200},
+ "DM2K40":{"red":164,"green":170,"blue":255},
+ "DM2K41":{"red":135,"green":147,"blue":226},
+ "DM2K42":{"red":106,"green":115,"blue":193},
+ "DM2K43":{"red":77,"green":82,"blue":164},
+ "DM2K44":{"red":52,"green":51,"blue":134},
+ "DM2K45":{"red":199,"green":187,"blue":109},
+ "DM2K46":{"red":183,"green":157,"blue":92},
+ "DM2K47":{"red":164,"green":126,"blue":60},
+ "DM2K48":{"red":125,"green":86,"blue":39},
+ "DM2K50":{"red":153,"green":255,"blue":255},
+ "DM2K51":{"red":115,"green":223,"blue":255},
+ "DM2K52":{"red":78,"green":165,"blue":249},
+ "DM2K53":{"red":42,"green":99,"blue":228},
+ "DM2K56":{"red":212,"green":219,"blue":157},
+ "DM2K57":{"red":187,"green":193,"blue":135},
+ "DM2K58":{"red":166,"green":164,"blue":98},
+ "DM2K59":{"red":139,"green":130,"blue":57},
+ "DM2K5":{"red":174,"green":174,"blue":174},
+ "DM2K60":{"red":115,"green":255,"blue":107},
+ "DM2K61":{"red":82,"green":218,"blue":59},
+ "DM2K6":{"red":158,"green":158,"blue":158},
+ "DM2K7":{"red":145,"green":145,"blue":145},
+ "DM2K8":{"red":133,"green":133,"blue":133},
+ "DM2K9":{"red":120,"green":120,"blue":120},
+ "dullred":{"red":192,"green":113,"blue":126},
+ "EDMcanvas":{"red":200,"green":200,"blue":200},
+ "EDMhelp":{"red":120,"green":120,"blue":120},
+ "EDMtitle":{"red":158,"green":158,"blue":158},
+ "GlobalCanvas":{"red":187,"green":187,"blue":187},
+ "gray-10":{"red":190,"green":190,"blue":190},
+ "gray-11":{"red":203,"green":203,"blue":203},
+ "gray-12":{"red":216,"green":216,"blue":216},
+ "gray-13":{"red":229,"green":229,"blue":229},
+ "gray-14":{"red":242,"green":242,"blue":242},
+ "gray-1":{"red":74,"green":74,"blue":74},
+ "gray-2":{"red":87,"green":87,"blue":87},
+ "gray-3":{"red":100,"green":100,"blue":100},
+ "gray-4":{"red":113,"green":113,"blue":113},
+ "gray-5":{"red":126,"green":126,"blue":126},
+ "gray-6":{"red":139,"green":139,"blue":139},
+ "gray-7":{"red":152,"green":152,"blue":152},
+ "gray-8":{"red":165,"green":165,"blue":165},
+ "gray-9":{"red":177,"green":177,"blue":177},
+ "graygreen-20":{"red":206,"green":220,"blue":205},
+ "graygreen-30":{"red":185,"green":198,"blue":184},
+ "green-1":{"red":0,"green":95,"blue":0},
+ "green-20":{"red":225,"green":248,"blue":177},
+ "green-21":{"red":202,"green":223,"blue":159},
+ "green-2":{"red":0,"green":118,"blue":0},
+ "green-3":{"red":0,"green":141,"blue":0},
+ "green-4":{"red":0,"green":164,"blue":0},
+ "green-5":{"red":0,"green":186,"blue":0},
+ "green-6":{"red":0,"green":209,"blue":0},
+ "green-7":{"red":0,"green":232,"blue":0},
+ "greengray-40":{"red":166,"green":178,"blue":165},
+ "green":{"red":0,"green":255,"blue":0},
+ "grey-10":{"red":105,"green":105,"blue":105},
+ "grey-11":{"red":90,"green":90,"blue":90},
+ "grey-12":{"red":70,"green":70,"blue":70},
+ "grey-13":{"red":45,"green":45,"blue":45},
+ "grey-1":{"red":236,"green":236,"blue":236},
+ "grey-2":{"red":218,"green":218,"blue":218},
+ "grey-4":{"red":187,"green":187,"blue":187},
+ "grey-5":{"red":174,"green":174,"blue":174},
+ "grey-7":{"red":145,"green":145,"blue":145},
+ "grey-8":{"red":133,"green":133,"blue":133},
+ "lilac-1":{"red":82,"green":82,"blue":95},
+ "lilac-2":{"red":101,"green":101,"blue":118},
+ "lilac-3":{"red":121,"green":121,"blue":141},
+ "lilac-4":{"red":141,"green":141,"blue":164},
+ "lilac-5":{"red":160,"green":160,"blue":186},
+ "lilac-6":{"red":180,"green":180,"blue":209},
+ "lilac-7":{"red":200,"green":200,"blue":232},
+ "lilac-8":{"red":219,"green":219,"blue":255},
+ "mint-1":{"red":181,"green":249,"blue":215},
+ "mint-2":{"red":162,"green":224,"blue":193},
+ "misc-109":{"red":205,"green":202,"blue":221},
+ "misc-110":{"red":184,"green":181,"blue":198},
+ "misc-111":{"red":165,"green":162,"blue":178},
+ "misc-112":{"red":222,"green":196,"blue":251},
+ "misc-113":{"red":199,"green":175,"blue":225},
+ "misc-114":{"red":221,"green":202,"blue":221},
+ "misc-115":{"red":198,"green":181,"blue":198},
+ "misc-116":{"red":178,"green":162,"blue":178},
+ "misc-117":{"red":251,"green":235,"blue":236},
+ "misc-118":{"red":225,"green":176,"blue":212},
+ "misc-119":{"red":255,"green":150,"blue":168},
+ "pastel-1":{"red":82,"green":95,"blue":82},
+ "pastel-2":{"red":101,"green":118,"blue":101},
+ "pastel-3":{"red":121,"green":141,"blue":121},
+ "pastel-4":{"red":141,"green":164,"blue":141},
+ "pastel-5":{"red":160,"green":186,"blue":160},
+ "pastel-6":{"red":180,"green":209,"blue":180},
+ "pastel-7":{"red":200,"green":232,"blue":200},
+ "pastel-8":{"red":219,"green":255,"blue":219},
+ "purple-1":{"red":95,"green":0,"blue":95},
+ "purple-2":{"red":148,"green":0,"blue":148},
+ "purple-3":{"red":202,"green":0,"blue":202},
+ "purple":{"red":255,"green":0,"blue":255},
+ "red-1":{"red":95,"green":0,"blue":0},
+ "red-2":{"red":118,"green":0,"blue":0},
+ "red-3":{"red":141,"green":0,"blue":0},
+ "red-4":{"red":164,"green":0,"blue":0},
+ "red-5":{"red":186,"green":0,"blue":0},
+ "red-6":{"red":209,"green":0,"blue":0},
+ "red-7":{"red":232,"green":0,"blue":0},
+ "red":{"red":255,"green":0,"blue":0},
+ "Relateddisplay":{"red":128,"green":88,"blue":48},
+ "rose-1":{"red":95,"green":82,"blue":82},
+ "rose-2":{"red":118,"green":101,"blue":101},
+ "rose-3":{"red":141,"green":121,"blue":121},
+ "rose-4":{"red":164,"green":141,"blue":141},
+ "rose-5":{"red":186,"green":160,"blue":160},
+ "rose-6":{"red":209,"green":180,"blue":180},
+ "rose-7":{"red":232,"green":200,"blue":200},
+ "rose-8":{"red":255,"green":219,"blue":219},
+ "Shell/reldsp-alt":{"red":255,"green":176,"blue":96},
+ "sky-1":{"red":176,"green":218,"blue":249},
+ "sky-2":{"red":158,"green":196,"blue":224},
+ "steel-1":{"red":194,"green":218,"blue":217},
+ "steel-2":{"red":174,"green":196,"blue":195},
+ "steel-3":{"red":156,"green":176,"blue":175},
+ "TitleBooster":{"red":39,"green":84,"blue":141},
+ "TitleHF":{"red":214,"green":127,"blue":226},
+ "white":{"red":255,"green":255,"blue":255},
+ "White":{"red":255,"green":255,"blue":255},
+ "yellow-1":{"red":95,"green":95,"blue":0},
+ "yellow-2":{"red":148,"green":148,"blue":0},
+ "yellow-3":{"red":202,"green":202,"blue":0},
+ "yellow":{"red":255,"green":255,"blue":0}
+ }
+ if color in colors:
+ return colors[color]
+ else:
+ return None
def createLableStr(text,width,height,x,y,size,style="REGULAR"):
lable = ("""<widget type="label" version="2.0.0">
@@ -196,9 +384,9 @@
<transparent>false</transparent>
<vertical_alignment>1</vertical_alignment>
</widget>
-
- """).format(text,width,height,x,y,size,style)
+""").format(text,width,height,x,y,size,style)
return lable
+
#---------------------------------
# replace <display> of the widget file by <group>:
# - <group> items may be set by its <x>, <y> positions at load time and
@@ -210,6 +398,8 @@
self.regPvField=re.compile(r"(.*)\.")
self.w = None
self.h = None
+ self.wdg = None
+ self.wdgStr = None
if 'xmlStr' in args:
wdg = ET.XML(args['xmlStr'])
self.w = wdg.find('width').text
@@ -217,25 +407,21 @@
self.wdg = wdg
self.wdgStr = args['xmlStr']
self.name = wdg.find('name').text
- #print("ParsedWidget xmlStr: ",self.name,self.w,self.h)
elif 'file' in args:
widgetFileName = args['file']
opts = args['options']
- if opts.verbose: print("ParsedWidget FILE:",widgetFileName)
- self.wdg = None
(widget,wdgFile) = getWidgetFile(widgetFileName,opts)
- wdgGroup = ET.XML('<widget type="group" version="2.0.0"> <name>{}</name> <x>{}</x> <y>{}</y> <width>1</width> <height>1</height> <style>3</style> <transparent>true</transparent></widget>'.format(widget,opts.spaceing,opts.spaceing))
self.name = widget
if wdgFile != None:
+ wdgGroup = None
parseTree = ET.parse(wdgFile)
display = parseTree.getroot()
if display.tag == 'display':
self.w = display.find('width').text
- self.w = int(self.w) + opts.spaceing
- wdgGroup.find('width').text = str(self.w)
+ self.w = int(self.w) + opts['spaceing']
self.h = display.find('height').text
- self.h = int(self.h) + opts.spaceing
- wdgGroup.find('height').text = str(self.h)
+ self.h = int(self.h) + opts['spaceing']
+ wdgGroup = ET.XML('<widget type="group" version="2.0.0"> <name>{}</name> <x>{}</x> <y>{}</y> <width>1</width> <height>1</height> <style>3</style> <transparent>true</transparent></widget>'.format(widget,opts['spaceing'],opts['spaceing']))
#print(" "+self.name+":\tSize",str(self.w),str(self.h))
for wdg in display.findall('widget'):
#print("\t",wdg.tag,wdg.get('type'))
@@ -244,7 +430,7 @@
raise ValueError("Ilegal widget file: "+wdgFile)
self.wdg = wdgGroup
self.wdgStr = ET.tostring(wdgGroup)
-# print("ParsedWidget file: ",self.name,self.w,self.h)
+ if opts['verbose']: print("ParsedWidget file: ",self.name,self.w,self.h)
else:
sys.stderr.write("Can't create a ParsedWidget from args: "+str(args)+"\n")
@@ -252,8 +438,10 @@
return self.name+" w:"+str(self.w)+" h:"+str(self.h)
def parsePV(self,substData):
- """ A PV substitution that contains a field is truncated to the PV name for PV definitions in the
- widget that contains also fields. For compatibility to CreatePanel.pl
+ """Create the variable PV for widgets that use the $(PV) variables instead
+ of $(DEVN):$(SNAME) or the legacy $(NAME):$(SNAME).
+ A PV substitution that contains a field is truncated to the PV name for PV
+ definitions in the widget that contains also fields.
"""
if len(substData) == 0: return
if 'PV' not in substData:
@@ -286,6 +474,7 @@
#print("\nWIDGET: ",sString)
wdgRoot = ET.XML(sString)
#** END replace macros here
+
x = wdgRoot.find('x')
y = wdgRoot.find('y')
x.text = str(xPos + int(x.text))
@@ -319,8 +508,8 @@
* The order of widgets may be set ba the option '-sort NAME'. NAME is any name
of a variable in the '.substitutions' file
"""
- if opts.verbose: print("layout: Line at y:",yPos)
- panelWidth = opts.width;
+ if opts['verbose']: print("layout: Line at y:",yPos)
+ panelWidth = opts['width'];
dWidth = display.find('width')
dWidth.text = str(panelWidth)
xPos=0
@@ -329,19 +518,19 @@
for group in substData: # the .template files
(wName,wExt) = getFileExt(group[0])
- if opts.verbose:print("Group:",wName,"at x:",xPos," y:",yPos)
+ if opts['verbose']:print("Group:",wName,"at x:",xPos," y:",yPos)
items = group[1:len(group)]
- if opts.sort != None: items = sorted(items,key=lambda x: x[opts.sort])
+ if opts['sort'] != None: items = sorted(items,key=lambda x: x[opts['sort']])
try:
- wdgItem = opts.widgetStore[wName]
+ wdgItem = opts['widgetStore'][wName]
for item in items:
dbg.add( (wdgItem.name,str(xPos),str(yPos),str(item)) )
(wdgWidth,wdgHeight,wdg) = wdgItem.setWidget(xPos,yPos,item)
#print(prettyXml(ET.tostring(wdg,encoding='utf-8')))
display.append(wdg)
- if (xPos + 2*wdgWidth) > opts.width:
+ if (xPos + 2*wdgWidth) > opts['width']:
xPos = 0
yPos = yPos + wdgHeight
else:
@@ -355,7 +544,7 @@
dHeight = display.find('height')
dHeight.text = str(yPos+wdgHeight)
- if opts.verbose:
+ if opts['verbose']:
dbg.print()
print("Display width:",dWidth.text," height:",dHeight.text)
panelStr = prettyXml(ET.tostring(display,encoding='utf-8'))
@@ -370,8 +559,8 @@
* The order of widgets may be set ba the option '-sort NAME'. NAME is any
name of a variable in the '.substitutions' file
"""
- if opts.verbose: print("layout: LineRaw at y:",yPos)
- panelWidth = opts.width;
+ if opts['verbose']: print("layout: LineRaw at y:",yPos)
+ panelWidth = opts['width'];
dWidth = display.find('width')
dWidth.text = str(panelWidth)
xPos=0
@@ -381,17 +570,17 @@
for group in substData: # the .template files
(wName,wExt) = getFileExt(group[0])
- if opts.verbose: print("Group:",wName,"at x:",xPos," y:",yPos)
+ if opts['verbose']: print("Group:",wName,"at x:",xPos," y:",yPos)
items = group[1:len(group)]
- if opts.sort != None: items = sorted(items,key=lambda x: x[opts.sort])
+ if opts['sort'] != None: items = sorted(items,key=lambda x: x[opts['sort']])
try:
- wdgItem = opts.widgetStore[wName]
+ wdgItem = opts['widgetStore'][wName]
if wdgItem.h > wdgMaxHeight:
wdgMaxHeight = wdgItem.h
for item in items:
- if (xPos + 2*wdgItem.w) > opts.width:
+ if (xPos + 2*wdgItem.w) > opts['width']:
xPos = 0
yPos = yPos + wdgMaxHeight
dbg.add( (wdgItem.name,str(xPos),str(yPos),str(item)) )
@@ -405,7 +594,7 @@
continue
dHeight = display.find('height')
dHeight.text = str(yPos+wdgHeight)
- if opts.verbose:
+ if opts['verbose']:
dbg.print()
print("Display width:",dWidth.text," height:",dHeight.text)
panelStr = prettyXml(ET.tostring(display,encoding='utf-8'))
@@ -420,8 +609,8 @@
* There order of widgets in a collumn is as read from the substitution file or
determined by -sort option one below the other.
"""
- if opts.verbose: print("layout: collumn at y:",yPos)
- panelWidth = opts.width;
+ if opts['verbose']: print("layout: collumn at y:",yPos)
+ panelWidth = opts['width'];
dWidth = display.find('width')
dWidth.text = str(panelWidth)
xPos = 0
@@ -431,12 +620,12 @@
for group in substData: # the .template files
(wName,wExt) = getFileExt(group[0])
- if opts.verbose: print("Group:",wName,"at x:",xPos," y:",yPos)
+ if opts['verbose']: print("Group:",wName,"at x:",xPos," y:",yPos)
items = group[1:len(group)]
- if opts.sort != None: items = sorted(items,key=lambda x: x[opts.sort])
+ if opts['sort'] != None: items = sorted(items,key=lambda x: x[opts['sort']])
try:
- wdgItem = opts.widgetStore[wName]
+ wdgItem = opts['widgetStore'][wName]
yPos = y0
for item in items:
dbg.add( (wdgItem.name,str(xPos),str(yPos),str(item)) )
@@ -453,7 +642,7 @@
dHeight = display.find('height')
dHeight.text = str(yMax)
- if opts.verbose:
+ if opts['verbose']:
dbg.print()
print("Display width:",dWidth.text," height:",dHeight.text)
panelStr = prettyXml(ET.tostring(display,encoding='utf-8'))
@@ -472,8 +661,8 @@
* The order of widgets may be set ba the option '-sort NAME'. NAME is any name
of a variable in the '.substitutions' file
"""
- if opts.verbose: print("layout: table at y:",yPos)
- panelWidth = opts.width;
+ if opts['verbose']: print("layout: table at y:",yPos)
+ panelWidth = opts['width'];
dWidth = display.find('width')
dWidth.text = str(panelWidth)
xPos = 0
@@ -483,12 +672,12 @@
for group in substData: # the .template files
(wName,wExt) = getFileExt(group[0])
- if opts.verbose: print("Group:",wName,"at x:",xPos," y:",yPos)
+ if opts['verbose']: print("Group:",wName,"at x:",xPos," y:",yPos)
items = group[1:len(group)]
- if opts.sort != None: items = sorted(items,key=lambda x: x[opts.sort])
+ if opts['sort'] != None: items = sorted(items,key=lambda x: x[opts['sort']])
try:
- wdgItem = opts.widgetStore[wName]
+ wdgItem = opts['widgetStore'][wName]
cols = int(panelWidth/wdgItem.w)
rows = len(group) / cols
if rows - int(rows) != 0: rows = int(rows) + 1
@@ -510,7 +699,7 @@
yPos += rows * wdgItem.h
dHeight = display.find('height')
dHeight.text = str( (rows*wdgItem.h)+y0 )
- if opts.verbose:
+ if opts['verbose']:
dbg.print()
print("Display width:",dWidth.text," height:",dHeight.text)
panelStr = prettyXml(ET.tostring(display,encoding='utf-8'))
@@ -531,7 +720,7 @@
the title determins width and height of the panel.
* Without title display, width and hight are calculated to fit for all widgets
"""
- if opts.verbose: print("layout: xy")
+ if opts['verbose']: print("layout: xy")
xPos = 0
yPos = 0 # ignore title height parameter, as title is the background file!
@@ -541,10 +730,10 @@
for group in substData: # the .template files
(wName,wExt) = getFileExt(group[0])
- if opts.verbose: print("Group:",wName,"at x:",xPos," y:",yPos)
+ if opts['verbose']: print("Group:",wName,"at x:",xPos," y:",yPos)
items = group[1:len(group)]
try:
- wdgItem = opts.widgetStore[wName]
+ wdgItem = opts['widgetStore'][wName]
#print("\t","Cols:",cols," Rows:",rows)
for item in items:
@@ -567,7 +756,7 @@
dWidth = display.find('width')
dHeight = display.find('height')
- if opts.backGroundDisplay == None:
+ if opts['backGroundDisplay'] == None:
dHeight.text = str(yMax)
dWidth.text = str(xMax)
else:
@@ -578,7 +767,7 @@
sys.stderr.write("Warning: Display height {} smaler than calculated, set to {}".format(dHeight.text,str(yMax))+"\n" );
dHeight.text = str(yMax)
- if opts.verbose:
+ if opts['verbose']:
dbg.print()
print("Display width:",dWidth.text," height:",dHeight.text)
panelStr = prettyXml(ET.tostring(display,encoding='utf-8'))
@@ -601,7 +790,7 @@
(wName,wExt) = getFileExt(group[0])
items = group[1:len(group)]
try:
- wdgItem = opts.widgetStore[wName]
+ wdgItem = opts['widgetStore'][wName]
for item in items:
try:
@@ -629,7 +818,7 @@
sys.stderr.write("ERROR: No GRID items found skip Display\n")
return
- if opts.verbose: dbg.print()
+ if opts['verbose']: dbg.print()
xLen = 0
yLen = 0
@@ -672,7 +861,7 @@
spanedWidth = 0
# show table
- if opts.verbose:
+ if opts['verbose']:
h = [ str(x) for x in range(0, yLen)]
tblDbg = Dbg(h)
tblDbg.add(colMaxWidth)
@@ -684,7 +873,7 @@
else:
R.append("None")
tblDbg.add(R)
- if opts.verbose:
+ if opts['verbose']:
tblDbg.print()
print("rowMaxHeight:",rowMaxHeight,"\nspan:",spanedWidth,"\ndisplayWidth:",displayWidth,"\ndisplayHeight:",displayHeight)
rowPos = [0]*len(rowMaxHeight)
@@ -694,7 +883,7 @@
colPos = [0]*len(colMaxWidth)
for x in range(1,len(colMaxWidth)):
colPos[x] = colPos[x-1] + colMaxWidth[x-1]
- if opts.verbose:
+ if opts['verbose']:
print("rowMaxHeight:",rowMaxHeight,"\ncolMaxWidth:",colMaxWidth,"\ndisplayWidth:",displayWidth,"\ndisplayHeight:",displayHeight)
dbg.clear()
for (y,row) in zip(range(0,len(table)),table):
@@ -707,13 +896,12 @@
(wdgWidth,wdgHeight,wdg) = parsedWdg.setWidget(xPos,yPos,item.subst)
dbg.add(( ("{}:w={} h={}".format(parsedWdg.name,parsedWdg.w,parsedWdg.h)) ,str(xPos),str(yPos),str(parsedWdg)) )
display.append(wdg)
- if opts.verbose:
+ if opts['verbose']:
print("The grid table:\n****************" )
dbg.print()
panelStr = prettyXml(ET.tostring(display,encoding='utf-8'))
return panelStr
-
def process_file(opts):
"""convert a single file."""
display = ET.XML("""<?xml version="1.0" encoding="UTF-8"?>
@@ -731,21 +919,17 @@
</display>
""")
- if opts.backGroundDisplay != None:
- (wdgWidth,wdgHeight,wdg) = opts.backGroundDisplay.setWidget(0,0,opts.substitutions)
- display.append(wdg)
- dWidth = display.find('width')
- dWidth.text = wdgWidth
- dHeight = display.find('height')
- dHeight.text = wdgHeight
+ if opts['backGroundDisplay'] != None:
+ display = opts['backGroundDisplay']
+
#-------- get substitutions data
- if opts.inFile != "-":
- f= open(opts.inFile, "r")
+ if opts['inFile'] != "-":
+ f= open(opts['inFile'], "r")
else:
#sys.stderr.write("(expect input from stdin)\n")
f= sys.stdin
substFileStr= f.read()
- if opts.inFile != "-":
+ if opts['inFile'] != "-":
f.close()
substData = parse_subst.parse(substFileStr,"list")
@@ -753,7 +937,7 @@
#-------- check for widget dependencies and read them
dependencies = [x[0] for x in substData]
- if opts.dependencies == True:
+ if opts['dependencies'] == True:
depFiles = []
for widgetFileName in dependencies:
(widget,wdgFile) = getWidgetFile(widgetFileName,opts)
@@ -762,57 +946,56 @@
else:
depFiles.append(wdgFile)
reg=re.compile(r"\.d\s*$")
- target =reg.sub("",opts.outFile)
- with open(opts.outFile,mode="w") as w:
+ target =reg.sub("",opts['outFile'])
+ with open(opts['outFile'],mode="w") as w:
w.write("{}: {}\n".format(target," ".join(depFiles) ))
return
for wdg in dependencies:
w = ParsedWidget(file=wdg,options=opts)
if w.name != None:
- opts.widgetStore[w.name] = w
+ opts['widgetStore'][w.name] = w
- if opts.verbose:
- print("\n**** WIDGET Store:",",".join(opts.widgetStore.keys()))
- for wKey in opts.widgetStore:
- wdg = opts.widgetStore[wKey]
+ if opts['verbose']:
+ print("\n**** WIDGET Store:",",".join(opts['widgetStore'].keys()))
+ for wKey in opts['widgetStore']:
+ wdg = opts['widgetStore'][wKey]
print(wKey,wdg)
#-------- create display by layout
printData = "Empty Print Data!"
yPos = 0
- if 'title' in opts.widgetStore:
- (wdgWidth,wdgHeight,wdg) = opts.widgetStore['title'].setWidget(0,yPos,opts.substitutions)
+ if 'title' in opts['widgetStore']:
+ (wdgWidth,wdgHeight,wdg) = opts['widgetStore']['title'].setWidget(0,yPos,opts['substitutions'])
display.append(wdg)
yPos = int(wdgHeight)
- if opts.layout == 'line':
+ if opts['layout'] == 'line':
printData = layoutLine(substData,display,yPos,opts)
- elif opts.layout == 'rawline':
+ elif opts['layout'] == 'rawline':
printData = layoutRawLine(substData,display,yPos,opts)
- elif opts.layout == 'column':
+ elif opts['layout'] == 'column':
printData = layoutColumn(substData,display,yPos,opts)
- elif opts.layout == 'table':
+ elif opts['layout'] == 'table':
printData = layoutTable(substData,display,yPos,opts)
- elif opts.layout == 'xy':
+ elif opts['layout'] == 'xy':
printData = layoutXY(substData,display,yPos,opts)
- elif opts.layout == 'grid':
+ elif opts['layout'] == 'grid':
printData = layoutGrid(substData,display,yPos,opts)
#-------- print display file
- if opts.outFile is not None:
- out= open(opts.outFile, "w")
+ if opts['outFile'] is not None:
+ out= open(opts['outFile'], "w")
output_mode = "a"
else:
out= sys.stdout
#out.write("do(\n")
out.write(printData)
#out.write(")\n")
- if opts.outFile is not None:
+ if opts['outFile'] is not None:
out.close()
-#--------------------------------------------------
-class getOption(object):
- def __init__(self):
+#--------------------------------------------------
+def main():
usage = "usage: %prog [options] inFile.substitutions outFile.bob"
parser = OptionParser(usage=usage,
@@ -891,56 +1074,57 @@
# help="(pixel) Y-Position of the panel (default=100)",
# )
(options, args) = parser.parse_args()
- self.inFile = None
- self.outFile = None
+ opts = {}
+ opts['inFile'] = None
+ opts['outFile'] = None
try:
- (self.inFile, self.outFile) = args
+ (opts['inFile'], opts['outFile']) = args
except ValueError:
sys.stderr.write("ERROR: missing argument for in-, out-file:"+str(args))
sys.exit(1)
- self.verbose = False
+ opts['verbose'] = False
if options.verbose:
- print("READ: ",self.inFile,"WRITE:",self.outFile)
- self.verbose = True
+ print("READ: ",opts['inFile'],"WRITE:",opts['outFile'])
+ opts['verbose'] = True
- self.type = "bob"
+ opts['type'] = "bob"
if options.type:
if options.type not in ['bob']: # Currently only bob supported! ['bob','adl','edl']:
sys.stderr.write("ERROR: not supported --type option: "+options.type)
sys.exit(1)
- self.type = options.type
- if self.verbose: print("TYPE:\t",self.type)
+ opts['type'] = options.type
+ if opts['verbose']: print("TYPE:\t",opts['type'])
- self.width = 900
+ opts['width'] = 900
if options.w:
try:
- self.width = int(options.w)
+ opts['width'] = int(options.w)
except ValueError:
sys.stderr.write("ERROR: illegal --width option: "+options.w)
sys.exit(1)
- if self.verbose: print("WIDTH:\t",self.width)
+ if opts['verbose']: print("WIDTH:\t",opts['width'])
- self.layout = "line"
+ opts['layout'] = "line"
if options.layout:
if options.layout not in ['line','xy','grid','table','column','rawline']:
sys.stderr.write("ERROR: illegal --layout option: "+options.layout)
sys.exit(1)
- self.layout= options.layout
- if self.verbose: print("LAYOUT:\t",self.layout)
+ opts['layout']= options.layout
+ if opts['verbose']: print("LAYOUT:\t",opts['layout'])
- self.substitutions = None
+ opts['substitutions'] = None
if options.subst:
- self.substitutions = parseParam(options.subst,';')
- if self.verbose: print("SUBST:\t",self.substitutions)
+ opts['substitutions'] = parseParam(options.subst,';')
+ if opts['verbose']: print("SUBST:\t",opts['substitutions'])
- self.dependencies = None
+ opts['dependencies'] = None
if options.M:
- self.dependencies = True
+ opts['dependencies'] = True
- self.sort = None
+ opts['sort'] = None
if options.sort:
- self.sort = options.sort
- self.searchDlPath = []
+ opts['sort'] = options.sort
+ opts['searchDlPath'] = []
path_i = []
path_I = []
if options.I:
@@ -954,293 +1138,53 @@
path_i = os.environ['EPICS_DISPLAY_PATH'].split(':')
except KeyError:
path_i = []
- self.searchDlPath = [*path_I, *path_i]
- if self.verbose: print("WIDGETPATH:\t",self.searchDlPath)
+ opts['searchDlPath'] = [*path_I, *path_i]
+ if opts['verbose']: print("WIDGETPATH:\t",opts['searchDlPath'])
- self.widgetStore = {} # buffer allready parsed widgets
- self.backGroundDisplay = None
+ opts['widgetStore'] = {} # buffer allready parsed widgets
+ opts['backGroundDisplay'] = None
if options.baseW:
try: # check if its a file name of form: name.extension
(file,ext) = getFileExt(options.baseW)
- if ext != self.type:
+ if ext != opts['type']:
sys.stderr.write("ERROR: option mismatch panel type and title extension "+options.baseW)
sys.exit(1)
- self.backGroundDisplay = ParsedWidget(file=options.baseW,options=self)
+
+ (widget,wdgFile) = getWidgetFile(options.baseW,opts)
+ if wdgFile != None:
+ parseTree = ET.parse(wdgFile)
+ display = parseTree.getroot()
+ opts['backGroundDisplay'] = display
+
except AttributeError:
sys.stderr.write("ERROR: illegal --baseW option: "+options.baseW+"\n")
- self.spaceing = 0
- self.titleWdg = None
+ opts['spaceing'] = 0
+ opts['titleWdg'] = None
if options.title:
titleFile = options.title
try: # check if its a file name of form: name.extension
(file,ext) = getFileExt(titleFile)
- if ext != self.type:
+ if ext != opts['type']:
sys.stderr.write("ERROR: option mismatch panel type and title extension "+options.title)
sys.exit(1)
- titleWdg = ParsedWidget(file=titleFile,options=self)
+ titleWdg = ParsedWidget(file=titleFile,options=opts)
except AttributeError:
- titleWdg = ParsedWidget(xmlStr=createLableStr(options.title,self.width,30,0,0,25))
+ titleWdg = ParsedWidget(xmlStr=createLableStr(options.title,opts['width'],30,0,0,25))
except: # title string, put to text wiget
sys.stderr.write("ERROR: illegal --title option: "+options.title+"\n")
- self.widgetStore["title"] = titleWdg
+ opts['widgetStore']["title"] = titleWdg
# set spaceing after setting the title!
if options.border:
- self.spaceing = int(options.border)
+ opts['spaceing'] = int(options.border)
if options.spaceing:
- self.spaceing = int(options.spaceing)
+ opts['spaceing'] = int(options.spaceing)
-def getColor(color):
- try: # number means dm2k color number
- n=int(color)
- except ValueError:
- pass
- else:
- if n<65: color = "DM2K{}".format(str(n))
- else: return None
-
- alias = { 'TitleMicrotron':'DM2K19',
- 'TitleRing':'DM2K24',
- 'TitleBooster':'DM2K29',
- 'TitleDiagnostic':'DM2K33',
- 'TitleHF':'DM2K36',
- 'TitleInjLine':'DM2k39',
- 'TitleTransferline':'DM2K49',
- 'TitleLinac':'DM2K54',
- 'BGReadback':'DM2K55',
- 'Mon:NORMAL/alt':'green',
- 'Mon:MINOR':'yellow',
- 'Mon:MAJOR':'red',
- 'Disconn/Invalid':'white',
- 'Global Canvas':'DM2K4',
- 'Exit/Quit/Kill':'red',
- 'EDMhelp':'DM2K9',
- 'EDMcanvas':'DM2K3',
- 'White':'white',
- 'Black':'black',
- 'Blue':'blue',
- 'Cyan':'cyan',
- 'dummy 1':'black',
- 'dummy 2':'black',
- 'dummy 3':'black',
- 'invisible':'black'
- }
- if color in alias:
- color = alias[color]
- colors= {
- 'DM2K0':{'red':256,'green':256,'blue':256},
- 'DM2K1':{'red':237,'green':237,'blue':237},
- 'DM2K2':{'red':219,'green':219,'blue':219},
- 'DM2K3':{'red':201,'green':201,'blue':201},
- 'DM2K4':{'red':188,'green':188,'blue':188},
- 'DM2K5':{'red':175,'green':175,'blue':175},
- 'DM2K6':{'red':159,'green':159,'blue':159},
- 'DM2K7':{'red':146,'green':146,'blue':146},
- 'DM2K8':{'red':134,'green':134,'blue':134},
- 'DM2K9':{'red':120,'green':120,'blue':120},
- 'DM2K10':{'red':105,'green':105,'blue':105},
- 'DM2K11':{'red':90,'green':90,'blue':90},
- 'DM2K12':{'red':70,'green':70,'blue':70},
- 'DM2K13':{'red':45,'green':45,'blue':45},
- 'DM2K14':{'red':0,'green':0,'blue':0},
- 'DM2K15':{'red':0,'green':217,'blue':0},
- 'DM2K16':{'red':30,'green':188,'blue':0},
- 'DM2K17':{'red':51,'green':154,'blue':0},
- 'DM2K18':{'red':45,'green':127,'blue':0},
- 'DM2K19':{'red':33,'green':108,'blue':0},
- 'DM2K20':{'red':254,'green':0,'blue':0},
- 'DM2K21':{'red':223,'green':19,'blue':9},
- 'DM2K22':{'red':191,'green':25,'blue':11},
- 'DM2K23':{'red':161,'green':18,'blue':7},
- 'DM2K24':{'red':131,'green':4,'blue':0},
- 'DM2K25':{'red':88,'green':148,'blue':256},
- 'DM2K26':{'red':89,'green':126,'blue':226},
- 'DM2K27':{'red':75,'green':110,'blue':200},
- 'DM2K28':{'red':58,'green':94,'blue':172},
- 'DM2K29':{'red':39,'green':84,'blue':142},
- 'DM2K30':{'red':252,'green':244,'blue':74},
- 'DM2K31':{'red':250,'green':219,'blue':60},
- 'DM2K32':{'red':239,'green':183,'blue':43},
- 'DM2K33':{'red':226,'green':145,'blue':21},
- 'DM2K34':{'red':206,'green':97,'blue':0},
- 'DM2K35':{'red':256,'green':177,'blue':256},
- 'DM2K36':{'red':215,'green':127,'blue':227},
- 'DM2K37':{'red':175,'green':78,'blue':189},
- 'DM2K38':{'red':140,'green':26,'blue':151},
- 'DM2k39':{'red':97,'green':10,'blue':117},
- 'DM2K40':{'red':165,'green':171,'blue':256},
- 'DM2K41':{'red':136,'green':148,'blue':227},
- 'DM2K42':{'red':106,'green':115,'blue':194},
- 'DM2K43':{'red':77,'green':82,'blue':165},
- 'DM2K44':{'red':52,'green':51,'blue':135},
- 'DM2K45':{'red':200,'green':188,'blue':109},
- 'DM2K46':{'red':184,'green':158,'blue':92},
- 'DM2K47':{'red':165,'green':126,'blue':60},
- 'DM2K48':{'red':125,'green':86,'blue':39},
- 'DM2K49':{'red':88,'green':52,'blue':15},
- 'DM2K50':{'red':154,'green':256,'blue':256},
- 'DM2K51':{'red':115,'green':224,'blue':256},
- 'DM2K52':{'red':78,'green':166,'blue':250},
- 'DM2K53':{'red':42,'green':99,'blue':229},
- 'DM2K54':{'red':10,'green':0,'blue':185},
- 'DM2K55':{'red':236,'green':242,'blue':182},
- 'DM2K56':{'red':213,'green':220,'blue':158},
- 'DM2K57':{'red':188,'green':194,'blue':136},
- 'DM2K58':{'red':167,'green':165,'blue':98},
- 'DM2K59':{'red':140,'green':131,'blue':57},
- 'DM2K60':{'red':115,'green':256,'blue':107},
- 'DM2K61':{'red':82,'green':219,'blue':59},
- 'DM2K62':{'red':60,'green':181,'blue':32},
- 'DM2K63':{'red':40,'green':148,'blue':21},
- 'DM2K64':{'red':26,'green':115,'blue':9},
- 'Disconn/Invalid':{'red':256,'green':256,'blue':256},
- 'Mon:NORMAL/alt':{'red':0,'green':256,'blue':0},
- 'Mon:NORMAL':{'red':0,'green':193,'blue':0},
- 'Mon:MAJOR/unack':{'red':193,'green':0,'blue':0},
- 'Mon:MINOR/unack':{'red':193,'green':193,'blue':0},
- 'EDMcanvas':{'red':201,'green':201,'blue':201},
- 'EDMhelp':{'red':120,'green':120,'blue':120},
- 'EDMtitle':{'red':159,'green':159,'blue':159},
- 'Shell/reldsp-alt':{'red':256,'green':177,'blue':96},
- 'Relateddisplay':{'red':129,'green':88,'blue':48},
- 'Exit/Quit/Kill':{'red':256,'green':0,'blue':256},
- 'grey-1':{'red':237,'green':237,'blue':237},
- 'grey-2':{'red':219,'green':219,'blue':219},
- 'grey-4':{'red':188,'green':188,'blue':188},
- 'grey-5':{'red':175,'green':175,'blue':175},
- 'grey-7':{'red':146,'green':146,'blue':146},
- 'grey-8':{'red':134,'green':134,'blue':134},
- 'grey-10':{'red':105,'green':105,'blue':105},
- 'grey-11':{'red':90,'green':90,'blue':90},
- 'grey-12':{'red':70,'green':70,'blue':70},
- 'grey-13':{'red':45,'green':45,'blue':45},
- 'black-14':{'red':0,'green':0,'blue':0},
- 'green-16':{'red':0,'green':225,'blue':0},
- 'green-18':{'red':0,'green':161,'blue':0},
- 'green-19':{'red':0,'green':129,'blue':0},
- 'graygreen-20':{'red':206,'green':220,'blue':205},
- 'graygreen-30':{'red':185,'green':198,'blue':184},
- 'greengray-40':{'red':166,'green':178,'blue':165},
- 'green-20':{'red':225,'green':248,'blue':177},
- 'green-21':{'red':202,'green':223,'blue':159},
- 'brown-1':{'red':245,'green':219,'blue':169},
- 'brown-2':{'red':184,'green':165,'blue':126},
- 'broen-3':{'red':122,'green':109,'blue':84},
- 'mint-1':{'red':181,'green':249,'blue':215},
- 'mint-2':{'red':162,'green':224,'blue':193},
- 'steel-1':{'red':194,'green':218,'blue':217},
- 'steel-2':{'red':174,'green':196,'blue':195},
- 'steel-3':{'red':156,'green':176,'blue':175},
- 'sky-1':{'red':176,'green':218,'blue':249},
- 'sky-2':{'red':158,'green':196,'blue':224},
- 'misc-109':{'red':205,'green':202,'blue':221},
- 'misc-110':{'red':184,'green':181,'blue':198},
- 'misc-111':{'red':165,'green':162,'blue':178},
- 'misc-112':{'red':222,'green':196,'blue':251},
- 'misc-113':{'red':199,'green':176,'blue':225},
- 'misc-114':{'red':221,'green':202,'blue':221},
- 'misc-115':{'red':198,'green':181,'blue':198},
- 'misc-116':{'red':178,'green':162,'blue':178},
- 'misc-117':{'red':251,'green':235,'blue':236},
- 'misc-118':{'red':225,'green':176,'blue':212},
- 'misc-119':{'red':256,'green':151,'blue':169},
- 'dull Red':{'red':193,'green':113,'blue':126},
- 'white':{'red':256,'green':256,'blue':256},
- 'black':{'red':0,'green':0,'blue':0},
- 'blue':{'red':0,'green':0,'blue':256},
- 'red':{'red':256,'green':0,'blue':0},
- 'green':{'red':0,'green':256,'blue':0},
- 'cyan':{'red':0,'green':256,'blue':256},
- 'yellow':{'red':256,'green':256,'blue':0},
- 'purple':{'red':256,'green':0,'blue':256},
- 'gray-1':{'red':75,'green':75,'blue':75},
- 'gray-2':{'red':87,'green':87,'blue':87},
- 'gray-3':{'red':100,'green':100,'blue':100},
- 'gray-4':{'red':113,'green':113,'blue':113},
- 'gray-5':{'red':127,'green':127,'blue':127},
- 'gray-6':{'red':140,'green':140,'blue':140},
- 'gray-7':{'red':153,'green':153,'blue':153},
- 'gray-8':{'red':165,'green':165,'blue':165},
- 'gray-9':{'red':177,'green':177,'blue':177},
- 'gray-10':{'red':191,'green':191,'blue':191},
- 'gray-11':{'red':204,'green':204,'blue':204},
- 'gray-12':{'red':217,'green':217,'blue':217},
- 'gray-13':{'red':229,'green':229,'blue':229},
- 'gray-14':{'red':242,'green':242,'blue':242},
- 'red-1':{'red':96,'green':0,'blue':0},
- 'red-2':{'red':118,'green':0,'blue':0},
- 'red-3':{'red':142,'green':0,'blue':0},
- 'red-4':{'red':164,'green':0,'blue':0},
- 'red-5':{'red':187,'green':0,'blue':0},
- 'red-6':{'red':209,'green':0,'blue':0},
- 'red-7':{'red':233,'green':0,'blue':0},
- 'green-1':{'red':0,'green':96,'blue':0},
- 'green-2':{'red':0,'green':118,'blue':0},
- 'green-3':{'red':0,'green':142,'blue':0},
- 'green-4':{'red':0,'green':164,'blue':0},
- 'green-5':{'red':0,'green':187,'blue':0},
- 'green-6':{'red':0,'green':209,'blue':0},
- 'green-7':{'red':0,'green':233,'blue':0},
- 'green' :{'red':0,'green':256,'blue':0},
- 'blue-1':{'red':0,'green':0,'blue':96},
- 'blue-2':{'red':0,'green':0,'blue':148},
- 'blue-3':{'red':0,'green':0,'blue':203},
- 'yellow-1':{'red':96,'green':96,'blue':0},
- 'yellow-2':{'red':148,'green':148,'blue':0},
- 'yellow-3':{'red':203,'green':203,'blue':0},
- 'yellow':{'red':256,'green':256,'blue':0},
- 'cyan-1':{'red':0,'green':96,'blue':96},
- 'cyan-2':{'red':0,'green':148,'blue':148},
- 'cyan-3':{'red':0,'green':203,'blue':203},
- 'cyan':{'red':0,'green':256,'blue':256},
- 'purple-1':{'red':96,'green':0,'blue':96},
- 'purple-2':{'red':148,'green':0,'blue':148},
- 'purple-3':{'red':203,'green':0,'blue':203},
- 'purple':{'red':256,'green':0,'blue':256},
- 'rose-1':{'red':96,'green':82,'blue':82},
- 'rose-2':{'red':118,'green':101,'blue':101},
- 'rose-3':{'red':142,'green':122,'blue':122},
- 'rose-4':{'red':164,'green':142,'blue':142},
- 'rose-5':{'red':187,'green':160,'blue':160},
- 'rose-6':{'red':209,'green':180,'blue':180},
- 'rose-7':{'red':233,'green':201,'blue':201},
- 'rose-8':{'red':256,'green':220,'blue':220},
- 'pastel-1':{'red':82,'green':96,'blue':82},
- 'pastel-2':{'red':101,'green':118,'blue':101},
- 'pastel-3':{'red':122,'green':142,'blue':122},
- 'pastel-4':{'red':142,'green':164,'blue':142},
- 'pastel-5':{'red':160,'green':187,'blue':160},
- 'pastel-6':{'red':180,'green':209,'blue':180},
- 'pastel-7':{'red':201,'green':233,'blue':201},
- 'pastel-8':{'red':220,'green':256,'blue':220},
- 'lilac-1':{'red':82,'green':82,'blue':96},
- 'lilac-2':{'red':101,'green':101,'blue':118},
- 'lilac-3':{'red':122,'green':122,'blue':142},
- 'lilac-4':{'red':142,'green':142,'blue':164},
- 'lilac-5':{'red':160,'green':160,'blue':187},
- 'lilac-6':{'red':180,'green':180,'blue':209},
- 'lilac-7':{'red':201,'green':201,'blue':233},
- 'lilac-8':{'red':220,'green':220,'blue':256},
- 'beige-1':{'red':96,'green':96,'blue':82},
- 'beige-2':{'red':118,'green':118,'blue':101},
- 'beige-3':{'red':142,'green':142,'blue':122},
- 'beige-4':{'red':164,'green':164,'blue':142},
- 'beige-5':{'red':187,'green':187,'blue':160},
- 'beige-6':{'red':209,'green':209,'blue':180},
- 'beige-7':{'red':233,'green':233,'blue':201},
- 'beige-8':{'red':256,'green':256,'blue':220}
- }
- if color in colors:
- return colors[color]
- else:
- return None
-
-def main():
- opts = getOption()
process_file(opts)
if __name__ == "__main__":
main()
+
patch 5b07c1645d8c8343f01ba9443918dcf6034a2a3f
Author: Bernhard.Kuner@bessy.de
Date: Wed Jun 2 12:23:05 CEST 2021
* Fix opts. Implement opts by dicionary, class implementation can't work this way (bin/CreatePanel.py