ALT Linux Bugzilla
– Attachment 7571 Details for
Bug 34945
При поиске сетевого принтера по IP вываливается длинный список одинаковых IP-шников
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
exiting after successful found port
fix_34945.patch (text/plain), 2.51 KB, created by
Andrey
on 2018-06-01 11:10:00 MSK
(
hide
)
Description:
exiting after successful found port
Filename:
MIME Type:
Creator:
Andrey
Created:
2018-06-01 11:10:00 MSK
Size:
2.51 KB
patch
obsolete
>--- probe_printer.py 2018-05-31 17:53:31.955171246 +0300 >+++ new_probe_printer.py 2018-06-01 08:58:02.514150871 +0300 >@@ -126,40 +126,37 @@ > self.max_lpt_com = 8 > self.stop = False > >- def probe_queue(self,name, result): >+ def probe_queue(self, name, result): > s = open_socket(self.hostname, 515) > if not s: > return None > print(name) >- >+ > try: >- s.send(('\2%s\n' % name).encode('UTF-8')) # cmd send job to queue >- data = s.recv(1024).decode('UTF-8') # receive status >+ s.send(('\2%s\n' % name).encode('UTF-8')) # cmd send job to queue >+ data = s.recv(1024).decode('UTF-8') # receive status > print(repr(data)) > except socket.error as msg: > print(msg) > try: >- s.close () >+ s.close() > except: > pass >- > return False > >- if len(data)>0 and ord(data[0])==0: >+ if len(data) > 0 & ord(data[0]) == 0: >+ result.append(name) > try: >- s.send(b'\1\n') # abort job again >- s.close () >+ s.send(b'\1\n') # abort job again >+ s.close() > except: > pass >- >- result.append(name) >- return True >+ return > > try: > s.close() > except: > pass >- > return False > > def get_possible_queue_names (self): >@@ -241,23 +238,24 @@ > > def _do_find (self): > self._cached_attributes = dict() >- for fn in [self._probe_hplip, >- self._probe_jetdirect, >- self._probe_ipp, >- self._probe_snmp, >- self._probe_lpd, >- self._probe_smb]: >+ fn_list = [self._probe_hplip, >+ self._probe_jetdirect, >+ self._probe_ipp, >+ self._probe_snmp, >+ self._probe_lpd, >+ self._probe_smb] >+ >+ for fn in fn_list: > if self.quit: > return >- > try: >- fn () >+ fn() > except Exception: >- nonfatalException () >+ nonfatalException() > > # Signal that we've finished. > if not self.quit: >- self.callback_fn (None) >+ self.callback_fn(None) > > def _new_device (self, uri, info, location = None): > device_dict = { 'device-class': 'network',
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 34945
:
7556
|
7557
| 7571