|
9 | 9 | pypef_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) |
10 | 10 | #sys.path.append(pypef_root) |
11 | 11 | from pypef import __version__ |
12 | | -from pypef.main import run_main |
| 12 | +from pypef.main import __doc__, run_main |
13 | 13 |
|
14 | 14 |
|
15 | 15 | EXEC_API_OR_CLI = ['api', 'cli'][0] |
@@ -332,7 +332,12 @@ def selection_llm_model(self, i): |
332 | 332 | @QtCore.Slot() |
333 | 333 | def pypef_help(self): |
334 | 334 | self.version_text.setText("Getting help...") |
335 | | - self.exec_pypef(f'mklsts --help') |
| 335 | + self.textedit_out.append(__doc__) |
| 336 | + self.process.finished.connect(self.process_finished) |
| 337 | + self.c += 1 |
| 338 | + if self.c > 0: |
| 339 | + self.textedit_out.append("=" * 104 + " Job: " + str(self.c) + "\n") |
| 340 | + self.version_text.setText("Finished...") |
336 | 341 |
|
337 | 342 |
|
338 | 343 | @QtCore.Slot() |
@@ -437,8 +442,6 @@ def pypef_dca_llm_hybrid_train_test(self): |
437 | 442 | self.version_text.setText("Hybrid (DCA+LLM-supervised) model training...") |
438 | 443 | self.exec_pypef(f'hybrid --ls {training_file} --ts {test_file} --params {params_pkl_file} --llm {self.llm}') |
439 | 444 |
|
440 | | - |
441 | | - |
442 | 445 | ##### TODO END ################################################################################################# TODO END |
443 | 446 |
|
444 | 447 |
|
@@ -478,24 +481,27 @@ def exec_pypef_cli(self, cmd): |
478 | 481 | self.textedit_out.append("=" * 104 + "\n") |
479 | 482 |
|
480 | 483 | def exec_pypef_api(self, cmd): |
481 | | - self.textedit_out.append(f'Executing command:{cmd}') |
| 484 | + print(cmd) # TODO remove |
| 485 | + self.textedit_out.append(f'Executing command:\n\t{cmd}') |
| 486 | + self.c += 1 |
482 | 487 | try: |
483 | 488 | with Capturing() as captured_output: |
484 | 489 | run_main(argv=cmd) |
485 | | - print(captured_output) |
| 490 | + print(captured_output) |
486 | 491 | for cap_out_text in captured_output: |
487 | 492 | self.textedit_out.append(cap_out_text) |
488 | 493 | except Exception as e: # anything |
489 | | - self.textedit_out.append(f"Provided wrong inputs! Error: {e}") |
| 494 | + self.textedit_out.append(f"Provided wrong inputs! Error:\n\t{e}") |
490 | 495 | finally: |
491 | 496 | self.process.finished.connect(self.process_finished) |
492 | 497 | if self.c > 0: |
493 | | - self.textedit_out.append("=" * 104 + "\n") |
| 498 | + self.textedit_out.append("=" * 104 + " Job: " + str(self.c) + "\n") |
| 499 | + self.version_text.setText("Finished...") |
494 | 500 |
|
495 | 501 |
|
496 | 502 | def process_finished(self): |
497 | 503 | self.version_text.setText("Finished...") |
498 | | - #self.process = None |
| 504 | + self.process = None |
499 | 505 |
|
500 | 506 |
|
501 | 507 | if __name__ == "__main__": |
|
0 commit comments