We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c8c97d commit aa9290eCopy full SHA for aa9290e
tests/scrape_images.py
@@ -1,3 +1,4 @@
1
+import os
2
import re
3
4
from statemachine.contrib.diagram import DotGraphMachine
@@ -13,8 +14,8 @@ class MachineScraper:
13
14
15
def __init__(self, project_root):
16
self.project_root = project_root
- sanitized_path = self.project_root.replace("\\", "\\\\")
17
- self.re_machine_module_name = re.compile(f"{sanitized_path}/(.*).py$")
+ sanitized_path = re.escape(os.path.abspath(self.project_root))
18
+ self.re_machine_module_name = re.compile(f"{sanitized_path}[\\/](.*)\\.py$")
19
self.seen = set()
20
21
def __repr__(self):
0 commit comments