Browse Source

fixing some script value conversion

johann 5 years ago
parent
commit
c522e9382d
3 changed files with 6 additions and 3 deletions
  1. 1 1
      scripts/lazpaint/command.py
  2. 3 0
      scripts/lazpaint/filters.py
  3. 2 2
      scripts/lazpaint/layer.py

+ 1 - 1
scripts/lazpaint/command.py

@@ -18,7 +18,7 @@ def send(command: str, **keywords):
   if keywords is None:
     print(chr(27) + command)
   else:
-    print(chr(27) + command + chr(29) + str(keywords))
+    print(chr(27) + command + chr(29) + repr(keywords))
   if command[-1] == '?':
     return parse_str(input(''))
   else:

+ 3 - 0
scripts/lazpaint/filters.py

@@ -84,6 +84,9 @@ def blur(name=BLUR_FAST, radius=None, validate=True): #radius: float or (x,y)
     radius_x = radius[0]
     radius_y = radius[1]
     radius = None
+  else:
+    radius_x = None
+    radius_y = None
   command.send("Filter", Name=name, Radius=radius, RadiusX=radius_x, RadiusY=radius_y, Validate=validate)
 
 def blur_motion(distance=None, angle=None, oriented=None, validate=True): #oriented: bool

+ 2 - 2
scripts/lazpaint/layer.py

@@ -98,8 +98,8 @@ def get_registry(identifier):
 def set_registry(identifier, value):
   if value == None:
     value = ""
-  else:
-    value = str(value)
+  elif isinstance(value, str):
+    value = repr(value)
   command.send("LayerSetRegistry", Identifier=identifier, Value=value)
 
 def remove():