Skip to content

Commit 24f350a

Browse files
authored
Fix file_operations instatiation (#256)
* Fix file_operations instatiation * lint
1 parent 3be6f5d commit 24f350a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Commands.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ def execute_command(self, command_name: str, command_args: dict = None):
116116
params[name] = value
117117

118118
try:
119-
output = command_function(**params)
119+
if module.__name__ == "file_operations":
120+
output = command_function(**params)
121+
else:
122+
output = command_function(module, **params)
120123
except Exception as e:
121124
output = f"Error: {str(e)}"
122125

commands/file_operations.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ def safe_join(base: str, paths) -> str:
5050
new_path = os.path.normpath(os.path.join("/", *paths))
5151
return new_path
5252

53+
@staticmethod
5354
def split_file(
54-
self, content: str, max_length: int = 4000, overlap: int = 0
55+
content: str, max_length: int = 4000, overlap: int = 0
5556
) -> Generator[str, None, None]:
5657
start = 0
5758
content_length = len(content)

0 commit comments

Comments
 (0)