(self, *, edited=False)
| 522 | return None |
| 523 | |
| 524 | def loadFile(self, *, edited=False): |
| 525 | # make *edited* keyword-only so it is not confused for extra arguments |
| 526 | # sent by ui signals |
| 527 | qtLib = self.ui.qtLibCombo.currentText() |
| 528 | env = dict(os.environ, PYQTGRAPH_QT_LIB=qtLib) |
| 529 | example_path = os.path.abspath(os.path.dirname(__file__)) |
| 530 | path = os.path.dirname(os.path.dirname(example_path)) |
| 531 | env['PYTHONPATH'] = f'{path}' |
| 532 | if edited: |
| 533 | proc = subprocess.Popen([sys.executable, '-'], stdin=subprocess.PIPE, cwd=example_path, env=env) |
| 534 | code = self.ui.codeView.toPlainText().encode('UTF-8') |
| 535 | proc.stdin.write(code) |
| 536 | proc.stdin.close() |
| 537 | else: |
| 538 | fn = self.currentFile() |
| 539 | if fn is None: |
| 540 | return |
| 541 | subprocess.Popen([sys.executable, fn], cwd=path, env=env) |
| 542 | |
| 543 | def showFile(self): |
| 544 | fn = self.currentFile() |
no test coverage detected