Skip to content

Commit eb21bb7

Browse files
committed
add windows compatibility
1 parent 15b18fb commit eb21bb7

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

plain2code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def render(args, run_state: RunState, event_bus: EventBus): # noqa: C901
177177
enter_pause_event = threading.Event()
178178
signal.signal(signal.SIGTERM, lambda _signum, _frame: stop_event.set())
179179

180-
module_name = args.filename.split("/")[-1]
180+
module_name = os.path.basename(args.filename)
181181

182182
plain_module = plain_modules.PlainModule(
183183
module_name,

plain2code_console.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
import os
23

34
from rich.console import Console
45
from rich.style import Style
@@ -85,7 +86,7 @@ def _create_tree_from_files(self, root_folder, files):
8586
"""
8687
tree = Tree(root_folder)
8788
for path, content in files.items():
88-
parts = path.split("/")
89+
parts = path.split(os.sep)
8990
current_level = tree
9091
for part in parts:
9192
existing_level = None

0 commit comments

Comments
 (0)