mirror of
https://github.com/Ircama/epson_print_conf.git
synced 2025-06-04 16:54:09 -04:00
UI refinements
This commit is contained in:
parent
eac2b41375
commit
6c5a631d97
4 changed files with 151 additions and 26 deletions
|
@ -53,12 +53,14 @@ class PrinterScanner:
|
|||
return {"ip": ip, "hostname": hostname, "name": "Unknown"}
|
||||
return None
|
||||
|
||||
def get_all_printers(self, ip_addr=""):
|
||||
def get_all_printers(self, ip_addr="", local=False):
|
||||
if ip_addr:
|
||||
result = self.scan_ip(ip_addr)
|
||||
if result:
|
||||
return [result]
|
||||
local_device_ip_list = socket.gethostbyname_ex(socket.gethostname())[2]
|
||||
if local:
|
||||
return local_device_ip_list
|
||||
printers = []
|
||||
for local_device_ip in local_device_ip_list:
|
||||
if ip_addr and not local_device_ip.startswith(ip_addr):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue