diff --git a/gestalt/Type.py b/gestalt/Type.py index 69750e3..dc46e2c 100644 --- a/gestalt/Type.py +++ b/gestalt/Type.py @@ -50,7 +50,7 @@ def copy(self): def val(self): if self.standard: output = self.value - + for macrolist in reversed(self.macros): try: output = output.format(**macrolist) @@ -66,7 +66,6 @@ def val(self): if key in self.updates: output[key] = self.updates[key] continue - for macrolist in reversed(self.macros): try: @@ -76,7 +75,6 @@ def val(self): return output - elif self.list: output = copy.deepcopy(self.value) @@ -85,11 +83,15 @@ def val(self): output[index] = self.updates[index] continue - for macrolist in reversed(self.macros): - try: - output[index] = str(output[index]).format(**macrolist) - except: - pass + index_val = DataType("temp", output[index]) + + for macrolist in self.macros: + index_val.apply(macrolist) + + try: + output[index] = str(index_val).val() + except: + pass return output @@ -220,6 +222,10 @@ def val(self): def __getitem__(self, key): return int(self.val()[key]) + + def __repr__(self): + data = self.val() + return "{x}x{y}x{width}x{height}".format(**data) ####################### @@ -353,7 +359,6 @@ class List(DataType): def __init__(self, data): super().__init__("list", data) - def val(self): output = [] data = super().val() diff --git a/gestalt/convert/phoebus/CSSGenerator.py b/gestalt/convert/phoebus/CSSGenerator.py index bdeb751..7ae2fce 100644 --- a/gestalt/convert/phoebus/CSSGenerator.py +++ b/gestalt/convert/phoebus/CSSGenerator.py @@ -185,7 +185,10 @@ def generatePolygon(self, node, macros={}): output.link("line", "border-color") output.link("line_width", "border-width") - for point in node.points: + my_points = List(node.points) + my_points.apply(macros) + + for point in my_points: a_point = Rect(point) a_point.apply(macros) @@ -200,7 +203,10 @@ def generatePolyline(self, node, macros={}): output.link("line", "border-color") output.link("line_width", "border-width") - for point in node.points: + my_points = List(node.points) + my_points.apply(macros) + + for point in my_points: a_point = Rect(point) a_point.apply(macros) diff --git a/gestalt/convert/qt/QtGenerator.py b/gestalt/convert/qt/QtGenerator.py index c34a937..a8b07d0 100644 --- a/gestalt/convert/qt/QtGenerator.py +++ b/gestalt/convert/qt/QtGenerator.py @@ -171,7 +171,10 @@ def generatePolygon(self, node, macros={}): xy_pairs = "" - for point in node.points: + my_points = List(node.points) + my_points.apply(macros) + + for point in my_points: a_point = Rect(point) a_point.apply(macros) @@ -193,10 +196,10 @@ def generatePolyline(self, node, macros={}): xy_pairs = "" - #my_points = List(node.points) - #my_points.apply(macros) + my_points = List(node.points) + my_points.apply(macros) - for point in node.points: + for point in my_points: a_point = Rect(point) a_point.apply(macros)