Beispiel #1
0
 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)
Beispiel #2
0
 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 = []
Beispiel #3
0
 def on_lEditEventPicker_textChanged(self):
     keyword = self.lEditEventPicker.text()
     ResultEventPaths = ImageManagementUtil.Search(GlobalVar.EventPaths,
                                                   keyword)
     self.lWidgetEvent.clear()
     self.lWidgetEvent.addItems(
         ImageManagementUtil.parseDirectories(ResultEventPaths))
Beispiel #4
0
 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)
Beispiel #5
0
 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 = []
Beispiel #6
0
    def on_btnUpload_released(self):
        GlobalVar.Tags.append(str(self.lWidgetEvent.currentItem().text()))
        if (self.cBoxSenior.checkState() == 2):
            GlobalVar.Tags.append("Senior")
        if (self.cBoxJunior.checkState() == 2):
            GlobalVar.Tags.append("Junior")
        if (self.cBoxSophomore.checkState() == 2):
            GlobalVar.Tags.append("Sophomore")
        if (self.cBoxFreshmen.checkState() == 2):
            GlobalVar.Tags.append("Freshmen")
        if (self.lEditOpponent.text() != ""):
            GlobalVar.Tags.append(
                "vs" + str(self.lEditOpponent.text()).replace(" ", ""))
        if (self.cBoxStudentLife.checkState() == 2):
            GlobalVar.Tags.append("StudentLife")
        if (self.cBoxAcademics.checkState() == 2):
            GlobalVar.Tags.append("Academics")
        if (self.cBoxSports.checkState() == 2):
            GlobalVar.Tags.append("Sports")
        if (self.cBoxPeople.checkState() == 2):
            GlobalVar.Tags.append("People")
        if (self.cBoxClubs.checkState() == 2):
            GlobalVar.Tags.append("Clubs")
        if (self.cBoxCrowds.checkState() == 2):
            GlobalVar.Tags.append("Crowds")

        Photographer = self.cBoxPhotographer.currentText()
        DestinationDirectory = GlobalVar.EventDirectory + "/" + str(
            self.lWidgetEvent.currentItem().text())
        ImageManagementUtil.Upload(GlobalVar.ImagePaths, DestinationDirectory,
                                   Photographer, self, GlobalVar.Tags)
Beispiel #7
0
    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 = []
Beispiel #8
0
 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)
Beispiel #9
0
 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 = []
Beispiel #10
0
 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 = []
Beispiel #11
0
 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)
Beispiel #12
0
def getEventDirectory():
    ImageManagementUtil.FileCheck(GlobalVar.CONFIGFILE_LOCATION, "r+")
    f = open(
        GlobalVar.CONFIGFILE_LOCATION, "r+"
    )  #Open for reading and writing because in case file does not exist
    lines = f.readlines()
    f.close()
    for line in lines:
        if "#EventDirectory# " in line:
            line = line.replace("#EventDirectory# ", "")
            return line  #return a string of the directory
    return ""  #return nothing if not found
Beispiel #13
0
    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 = []
Beispiel #14
0
 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)
Beispiel #15
0
 def on_lEditEventPicker_returnPressed(self):
     keyword = self.lEditEventPicker.text()
     ResultEventPaths = ImageManagementUtil.Search(GlobalVar.EventPaths,keyword)
     self.lWidgetEvent.clear()
     self.lWidgetEvent.addItems(ImageManagementUtil.parseDirectories(ResultEventPaths))
Beispiel #16
0
 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)
Beispiel #17
0
 def on_btnTagSearchRefresh_released(self):
     GlobalVar.AllPhotoPaths = ImageManagementUtil.loadAllUnderDirectory(GlobalVar.EventDirectory)
     self.lcdNumberTotalImages.display(len(GlobalVar.AllPhotoPaths))
Beispiel #18
0
 def on_btnShowInFolder_released(self):
     now = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
     dir = GlobalVar.SymLinkDirectory + "/" + "Linked" + str(now)
     print dir
     ImageManagementUtil.CreateSymLink(GlobalVar.TagSearchResultPaths, dir)
Beispiel #19
0
 def on_btnTagSearchRefresh_released(self):
     GlobalVar.AllPhotoPaths = ImageManagementUtil.loadAllUnderDirectory(
         GlobalVar.EventDirectory)
     self.lcdNumberTotalImages.display(len(GlobalVar.AllPhotoPaths))