File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -973,23 +973,23 @@ def populateList(self, prompt_allowed=True):
973973 elif object .is_class :
974974 type = 'local-class'
975975 else :
976- ( scheme , rest ) = urllib .parse .splittype (object .device_uri )
977- if scheme in ['ipp' , 'ipps' ]:
978- if rest . startswith ("// localhost" ): # IPP-over-USB
976+ parsed = urllib .parse .urlparse (object .device_uri )
977+ if parsed . scheme in ['ipp' , 'ipps' ]:
978+ if parsed . netloc . startswith ("localhost" ): # IPP-over-USB
979979 type = 'local-printer'
980980 else : # IPP network printer
981981 type = 'ipp-printer'
982- elif scheme == 'smb' :
982+ elif parsed . scheme == 'smb' :
983983 type = 'smb-printer'
984- elif scheme == 'hpfax' :
984+ elif parsed . scheme == 'hpfax' :
985985 type = 'local-fax'
986- elif scheme in ['socket' , 'lpd' , 'dnssd' ]:
986+ elif parsed . scheme in ['socket' , 'lpd' , 'dnssd' ]:
987987 type = 'network-printer'
988988 elif object .device_uri .startswith ('hp:/net/' ):
989989 type = 'network-printer'
990990 elif object .device_uri .startswith ('hpfax:/net/' ):
991991 type = 'network-printer'
992- elif scheme == 'implicitclass' : # cups-browsed-discovered
992+ elif parsed . scheme == 'implicitclass' : # cups-browsed-discovered
993993 type = 'discovered-printer'
994994
995995 (tip , icon ) = PRINTER_TYPE [type ]
You can’t perform that action at this time.
0 commit comments