Accept relative paths in the IdeHandler API's "filename" key

This commit is contained in:
Kristóf Tóth 2019-09-04 15:13:40 +02:00
parent 66c9c5a592
commit 620212f00f

View File

@ -76,7 +76,9 @@ class IdeHandler:
if 'patterns' in message: if 'patterns' in message:
self.filemanager.patterns = message['patterns'] self.filemanager.patterns = message['patterns']
try: try:
message['filename'] = message.get('filename') or self.initial_file message['filename'] = self.filemanager.find_file(
message.get('filename') or self.initial_file
)
message['content'] = self.filemanager.read_file(message['filename']) message['content'] = self.filemanager.read_file(message['filename'])
except (PermissionError, ValueError): except (PermissionError, ValueError):
message['content'] = 'You have no permission to open that file :(' message['content'] = 'You have no permission to open that file :('