]> git.cworth.org Git - zombocom-ai/blobdiff - interpret-cairo-to-svg.py
Drop unneeded semicolons from python code
[zombocom-ai] / interpret-cairo-to-svg.py
index de296f5288d02a3d538a63fd06235ff772fc6538..bc0c6b1053ab8eaf406ea95f5c55d7f33a534bf3 100755 (executable)
@@ -24,7 +24,7 @@ if "import" in input:
 
 (fd, filename) = tempfile.mkstemp(suffix=".svg", prefix="busart", dir=OUTPUT_DIR);
 os.close(fd)
-os.chmod(filename, 0o644);
+os.chmod(filename, 0o644)
 
 # Also delete our import for some more safety
 del tempfile
@@ -789,33 +789,33 @@ COLORS = {
     'yellow3': (0xcd/0xff, 0xcd/0xff, 0x00/0xff),
     'yellow4': (0x8b/0xff, 0x8b/0xff, 0x00/0xff),
     'yellowgreen': (0x9a/0xff, 0xcd/0xff, 0x32/0xff)
-};
+}
 
 with cairo.SVGSurface(filename, 512, 512) as surface:
     cr = cairo.Context(surface);
     del cairo
 
     def arc(x, y, r, a1, a2):
-        cr.arc(x, y, r, a1, a2);
+        cr.arc(x, y, r, a1, a2)
 
     def circle(x, y, r):
-        cr.arc(x, y, r, 0, 2 * math.pi);
+        cr.arc(x, y, r, 0, 2 * math.pi)
 
     def fill():
-        cr.fill();
+        cr.fill()
 
     def set_color(color):
         if color in COLORS:
-            (r,g,b) = COLORS[color];
+            (r,g,b) = COLORS[color]
         else:
             (r,g,b) = (0,0,0)
         cr.set_source_rgb(r, g, b)
 
-    cr.set_line_width(6);
-    exec(input)
-
-web_file = filename.removeprefix(OUTPUT_DIR_PREFIX);
+    cr.set_line_width(6)
 
-print(web_file);
+    # Run the submitted code
+    exec(input)
 
+web_file = filename.removeprefix(OUTPUT_DIR_PREFIX)
 
+print(web_file)