''' Directory for users to compare refList folders to '''
jobList = os.listdir("/u/ykt/Desktop/test/testItemA")
# ['test01', 'test02', 'test03', 'test04', 'test05']
''' Directory that users access and compare it to jobList folders '''
refList = os.listdir("/user_data/testItemEx")
#['test01', 'test02', 'test03', 'format01', 'format02.py', 'test.py']
refItems = []
for item in jobList:
if item in refList:
refItems.append(item)
# Output in refList: ['test01', 'test02', 'test03']
# Output in jobList: ['test01', 'test02', 'test03', 'test04', 'test05']
''' Adding the items into the listWidgets '''
self.jobItemList.addItems(jobList)
self.refItemList.addItems(refItems)
''' So that there can only be one selection between the 2 Lists '''
self.itemsDict = {}
self.itemsDict[self.refItemList] = self.jobItemList
self.itemsDict[self.jobItemList] = self.refItemList
self.refItemList.clicked.connect(self.listSelect)
self.jobItemList.clicked.connect(self.listSelect)
def listSelect(self):
self.shotsDict[self.sender()].clearSelection()
''' Directory for users to compare refList folders to '''
jobList = os.listdir("/u/ykt/Desktop/test/testItemA")
# ['test01', 'test02', 'test03', 'test04', 'test05']
''' Directory that users access and compare it to jobList folders '''
refList = os.listdir("/user_data/testItemEx")
#['test01', 'test02', 'test03', 'format01', 'format02.py', 'test.py']
refItems = []
for item in jobList:
if item in refList:
refItems.append(item)
# Output in refList: ['test01', 'test02', 'test03']
# Output in jobList: ['test01', 'test02', 'test03', 'test04', 'test05']
''' Adding the items into the listWidgets '''
self.jobItemList.addItems(jobList)
self.refItemList.addItems(refItems)
''' So that there can only be one selection between the 2 Lists '''
self.itemsDict = {}
self.itemsDict[self.refItemList] = self.jobItemList
self.itemsDict[self.jobItemList] = self.refItemList
self.refItemList.clicked.connect(self.listSelect)
self.jobItemList.clicked.connect(self.listSelect)
def listSelect(self):
self.shotsDict[self.sender()].clearSelection()
To copy to clipboard, switch view to plain text mode
Bookmarks