PuristanLabs1 commited on
Commit
2f80c00
·
verified ·
1 Parent(s): fded373

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -453,17 +453,17 @@ def validate_and_fix_dot_code(dot_code):
453
 
454
  def render_dot_code(dot_code, filename=None):
455
 
456
- output_path = os.path.join(IMAGE_DIR, f"{filename}.png")
457
- try:
458
- src = Source(dot_code, format="png")
459
- #rendered_path = src.render(output_path, cleanup=True)
460
- src.render(output_path, cleanup=True)
461
- #png_path = f"{rendered_path}"
462
- #return png_path
463
- # Return the web-accessible path
464
- return f"/images/{filename}.png"
465
  except Exception as e:
466
- return f"Error rendering diagram: {str(e)}"
467
 
468
  import time
469
 
 
453
 
454
  def render_dot_code(dot_code, filename=None):
455
 
456
+ output_path = os.path.join(IMAGE_DIR, f"{filename}.png")
457
+ try:
458
+ src = Source(dot_code, format="png")
459
+ #rendered_path = src.render(output_path, cleanup=True)
460
+ src.render(output_path, cleanup=True)
461
+ #png_path = f"{rendered_path}"
462
+ #return png_path
463
+ # Return the web-accessible path
464
+ return f"/images/{filename}.png"
465
  except Exception as e:
466
+ return f"Error rendering diagram: {str(e)}"
467
 
468
  import time
469