|
7 | 7 | import signal
|
8 | 8 | import sys
|
9 | 9 | from datetime import datetime
|
| 10 | +from typing import List |
| 11 | + |
10 | 12 | import pandas
|
11 | 13 | import starlette.status
|
12 | 14 | from pandas import DataFrame
|
@@ -627,7 +629,12 @@ def process_file(
|
627 | 629 | self.logging.log("Success!")
|
628 | 630 | self.interval_multiplication(filename, photo)
|
629 | 631 | self.save_index()
|
630 |
| - self.convert_file(filename, photo) |
| 632 | + if bool(self.config.getint("convert")): |
| 633 | + self.convert_file(filename, photo) |
| 634 | + else: |
| 635 | + self.logging.log( |
| 636 | + "Conversion disabled in config by 'config' flag! Make sure your photos are pre-converted!" |
| 637 | + ) |
631 | 638 |
|
632 | 639 | def save_index(self):
|
633 | 640 | # save index of current photo for next run
|
@@ -662,13 +669,9 @@ def save_pid(self):
|
662 | 669 | raise
|
663 | 670 |
|
664 | 671 | def check_system(self):
|
665 |
| - if ( |
666 |
| - not self.check_arguments("--test") |
667 |
| - and not self.check_arguments("--test-convert") |
668 |
| - and not self.check_arguments("--convert") |
669 |
| - and not self.check_arguments("--no-skip") |
670 |
| - and not DisplayManager.is_hdmi(self.config.get("display_type")) |
671 |
| - ): |
| 672 | + if not self.check_multiple_arguments( |
| 673 | + ["--test", "--test-convert", "--convert", "--no-skip"] |
| 674 | + ) and not DisplayManager.is_hdmi(self.config.get("display_type")): |
672 | 675 | self.process_check_system()
|
673 | 676 |
|
674 | 677 | def process_check_system(self):
|
@@ -734,6 +737,13 @@ def show_help(self):
|
734 | 737 |
|
735 | 738 | sys.exit(0)
|
736 | 739 |
|
| 740 | + @staticmethod |
| 741 | + def check_multiple_arguments(names: List[str]) -> bool: |
| 742 | + return_value = False |
| 743 | + for name in names: |
| 744 | + return_value = return_value or EPiframe.check_arguments(name) |
| 745 | + return return_value |
| 746 | + |
737 | 747 | @staticmethod
|
738 | 748 | def check_arguments(name: str) -> bool:
|
739 | 749 | return name in [argument.lower() for argument in sys.argv]
|
|
0 commit comments