Skip to content

Commit 8209925

Browse files
committed
Open folder func
1 parent 90d2a89 commit 8209925

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

pw_multiScriptEditor/scriptEditor.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def openSettingsFile(self):
345345
self.out.showMessage('>>> Settings folder: %s' % path.replace('\\','/'))
346346

347347
if os.path.exists(path):
348-
os.startfile(path)
348+
self.openFolder(path)
349349
else:
350350
self.out.showMessage('>>> Not created!')
351351

@@ -391,6 +391,14 @@ def findWidget(self):
391391
w.show()
392392
w.activateWindow()
393393

394+
def openFolder(self, path):
395+
if os.name == 'nt':
396+
os.startfile(path)
397+
elif os.name == 'posix':
398+
os.system('xdg-open "%s"' % path)
399+
elif os.name =='os2':
400+
os.system('open "%s"' % path)
401+
394402
QTextCodec.setCodecForCStrings(QTextCodec.codecForName("UTF-8"))
395403

396404
if __name__ == '__main__':

0 commit comments

Comments
 (0)