diff --git a/.github/ISSUE_TEMPLATE/document-issues.md b/.github/ISSUE_TEMPLATE/document-issues.md index 3619848..0c381f9 100644 --- a/.github/ISSUE_TEMPLATE/document-issues.md +++ b/.github/ISSUE_TEMPLATE/document-issues.md @@ -8,7 +8,7 @@ assignees: '' diff --git a/.github/ISSUE_TEMPLATE/software-bug-report.md b/.github/ISSUE_TEMPLATE/software-bug-report.md index 1ea748d..937c86f 100644 --- a/.github/ISSUE_TEMPLATE/software-bug-report.md +++ b/.github/ISSUE_TEMPLATE/software-bug-report.md @@ -16,5 +16,8 @@ A clear and concise description of the bug, including steps to reproduce the beh This option is only for software bugs. We do not accept questions about usage clarifications or requests about printers. +**Software version** +The exact version of the tested software. + **Additional context** Feel free to add any other context about the problem here. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bea7bce..e579c86 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,9 @@ jobs: run: > echo "The *epson_print_conf.exe* executable file in the *epson_print_conf.zip* archive within the assets below is - auto-generated by a [GitHub Action](.github/workflows/build.yml)." + auto-generated by a [GitHub Action](.github/workflows/build.yml).\n\n + Check the [History of modifications] + (https://github.com/Ircama/epson_print_conf/commits/main/)." > ${{ github.workspace }}-CHANGELOG.txt - name: Create Release, uploading the epson_print_conf.zip asset @@ -50,7 +52,7 @@ jobs: body_path: ${{ github.workspace }}-CHANGELOG.txt files: dist/epson_print_conf.zip append_body: true - generate_release_notes: true + generate_release_notes: false - name: Remove old releases uses: Nats-ji/delete-old-releases@v1 diff --git a/epson_print_conf.py b/epson_print_conf.py index 25fd28b..051a0aa 100644 --- a/epson_print_conf.py +++ b/epson_print_conf.py @@ -26,7 +26,7 @@ import importlib.machinery except ImportError: pass -from pysnmp.hlapi.v1arch import * +from pysnmp.hlapi.v1arch import * # this imports UdpTransportTarget from pyasn1.type.univ import OctetString as OctetStringType from itertools import chain @@ -263,36 +263,6 @@ class EpsonPrinter: }, "serial_number": range(192, 202), }, - """ - "L3250": { - "alias": ["L3251", "L3253", "L3255"], - "read_key": [74, 54], - "write_key": b'Maribaya', - "serial_number": range(1604, 1614), - "main_waste": {"oids": [48, 49, 47], "divider": 63.45}, - "second_waste": {"oids": [50, 51, 47], "divider": 34.15}, - "third_waste": {"oids": [252, 253, 254], "divider": 13}, - "raw_waste_reset": { - 48: 0, 49: 0, 47: 0, 52: 0, 53: 0, 54: 94, 50: 0, 51: 0, - 55: 94, 28: 0, 252: 0, 253: 0, 254: 0, 255: 94 - }, - "last_printer_fatal_errors": [ - 289, 288, 291, 290, 293, 292, 295, 294, 297, 296, 1831, 1832, - 1833, 1834, 1835, 2037, 2036, 2039, 2038, 2041, 2040, 2043, - 2042, 2045, 2044], - "stats": { - "Maintenance required level of 1st waste ink counter": [54], - "Maintenance required level of 2nd waste ink counter": [55], - "Maintenance required level of 3rd waste ink counter": [255], - "Manual cleaning counter": [90], - "Timer cleaning counter": [89], - "Power cleaning counter": [91], - "Total print pass counter": [133, 132, 131, 130], - "Total print page counter": [776, 775, 774, 773], - "Total scan counter": [1843, 1842, 1841, 1840], - }, - }, - """ "ET-2400": { "alias": ["ET-2401", "ET-2403", "ET-2405"], "read_key": [74, 54], @@ -1154,7 +1124,7 @@ def snmp_mib(self, mib: str, label: str = "unknown") -> (str, Any): ) except Exception as e: logging.critical("snmp_mib invalid address: %s", e) - quit(3) + return None, False if self.timeout is not None: utt.timeout = self.timeout if self.retries is not None: diff --git a/ui.py b/ui.py index 1129cfe..a3ccaa2 100644 --- a/ui.py +++ b/ui.py @@ -892,8 +892,14 @@ def save_to_file(self): def load_from_file(self, file_type, type): # Open file dialog to select the file + self.show_status_text_view() file_path = filedialog.askopenfilename(**file_type) + self.config(cursor="watch") + self.update_idletasks() + self.update() if not file_path: + self.config(cursor="") + self.update_idletasks() self.show_status_text_view() self.status_text.insert( tk.END, @@ -905,6 +911,8 @@ def load_from_file(self, file_type, type): with open(file_path, 'rb') as pickle_file: self.conf_dict = pickle.load(pickle_file) except Exception as e: + self.config(cursor="") + self.update_idletasks() self.show_status_text_view() if not file_path.tell(): self.status_text.insert( @@ -928,6 +936,7 @@ def load_from_file(self, file_type, type): ): self.model_var.set(self.conf_dict["internal_data"]["default_model"]) else: + self.config(cursor="watch") self.status_text.insert( tk.END, f"[INFO] Converting file, please wait...\n" @@ -938,6 +947,7 @@ def load_from_file(self, file_type, type): if type == 2: printer_config = generate_config_from_toml(config=file_path) if not printer_config: + self.config(cursor="") self.show_status_text_view() self.status_text.insert( tk.END, @@ -949,6 +959,8 @@ def load_from_file(self, file_type, type): conf_dict=self.conf_dict, replace_conf=self.replace_conf ).valid_printers) + self.config(cursor="") + self.update_idletasks() if file_path: self.show_status_text_view() self.status_text.insert( @@ -1299,7 +1311,13 @@ def get_ser_number(self, cursor=True): return if not self.printer: return - ser_num = self.printer.get_serial_number() + try: + ser_num = self.printer.get_serial_number() + except Exception as e: + self.handle_printer_error(e) + self.config(cursor="") + self.update_idletasks() + return if not ser_num or "?" in ser_num: self.status_text.insert( tk.END, @@ -1332,7 +1350,13 @@ def get_mac_address(self, cursor=True): return if not self.printer: return - mac_addr = self.printer.get_wifi_mac_address() + try: + mac_addr = self.printer.get_wifi_mac_address() + except Exception as e: + self.handle_printer_error(e) + self.config(cursor="") + self.update_idletasks() + return if not mac_addr: self.status_text.insert( tk.END,