Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
while smbc_auth.perform_authentication () > 0:
try:
entries = ctx.opendir ("smb://").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 ()
store.clear ()
if entries:
for entry in entries:
if entry.smbc_type in [pysmb.smbc.WORKGROUP,
pysmb.smbc.SERVER]:
iter = store.append (None, [entry])
i = store.append (iter)
specified_uri = SMBURI (uri=self.entSMBURI.get_text ())
(group, host, share, user, password) = specified_uri.separate ()
if len (host) > 0:
# The user has specified a server before clicking Browse.
# Append the server as a top-level entry.
class FakeEntry:
pass
toplevel = FakeEntry ()
toplevel.smbc_type = pysmb.smbc.SERVER
toplevel.name = host
toplevel.comment = ''
iter = store.append (None, [toplevel])
i = store.append (iter)
if entries:
for entry in entries:
if entry.smbc_type in [pysmb.smbc.WORKGROUP,
pysmb.smbc.SERVER]:
iter = store.append (None, [entry])
i = store.append (iter)
specified_uri = SMBURI (uri=self.entSMBURI.get_text ())
(group, host, share, user, password) = specified_uri.separate ()
if len (host) > 0:
# The user has specified a server before clicking Browse.
# Append the server as a top-level entry.
class FakeEntry:
pass
toplevel = FakeEntry ()
toplevel.smbc_type = pysmb.smbc.SERVER
toplevel.name = host
toplevel.comment = ''
iter = store.append (None, [toplevel])
i = store.append (iter)
# Now expand it.
path = store.get_path (iter)
self.tvSMBBrowser.expand_row (path, 0)
ready(self.SMBBrowseDialog)
if store.get_iter_first () == None:
self.SMBBrowseDialog.hide ()
show_info_dialog (_("No Print Shares"),
_("There were no print shares found. "
"Please check that the Samba service is "