def applyFilterTypeButtonPressed(self, selectedFilterFileName, groupDescriptionFrameList, filterType): enabledGroupNames = [] for groupDescriptionFrame in groupDescriptionFrameList: if groupDescriptionFrame.isEnabled(): enabledGroupNames.append(groupDescriptionFrame.groupName) jsonHelper.removeFilterTypeFromJSONForFilterType(selectedFilterFileName, filterType) jsonHelper.addFilterTypeToJSON(selectedFilterFileName, enabledGroupNames, filterType) self.parent.destroy()
def applyFilterTypeButtonPressed(self, filePath, groupDescriptionFrameList, filterType): components = filePath.split('/') fileName = components[-1] groupNameList = [] for groupDescriptionFrame in groupDescriptionFrameList: if groupDescriptionFrame.isEnabled(): groupNameList.append(groupDescriptionFrame.groupName) jsonHelper.addFilterTypeToJSON(fileName,groupNameList,filterType) if filterType == 'Head': subprocess.call('cp \"'+filePath+'\" ./filterTypesConfig/headFilters/', shell=True) else: subprocess.call('cp \"'+filePath+'\" ./filterTypesConfig/jawFilters/', shell=True) self.parent.destroy()