def getNetworkShares(self, hostip, hostname, devicetype): sharelist = [] self.sharecache_file = None self.sharecache_file = '/etc/enigma2/' + hostname.strip( ) + '.cache' #Path to cache directory username = '******' password = '******' try: hostdata = load_cache(self.sharecache_file) username = hostdata['username'] password = hostdata['password'] except: pass if devicetype == 'unix': smblist = netscan.smbShare(hostip, hostname, username, password) for x in smblist: if len(x) == 6: if x[3] != 'IPC$': sharelist.append(x) nfslist = netscan.nfsShare(hostip, hostname) for x in nfslist: if len(x) == 6: sharelist.append(x) else: smblist = netscan.smbShare(hostip, hostname, username, password) for x in smblist: if len(x) == 6: if x[3] != 'IPC$': sharelist.append(x) return sharelist
def getNetworkShares(self,hostip,hostname,devicetype): sharelist = [] self.sharecache_file = None self.sharecache_file = '/etc/enigma2/' + hostname.strip() + '.cache' #Path to cache directory if os_path.exists(self.sharecache_file): print '[Networkbrowser] Loading userinfo from ',self.sharecache_file try: self.hostdata = load_cache(self.sharecache_file) username = self.hostdata['username'] password = self.hostdata['password'] except: username = "******" password = "******" else: username = "******" password = "******" if devicetype == 'unix': smblist=netscan.smbShare(hostip,hostname,username,password) for x in smblist: if len(x) == 6: if x[3] != 'IPC$': sharelist.append(x) nfslist=netscan.nfsShare(hostip,hostname) for x in nfslist: if len(x) == 6: sharelist.append(x) else: smblist=netscan.smbShare(hostip,hostname,username,password) for x in smblist: if len(x) == 6: if x[3] != 'IPC$': sharelist.append(x) return sharelist
def getNetworkShares(self,hostip,hostname,devicetype): sharelist = [] self.sharecache_file = None self.sharecache_file = eEnv.resolve("${sysconfdir}/enigma2/") + hostname.strip() + '.cache' #Path to cache directory username = "******" password = "" if os_path.exists(self.sharecache_file): print '[Networkbrowser] Loading userinfo from ',self.sharecache_file try: self.hostdata = load_cache(self.sharecache_file) username = self.hostdata['username'] password = self.hostdata['password'] except: pass smblist = netscan.smbShare(hostip, hostname, username, password) for x in smblist: if len(x) == 6: if x[4] == "Disk" and not x[3].endswith('$'): sharelist.append(x) if devicetype == 'unix': nfslist = netscan.nfsShare(hostip, hostname) for x in nfslist: if len(x) == 6: sharelist.append(x) return sharelist