MCPcopy
hub / github.com/evilsocket/opensnitch / _compile

Method _compile

ui/opensnitch/plugins/highlight/highlight.py:137–162  ·  view source on GitHub ↗
(self, what)

Source from the content-addressed store, hash-verified

135 pass
136
137 def _compile(self, what):
138 cell_list = self._config.get(what)
139 if cell_list == None:
140 print("highlight plugin: configuration has no '{0}' configuration".format(what))
141 return
142 for cell in cell_list:
143 for item in cell:
144 # colors
145 if (item == Highlight.COLOR or item == Highlight.BGCOLOR):
146 if cell[item] != "" and cell[item] is not None:
147 try:
148 cell[item] = QColor(cell[item])
149 except Exception as e:
150 cell[item] = None
151 else:
152 cell[item] = None
153
154 # alignments
155 if item == Highlight.ALIGNMENT:
156 cell[item] = self.getAlignment(cell[item])
157
158 # TODO: fonts
159 #if item == Highlight.FONT:
160 # cell[item] = self.getFont(cell[item])
161
162 return self._config
163
164 def compile(self):
165 """transform json items to Qt objects.

Callers 1

compileMethod · 0.95

Calls 2

getAlignmentMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected