Get the resource path
(relative_path, persistent=False)
| 587 | |
| 588 | |
| 589 | def resource_path(relative_path, persistent=False): |
| 590 | """ |
| 591 | Get the resource path |
| 592 | """ |
| 593 | base_path = os.path.abspath(".") |
| 594 | total_path = os.path.join(base_path, relative_path) |
| 595 | if persistent or os.path.exists(total_path): |
| 596 | return total_path |
| 597 | else: |
| 598 | try: |
| 599 | base_path = sys._MEIPASS |
| 600 | return os.path.join(base_path, relative_path) |
| 601 | except Exception: |
| 602 | return total_path |
| 603 | |
| 604 | |
| 605 | def write_content_into_txt(content, path=None, position=None, callback=None): |
no outgoing calls
no test coverage detected