def on_lEditTagSearch_textChanged(self): startdate = self.dEditStart.date().toPyDate() enddate = self.dEditEnd.date().toPyDate() if ( len(str(self.lEditTagSearch.text())) > 3 ): #only performs type and search if search terms are longer than 3 characters if ((enddate - startdate).days > 0 and (enddate - startdate).days < GlobalVar.DATESEARCHTOLERANCE ): #If the time interval qualifies the conditions Keywords = str(self.lEditTagSearch.text()).split() GlobalVar.TagSearchResultPaths = ImageManagementUtil.SearchTags( GlobalVar.AllPhotoPaths, Keywords, startdate, enddate) self.lWidgetTagSearchResults.clear() self.lWidgetTagSearchResults.addItems( ImageManagementUtil.parseDirectories( GlobalVar.TagSearchResultPaths)) else: #if it does not meet conditions Keywords = str(self.lEditTagSearch.text()).split() GlobalVar.TagSearchResultPaths = ImageManagementUtil.SearchTags( GlobalVar.AllPhotoPaths, Keywords, 0, 0) self.lWidgetTagSearchResults.clear() self.lWidgetTagSearchResults.addItems( ImageManagementUtil.parseDirectories( GlobalVar.TagSearchResultPaths)) else: if ((enddate - startdate).days < 0 or (enddate - startdate).days > GlobalVar.DATESEARCHTOLERANCE ): #only clear if does not meet date conditions self.lWidgetTagSearchResults.clear() GlobalVar.TagSearchResultPaths = []
def on_lEditEventPicker_textChanged(self): keyword = self.lEditEventPicker.text() ResultEventPaths = ImageManagementUtil.Search(GlobalVar.EventPaths, keyword) self.lWidgetEvent.clear() self.lWidgetEvent.addItems( ImageManagementUtil.parseDirectories(ResultEventPaths))
def on_btnRefreshEvents_released(self): self.lWidgetEvent.clear() GlobalVar.EventPaths = ImageManagementUtil.loadAllInDirectory( GlobalVar.EventDirectory) GlobalVar.EventNames = ImageManagementUtil.parseDirectories( GlobalVar.EventPaths) self.lWidgetEvent.addItems(GlobalVar.EventNames)
def on_btnBrowse_released(self): self.lWidgetPhotoPath.clear() l = QListWidget() GlobalVar.ImagePaths = QtGui.QFileDialog.getOpenFileNames(QFileDialog(), 'Open file', GlobalVar.SourceDirectory) self.lWidgetPhotoPath.addItems(ImageManagementUtil.parseDirectories(GlobalVar.ImagePaths)) self.lblNumberSelected.setText(str(len(GlobalVar.ImagePaths)) + " Selected") GlobalVar.PhotoSelected = True if(GlobalVar.EventSelected == True and GlobalVar.PhotographerNameEntered == True and GlobalVar.PhotoSelected == True): self.btnUpload.setEnabled(True)
def on_lEditTagSearch_textChanged(self): startdate = self.dEditStart.date().toPyDate() enddate = self.dEditEnd.date().toPyDate() if(len(str(self.lEditTagSearch.text()))> 3): #only performs type and search if search terms are longer than 3 characters if((enddate - startdate).days > 0 and (enddate - startdate).days < GlobalVar.DATESEARCHTOLERANCE): #If the time interval qualifies the conditions Keywords = str(self.lEditTagSearch.text()).split() GlobalVar.TagSearchResultPaths = ImageManagementUtil.SearchTags(GlobalVar.AllPhotoPaths,Keywords, startdate,enddate) self.lWidgetTagSearchResults.clear() self.lWidgetTagSearchResults.addItems(ImageManagementUtil.parseDirectories(GlobalVar.TagSearchResultPaths)) else: #if it does not meet conditions Keywords = str(self.lEditTagSearch.text()).split() GlobalVar.TagSearchResultPaths = ImageManagementUtil.SearchTags(GlobalVar.AllPhotoPaths,Keywords,0,0) self.lWidgetTagSearchResults.clear() self.lWidgetTagSearchResults.addItems(ImageManagementUtil.parseDirectories(GlobalVar.TagSearchResultPaths)) else: if((enddate - startdate).days < 0 or (enddate - startdate).days > GlobalVar.DATESEARCHTOLERANCE): #only clear if does not meet date conditions self.lWidgetTagSearchResults.clear() GlobalVar.TagSearchResultPaths = []
def on_btnResetDateFilter_released(self): self.dEditStart.setDate(QtCore.QDate(2014, 6, 1)) self.dEditEnd.setDate(QtCore.QDate(2015, 4, 1)) if(len(str(self.lEditTagSearch.text()))> 3): Keywords = str(self.lEditTagSearch.text()).split() GlobalVar.TagSearchResultPaths = ImageManagementUtil.SearchTags(GlobalVar.AllPhotoPaths,Keywords,0,0) self.lWidgetTagSearchResults.clear() self.lWidgetTagSearchResults.addItems(ImageManagementUtil.parseDirectories(GlobalVar.TagSearchResultPaths)) else: self.lWidgetTagSearchResults.clear() GlobalVar.TagSearchResultPaths = []
def on_dEditEnd_dateChanged(self): startdate = self.dEditStart.date().toPyDate() enddate = self.dEditEnd.date().toPyDate() if((enddate - startdate).days > 0 and (enddate - startdate).days < GlobalVar.DATESEARCHTOLERANCE): #If the time interval qualifies the conditions Keywords = str(self.lEditTagSearch.text()).split() GlobalVar.TagSearchResultPaths = ImageManagementUtil.SearchTags(GlobalVar.AllPhotoPaths,Keywords,startdate,enddate) self.lWidgetTagSearchResults.clear() self.lWidgetTagSearchResults.addItems(ImageManagementUtil.parseDirectories(GlobalVar.TagSearchResultPaths)) else: self.lWidgetTagSearchResults.clear() GlobalVar.TagSearchResultPaths = []
def __init__(self, parent = None): GlobalVar.SourceDirectory = str(ConfigIO.getSourceDirectory()).replace('\n', '').replace('\t', '').replace('\r', '') GlobalVar.DestinationDirectory = "" GlobalVar.EventDirectory = str(ConfigIO.getEventDirectory()).replace('\n', '').replace('\t', '').replace('\r', '') GlobalVar.SymLinkDirectory = str(ConfigIO.getSymLinkDirectory()).replace('\n', '').replace('\t', '').replace('\r', '') GlobalVar.AllPhotoPaths = ImageManagementUtil.loadAllUnderDirectory(GlobalVar.EventDirectory) QMainWindow.__init__(self, parent) self.setupUi(self) GlobalVar.EventPaths = ImageManagementUtil.loadAllInDirectory(GlobalVar.EventDirectory) GlobalVar.EventNames = ImageManagementUtil.parseDirectories(GlobalVar.EventPaths) self.lWidgetEvent.addItems(GlobalVar.EventNames) self.lcdNumberTotalImages.display(len(GlobalVar.AllPhotoPaths)) self.btnUpload.setEnabled(False)
def on_btnBrowse_released(self): self.lWidgetPhotoPath.clear() l = QListWidget() GlobalVar.ImagePaths = QtGui.QFileDialog.getOpenFileNames( QFileDialog(), 'Open file', GlobalVar.SourceDirectory) self.lWidgetPhotoPath.addItems( ImageManagementUtil.parseDirectories(GlobalVar.ImagePaths)) self.lblNumberSelected.setText( str(len(GlobalVar.ImagePaths)) + " Selected") GlobalVar.PhotoSelected = True if (GlobalVar.EventSelected == True and GlobalVar.PhotographerNameEntered == True and GlobalVar.PhotoSelected == True): self.btnUpload.setEnabled(True)
def on_btnResetDateFilter_released(self): self.dEditStart.setDate(QtCore.QDate(2014, 6, 1)) self.dEditEnd.setDate(QtCore.QDate(2015, 4, 1)) if (len(str(self.lEditTagSearch.text())) > 3): Keywords = str(self.lEditTagSearch.text()).split() GlobalVar.TagSearchResultPaths = ImageManagementUtil.SearchTags( GlobalVar.AllPhotoPaths, Keywords, 0, 0) self.lWidgetTagSearchResults.clear() self.lWidgetTagSearchResults.addItems( ImageManagementUtil.parseDirectories( GlobalVar.TagSearchResultPaths)) else: self.lWidgetTagSearchResults.clear() GlobalVar.TagSearchResultPaths = []
def on_dEditEnd_dateChanged(self): startdate = self.dEditStart.date().toPyDate() enddate = self.dEditEnd.date().toPyDate() if ((enddate - startdate).days > 0 and (enddate - startdate).days < GlobalVar.DATESEARCHTOLERANCE ): #If the time interval qualifies the conditions Keywords = str(self.lEditTagSearch.text()).split() GlobalVar.TagSearchResultPaths = ImageManagementUtil.SearchTags( GlobalVar.AllPhotoPaths, Keywords, startdate, enddate) self.lWidgetTagSearchResults.clear() self.lWidgetTagSearchResults.addItems( ImageManagementUtil.parseDirectories( GlobalVar.TagSearchResultPaths)) else: self.lWidgetTagSearchResults.clear() GlobalVar.TagSearchResultPaths = []
def __init__(self, parent=None): GlobalVar.SourceDirectory = str(ConfigIO.getSourceDirectory()).replace( '\n', '').replace('\t', '').replace('\r', '') GlobalVar.DestinationDirectory = "" GlobalVar.EventDirectory = str(ConfigIO.getEventDirectory()).replace( '\n', '').replace('\t', '').replace('\r', '') GlobalVar.SymLinkDirectory = str( ConfigIO.getSymLinkDirectory()).replace('\n', '').replace( '\t', '').replace('\r', '') GlobalVar.AllPhotoPaths = ImageManagementUtil.loadAllUnderDirectory( GlobalVar.EventDirectory) QMainWindow.__init__(self, parent) self.setupUi(self) GlobalVar.EventPaths = ImageManagementUtil.loadAllInDirectory( GlobalVar.EventDirectory) GlobalVar.EventNames = ImageManagementUtil.parseDirectories( GlobalVar.EventPaths) self.lWidgetEvent.addItems(GlobalVar.EventNames) self.lcdNumberTotalImages.display(len(GlobalVar.AllPhotoPaths)) self.btnUpload.setEnabled(False)
def on_lEditEventPicker_returnPressed(self): keyword = self.lEditEventPicker.text() ResultEventPaths = ImageManagementUtil.Search(GlobalVar.EventPaths,keyword) self.lWidgetEvent.clear() self.lWidgetEvent.addItems(ImageManagementUtil.parseDirectories(ResultEventPaths))
def on_btnRefreshEvents_released(self): self.lWidgetEvent.clear() GlobalVar.EventPaths = ImageManagementUtil.loadAllInDirectory(GlobalVar.EventDirectory) GlobalVar.EventNames = ImageManagementUtil.parseDirectories(GlobalVar.EventPaths) self.lWidgetEvent.addItems(GlobalVar.EventNames)