Skip to content

Commit

Permalink
Fix small glitches
Browse files Browse the repository at this point in the history
  • Loading branch information
Ircama committed Nov 4, 2024
1 parent cff5de2 commit e1f77ea
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/document-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ assignees: ''
<!--
This repository is intended for software developers with experience managing Python programs. We will not respond to requests related to development challenges or difficulties in using the software.
Generic reports that do not reference specific wording in the README will not be addressed.
This section is only for document issues and related improvement requests (not for software). Generic reports that do not reference specific wording in the README will not be addressed.
Please do not expect immediate responses. We will review cases only when it is feasible to do so.
-->
Expand Down
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/software-bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
34 changes: 2 additions & 32 deletions epson_print_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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:
Expand Down
28 changes: 26 additions & 2 deletions ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(
Expand All @@ -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"
Expand All @@ -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,
Expand All @@ -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(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e1f77ea

Please sign in to comment.