Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
entries = ctx.opendir (uri).getdents ()
except Exception, e:
smbc_auth.failed (e)
except RuntimeError, (e, s):
if e != errno.ENOENT:
debugprint ("Runtime error: %s" % repr ((e, s)))
except:
nonfatalException()
while model.iter_has_child (iter):
i = model.iter_nth_child (iter, 0)
model.remove (i)
for entry in entries:
if entry.smbc_type in [pysmb.smbc.SERVER,
pysmb.smbc.PRINTER_SHARE]:
i = model.append (iter, [entry])
if entry.smbc_type == pysmb.smbc.SERVER:
n = model.append (i)
view.expand_row (path, 0)
del self.expanding_row
ready (self.SMBBrowseDialog)
elif entry.smbc_type == pysmb.smbc.SERVER:
# Server
try:
if self.expanding_row:
return
except:
self.expanding_row = 1
def browse_smb_hosts(self):
"""Initialise the SMB tree store."""
store = self.smb_store
store.clear ()
busy(self.SMBBrowseDialog)
class X:
pass
dummy = X()
dummy.smbc_type = pysmb.smbc.PRINTER_SHARE
dummy.name = _('Scanning...')
dummy.comment = ''
store.append(None, [dummy])
while gtk.events_pending ():
gtk.main_iteration ()
debug = 0
if get_debugging ():
debug = 10
smbc_auth = pysmb.AuthContext (self.SMBBrowseDialog)
ctx = pysmb.smbc.Context (debug=debug,
auth_fn=smbc_auth.callback)
entries = None
try:
while smbc_auth.perform_authentication () > 0:
try: