本文整理匯總了Python中GUI.returnAllList方法的典型用法代碼示例。如果您正苦於以下問題:Python GUI.returnAllList方法的具體用法?Python GUI.returnAllList怎麽用?Python GUI.returnAllList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GUI
的用法示例。
在下文中一共展示了GUI.returnAllList方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: updateSetting
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import returnAllList [as 別名]
def updateSetting(self):
self.printIf("updateSetting: updateSetting started...")
try:
f = open("./.set", "w")
if self.ui.groupBox_3.isChecked():
aa = True
else:
aa = False
interv = self.ui.spinBox.value()
f.write("aa=%s|%s\n" %(aa, interv))
for i in GUI.returnAllList(self, self.ui.listWidget_2):
f.write("rp=%s\n" %(i))
for i in GUI.returnAllList(self, self.ui.listWidget):
f.write("lp=%s\n" %(i))
self.printIf("updateSetting: updateSetting successfully done...")
f.close()
except:
self.printIf("updateSetting: someting went wrong...")
示例2: getLists
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import returnAllList [as 別名]
def getLists(self):
it = -1
self.lst = []
for i in GUI.returnAllList(self, self.ui.listWidget):
it = it + 1
self.tab = QtGui.QWidget()
self.tab.setObjectName(("tab%s") %(it))
lDirPath, isRes = i.split("|")
lPath, lDir = self.pathName(lDirPath)
self.ui.tabWidget_2.addTab(self.tab, ("%s" %(lDir)))
self.gridLayout = QtGui.QGridLayout(self.tab)
self.lst.append(QtGui.QListWidget(self.tab))
self.lst[it].setObjectName(("listWidget%s" %(it)))
self.gridLayout.setObjectName("gridLayout")
self.gridLayout.addWidget(self.lst[it], 0, 0, 1, 1)
if isRes == "False":
lFiles = glob.glob("%s/*.h5" %(lDirPath))
for u in lFiles:
if self.isH5(u):
GUI.add2List(self, u, self.lst[it])
elif isRes == "True":
for u in self.listFiles(lDirPath):
if self.isH5(u):
GUI.add2List(self, u, self.lst[it])
self.lst[it].sortItems(1)
for k in GUI.returnAllList(self, self.ui.listWidget_2):
user, passwd = k.split("@")[0].split("|")
ip, rDirPath, isRes = k.split("@")[1].split("|")
if self.ftp(ip, user, passwd, rDirPath) == True:
it = it + 1
self.tab = QtGui.QWidget()
self.tab.setObjectName(("tab%s") %(it))
rPath, rDir = self.pathName(rDirPath)
self.ui.tabWidget_2.addTab(self.tab, ("FTP(%s)" %(rDir)))
self.gridLayout = QtGui.QGridLayout(self.tab)
self.lst.append(QtGui.QListWidget(self.tab))
self.lst[it].setObjectName(("listWidget%s" %(it)))
self.gridLayout.setObjectName("gridLayout")
self.gridLayout.addWidget(self.lst[it], 0, 0, 1, 1)
ftp = FTP(ip)
ftp.login(user, passwd)
self.lst[it].sortItems(1)
ftp.cwd(rDirPath)
data = []
dire = []
files = []
ftp.dir(data.append)
for i in data:
if i.startswith("-"):
files.append(i.split()[len(i.split())-1])
if i.startswith("d"):
dire.append(i.split()[len(i.split())-1])
if isRes == "False":
for u in files:
if u.endswith("h5"):
ln = "%s|%[email protected]%s|%s/%s" %(user, passwd, ip, rDirPath, u)
GUI.add2List(self, ln, self.lst[it])
elif isRes == "True":
for u in files:
if u.endswith("h5"):
ln = "%s|%[email protected]%s|%s/%s" %(user, passwd, ip, rDirPath, u)
GUI.add2List(self, ln, self.lst[it])
for u in dire:
subData = []
ftp.cwd("%s/%s" %(rDirPath, u))
ftp.dir(subData.append)
for l in subData:
if l.endswith("h5"):
ll = l.split()[len(l.split())-1]
ln = "%s|%[email protected]%s|%s/%s/%s" %(user, passwd, ip, rDirPath, u, ll)
GUI.add2List(self, ln, self.lst[it])
elif self.ftp(ip, user, passwd, remPath) == False:
self.printIf("Connection Failed.\nCheck the server, user name and password or your connection")
elif self.ftp(ip, user, passwd, remPath) == None:
self.printIf("Check remote directory")
for i in self.lst:
self.addDisplay(i)
i.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection)
if self.ui.tabWidget_2.count() > 0:
self.ui.pushButton_6.setEnabled(True)
else:
self.ui.pushButton_6.setEnabled(False)