示例#1
0
    def bt_SavePlaylistClick(self, event):
        dataToSave = "type=" + self.combo_typeOptions.GetValue()
        dataToSave += "\n" + "title=" + self.tc_Title.Value
        dataToSave += "\n" + "artist=" + self.tc_Artist.Value
        dataToSave += "\n" + "albumartist=" + self.tc_AlbumArtist.Value
        dataToSave += "\n" + "composer=" + self.tc_Composer.Value
        dataToSave += "\n" + "year=" + self.tc_Year.Value
        dataToSave += "\n" + "genre=" + self.tc_Genre.Value
        dataToSave += "\n" + "cover=" + self.tc_Cover.Value
        dataToSave += "\n" + "discnumber=" + self.tc_DiscNumber.Value
        dataToSave += "\n" + "inserted="
        dataToSave += "\n" + "created="
        dataToSave += "\n" + "lastmodified="
        dataToSave += "\n\n"
        dataToSave += self.tc_FilesFolders.Value

        dialog = wx.FileDialog(self,
                               message='Choose a file',
                               defaultDir=guiFunctions.configMe(
                                   "general", "default_sp_path"),
                               wildcard="Playlist Files (*.sp)|*.sp",
                               style=wx.SAVE | wx.OVERWRITE_PROMPT)
        if dialog.ShowModal() == wx.ID_OK:
            savefile = dialog.GetFilename()
            basename, extension = os.path.splitext(savefile)
            if extension == "":
                extension = ".sp"
            savefile = basename + extension
            savedir = dialog.GetDirectory()
            saveMe = open(os.path.join(savedir, savefile), 'w')
            print os.path.join(savedir, savefile)
            saveMe.write(dataToSave)
            saveMe.close()
            guiFunctions.statusText(self, "SP: " + savefile + " saved...")
示例#2
0
    def bt_SaveDefaultsClick(self, event):
        section = "virtuals"
        guiFunctions.configWrite(section, "type",
                                 self.combo_typeOptions.GetCurrentSelection())
        guiFunctions.configWrite(section, "title", self.tc_Title.Value)

        guiFunctions.configWrite(section, "artist", self.tc_Artist.Value)
        guiFunctions.configWrite(section, "albumartist",
                                 self.tc_AlbumArtist.Value)
        guiFunctions.configWrite(section, "composer", self.tc_Composer.Value)
        guiFunctions.configWrite(section, "year", self.tc_Year.Value)
        guiFunctions.configWrite(section, "genre", self.tc_Genre.Value)
        guiFunctions.configWrite(section, "cover", self.tc_Cover.Value)
        guiFunctions.configWrite(section, "discnumber",
                                 self.tc_DiscNumber.Value)

        folders = ""
        numLines = 0
        maxLines = (int(self.tc_FilesFolders.GetNumberOfLines()))
        while (numLines < maxLines):
            folders += str(self.tc_FilesFolders.GetLineText(numLines))
            numLines += 1
            if numLines != maxLines:
                folders += "|"
        guiFunctions.configWrite(section, "tracks", folders)

        guiFunctions.statusText(self, "Defaults saved...")
示例#3
0
    def bt_LoadVirtualClick(self, event):
        filters = guiFunctions.configMe("general", "playlist_extensions")
        defDir = guiFunctions.configMe("general", "default_sp_path")
        wildcards = "Virtual/Work Playlists (" + filters + ")|" + filters.replace(
            " ", ";") + "|All files (*.*)|*.*"

        # back up to the folder below our current one.  save cwd in variable
        owd = os.getcwd()
        os.chdir(os.pardir)

        dialog = wx.FileDialog(None,
                               message='Select Virtual/Works Playlist File...',
                               defaultDir=defDir,
                               wildcard=wildcards,
                               style=wxOPEN)

        # Open Dialog Box and get Selection
        if dialog.ShowModal() == wxID_OK:
            selected = dialog.GetFilenames()
            for selection in selected:
                # All the hard work goes here...
                file = open(selection)
                print file.read()
                guiFunctions.statusText(
                    self, "Playlist: " + selection + " selected...")
        dialog.Destroy()

        # set back to original working directory
        os.chdir(owd)
示例#4
0
    def bt_SavePlaylistClick(self, event):
        dataToSave = "type=" + self.combo_typeOptions.GetValue()
        dataToSave += "\n" + "title=" + self.tc_Title.Value
        dataToSave += "\n" + "artist=" + self.tc_Artist.Value
        dataToSave += "\n" + "albumartist=" + self.tc_AlbumArtist.Value
        dataToSave += "\n" + "composer=" + self.tc_Composer.Value
        dataToSave += "\n" + "year=" + self.tc_Year.Value
        dataToSave += "\n" + "genre=" + self.tc_Genre.Value
        dataToSave += "\n" + "cover=" + self.tc_Cover.Value
        dataToSave += "\n" + "discnumber=" + self.tc_DiscNumber.Value
        dataToSave += "\n" + "inserted="
        dataToSave += "\n" + "created="
        dataToSave += "\n" + "lastmodified="
        dataToSave += "\n\n"
        dataToSave += self.tc_FilesFolders.Value

        dialog = wx.FileDialog(self, message='Choose a file', defaultDir=guiFunctions.configMe("general", "default_sp_path"), wildcard="Playlist Files (*.sp)|*.sp", style=wx.SAVE|wx.OVERWRITE_PROMPT)
        if dialog.ShowModal() == wx.ID_OK:
            savefile = dialog.GetFilename()
            basename, extension = os.path.splitext(savefile)
            if extension == "":
                extension = ".sp"
            savefile = basename + extension
            savedir = dialog.GetDirectory()
            saveMe=open(os.path.join(savedir, savefile),'w')
            print os.path.join(savedir, savefile)
            saveMe.write(dataToSave)
            saveMe.close()
            guiFunctions.statusText(self, "SP: " + savefile + " saved...")
示例#5
0
    def bt_MainDatabaseClick(self, event):
        filters = guiFunctions.configMe("general", "database_extensions")
        wildcards = "Sonospy Database (" + filters + ")|" + filters.replace(
            " ", ";") + "|All files (*.*)|*.*"

        # back up to the folder below our current one.  save cwd in variable
        owd = os.getcwd()
        os.chdir(os.pardir)

        dialog = wx.FileDialog(None,
                               message='Select Source Database File...',
                               defaultDir=guiFunctions.configMe(
                                   "general", "default_database_path"),
                               wildcard=wildcards,
                               style=wxOPEN)

        # Open Dialog Box and get Selection
        if dialog.ShowModal() == wxID_OK:
            selected = dialog.GetFilenames()
            for selection in selected:
                self.tc_MainDatabase.Value = selection
                guiFunctions.statusText(
                    self, "Main Database: " + selection + " selected...")
        dialog.Destroy()

        # set back to original working directory
        os.chdir(owd)
示例#6
0
    def bt_SaveDefaultsClick(self, event):
        section = "launch"

        guiFunctions.configWrite(section, "proxy", self.rd_Proxy.Value)
        guiFunctions.configWrite(section, "db1_check", self.ck_DB1.Value)
        guiFunctions.configWrite(section, "db1_dbname", self.ck_DB1.Label)
        guiFunctions.configWrite(section, "db1_proxyname", self.tc_DB1.Value)
        guiFunctions.configWrite(section, "db2_check", self.ck_DB2.Value)
        guiFunctions.configWrite(section, "db2_dbname", self.ck_DB2.Label)
        guiFunctions.configWrite(section, "db2_proxyname", self.tc_DB2.Value)
        guiFunctions.configWrite(section, "db3_check", self.ck_DB3.Value)
        guiFunctions.configWrite(section, "db3_dbname", self.ck_DB3.Label)
        guiFunctions.configWrite(section, "db3_proxyname", self.tc_DB3.Value)
        guiFunctions.configWrite(section, "db4_check", self.ck_DB4.Value)
        guiFunctions.configWrite(section, "db4_dbname", self.ck_DB4.Label)
        guiFunctions.configWrite(section, "db4_proxyname", self.tc_DB4.Value)
        guiFunctions.configWrite(section, "db5_check", self.ck_DB5.Value)
        guiFunctions.configWrite(section, "db5_dbname", self.ck_DB5.Label)
        guiFunctions.configWrite(section, "db5_proxyname", self.tc_DB5.Value)
        guiFunctions.configWrite(section, "db6_check", self.ck_DB6.Value)
        guiFunctions.configWrite(section, "db6_dbname", self.ck_DB6.Label)
        guiFunctions.configWrite(section, "db6_proxyname", self.tc_DB6.Value)
        guiFunctions.configWrite(section, "db7_check", self.ck_DB7.Value)
        guiFunctions.configWrite(section, "db7_dbname", self.ck_DB7.Label)
        guiFunctions.configWrite(section, "db7_proxyname", self.tc_DB7.Value)
        guiFunctions.configWrite(section, "db8_check", self.ck_DB8.Value)
        guiFunctions.configWrite(section, "db8_dbname", self.ck_DB8.Label)
        guiFunctions.configWrite(section, "db8_proxyname", self.tc_DB8.Value)

        guiFunctions.statusText(self, "Defaults saved...")
示例#7
0
    def bt_LaunchClick(self, event):
        # back up to the folder below our current one.  save cwd in variable
        owd = os.getcwd()
        os.chdir(os.pardir)
        os.chdir(os.pardir)

        launchCMD = self.buildLaunch()

# DEBUG ------------------------------------------------------------------------
#            print launchCMD
# ------------------------------------------------------------------------------
        if os.name != 'nt':
            proc = subprocess.Popen([launchCMD],shell=True)
            if self.bt_Launch.Label == "Stop":
                self.bt_Launch.Label = "Launch"
                self.bt_Launch.SetToolTip(wx.ToolTip("Click here to launch the Sonospy service."))
                guiFunctions.statusText(self, "Sonospy Service Stopped...")
                self.buildLaunch()
                self.setButtons(True)
            else:
                self.bt_Launch.Label = "Stop"
                self.bt_Launch.SetToolTip(wx.ToolTip("Click here to stop the Sonospy service."))
                guiFunctions.statusText(self, "Sonospy Service Started...")
                self.buildLaunch()
                self.setButtons(False)
        else:
            proc = subprocess.Popen(launchCMD, shell=True)

        # set back to original working directory
        os.chdir(owd)
示例#8
0
    def browseDB(self, event):
        filters = guiFunctions.configMe("general", "database_extensions")
        wildcards = "Sonospy Database (" + filters + ")|" + filters.replace(" ", ";") + "|All files (*.*)|*.*"
        
        # back up to the folder below our current one.  save cwd in variable
        owd = os.getcwd()
        os.chdir(os.pardir)

        dialog = wx.FileDialog ( None, message = 'Select database...', defaultDir=guiFunctions.configMe("general", "default_database_path"), wildcard = wildcards, style = wxOPEN)

        # Open Dialog Box and get Selection
        if dialog.ShowModal() == wxID_OK:
            selected = dialog.GetFilenames()
            for selection in selected:
                basename, extension = os.path.splitext(selection)
                event.GetEventObject().tc.Value = basename
                event.GetEventObject().ck.Label = selection
                event.GetEventObject().ck.Enable()
                event.GetEventObject().ck.Value = True
                guiFunctions.statusText(self, "Database: " + selection + " selected...")
        dialog.Destroy()
        self.Update()

        # set back to original working directory
        os.chdir(owd)
示例#9
0
    def bt_SaveDefaultsClick(self, event):
        section = "extract"

        guiFunctions.configWrite(section, "database_source", self.tc_MainDatabase.Value)
        guiFunctions.configWrite(section, "database_target", self.tc_TargetDatabase.Value)
        guiFunctions.configWrite(section, "createdidx", self.combo_LogicalCreated.GetCurrentSelection())
        guiFunctions.configWrite(section, "createdval", self.tc_DaysAgoCreated.Value)
        guiFunctions.configWrite(section, "insertedidx", self.combo_LogicalInserted.GetCurrentSelection())
        guiFunctions.configWrite(section, "insertedval", self.tc_DaysAgoInserted.Value)
        guiFunctions.configWrite(section, "modifiedidx", self.combo_LogicalModified.GetCurrentSelection())
        guiFunctions.configWrite(section, "modifiedval", self.tc_DaysAgoModified.Value)
        guiFunctions.configWrite(section, "accessedidx", self.combo_LogicalAccessed.GetCurrentSelection())
        guiFunctions.configWrite(section, "accessedval", self.tc_DaysAgoAccessed.Value)
        guiFunctions.configWrite(section, "yearidx", self.combo_LogicalYear.GetCurrentSelection())
        guiFunctions.configWrite(section, "yearval", self.tc_Year.Value)
        guiFunctions.configWrite(section, "genre", self.tc_Genre.Value)
        guiFunctions.configWrite(section, "artist", self.tc_Artist.Value)
        guiFunctions.configWrite(section, "composer", self.tc_Composer.Value)
        guiFunctions.configWrite(section, "bitrateidx", self.combo_LogicalBitrate.GetCurrentSelection())
        guiFunctions.configWrite(section, "bitrateval", self.tc_Bitrate.Value)
        guiFunctions.configWrite(section, "last", self.tc_Last.Value)
        guiFunctions.configWrite(section, "verbose", self.ck_ExtractVerbose.Value)
        guiFunctions.configWrite(section, "overwrite", self.ck_OverwriteExisting.Value)

        guiFunctions.statusText(self, "Defaults saved...")
示例#10
0
    def bt_SaveDefaultsClick(self, event):
        section = "virtuals"
        guiFunctions.configWrite(section, "type", self.combo_typeOptions.GetCurrentSelection())
        guiFunctions.configWrite(section, "title", self.tc_Title.Value)

        guiFunctions.configWrite(section, "artist", self.tc_Artist.Value)
        guiFunctions.configWrite(section, "albumartist", self.tc_AlbumArtist.Value)
        guiFunctions.configWrite(section, "composer", self.tc_Composer.Value)
        guiFunctions.configWrite(section, "year", self.tc_Year.Value)
        guiFunctions.configWrite(section, "genre", self.tc_Genre.Value)
        guiFunctions.configWrite(section, "cover", self.tc_Cover.Value)
        guiFunctions.configWrite(section, "discnumber", self.tc_DiscNumber.Value)

        folders = ""
        numLines = 0
        maxLines=(int(self.tc_FilesFolders.GetNumberOfLines()))
        while (numLines < maxLines):
            folders += str(self.tc_FilesFolders.GetLineText(numLines))
            numLines += 1
            if numLines != maxLines:
                folders += "|"
        guiFunctions.configWrite(section, "tracks", folders)


        guiFunctions.statusText(self, "Defaults saved...")
示例#11
0
 def bt_SaveLogClick(self, event):
     dialog = wx.FileDialog(self, message='Choose a file', style=wx.SAVE|wx.OVERWRITE_PROMPT)
     if dialog.ShowModal() == wx.ID_OK:
         savefile = dialog.GetFilename()
         saveMe = open(savefile, 'w')
         saveMe.write(self.LogWindow.Value)
         saveMe.close()
         guiFunctions.statusText(self, "Logfile: " + savefile + " saved...")
示例#12
0
    def bt_ScanUpdateClick(self, event):
        if os.name == 'nt':
            cmdroot = 'python '
        else:
            cmdroot = './'

        self.LogWindow.Enable()

        if self.tc_MainDatabase.Value == "":
            self.LogWindow.AppendText("ERROR:\tNo database name selected!\n")
        else:
            # Set Original Working Directory so we can get back to here.
            owd = os.getcwd()
            os.chdir(os.pardir)

            getOpts = ""
            iniOverride = ""
            
            if self.ck_ScanVerbose.Value == True:
                getOpts = "-v "
#            if self.tc_INI.Value != "":
#                iniOverride = " -i " + self.tc_INI.Value

            global scanCMD
            global startTime

            scanCMD = cmdroot + "scan.py " + getOpts +"-d " + self.tc_MainDatabase.Value + iniOverride + " "

            numLines=0
            maxLines=(int(self.multiText.GetNumberOfLines()))

            if self.multiText.GetLineText(numLines) == "":
                self.LogWindow.AppendText("ERROR\tNo folder selected to scan!\n")
            else:
                startTime = datetime.now()
                self.LogWindow.AppendText("[ Starting Scan ] (" + startTime.strftime("%T") + ")\n")


                guiFunctions.statusText(self, "Running Scan...")
                while (numLines < maxLines):
                    if os.name == "nt":
                        line = str(self.multiText.GetLineText(numLines))
                        line = line.replace("\\", "\\\\")
                        line = line.replace(" ", "\ ")
                        scanCMD += "\"" + line + "\" "
                    else:
                        scanCMD += "\"" + str(self.multiText.GetLineText(numLines)).replace(" ", "\ ") + "\" "

                    numLines += 1

                # Multithreading is below this line.
                if not self.worker:
                    self.worker = WorkerThread(self)
                    self.setButtons(False)

                # set back to original working directory
                os.chdir(owd)
示例#13
0
    def bt_SaveLogClick(self, event):
        dialog = wx.FileDialog(self, message='Choose a file', style=wx.SAVE|wx.OVERWRITE_PROMPT)
        if dialog.ShowModal() == wx.ID_OK:
            savefile = dialog.GetFilename()

            saveMe = open(savefile, 'w')
            saveMe.write(self.LogWindow.Value)
            saveMe.close()
        guiFunctions.statusText(self, savefile + " saved...")
示例#14
0
    def bt_LaunchClick(self, event):
        # back up to the folder below our current one.  save cwd in variable
        owd = os.getcwd()
        os.chdir(os.pardir)
        os.chdir(os.pardir)

        # Check for OS
        if os.name == 'nt':
            cmdroot = 'sonospy_ '
            launchCMD = cmdroot
            # which version are we running?
            if self.rd_Proxy.Value == True:
                launchCMD += "p "
            else:
                launchCMD += "w "

        else:
            cmdroot = './'
            launchCMD = cmdroot + "sonospy_"
            # which version are we running?
            if self.rd_Proxy.Value == True:
                launchCMD += "proxy "
            else:
                launchCMD += "web "

        # rebuild text labels now, user may have changed them
        for item in range(len(list_checkboxID)):
            list_txtctrlLabel[item] = wxFindWindowById(list_txtctrlID[item]).Value
            list_checkboxLabel[item] = wxFindWindowById(list_checkboxID[item]).Label
            
        # build out the command
        if self.bt_Launch.Label == "Stop":
            if os.name != 'nt':
                launchCMD = cmdroot + "sonospy_stop"
        else:
            for item in range(len(list_checkboxID)):
                if wx.FindWindowById(list_checkboxID[item]).Value == True:
                    launchCMD += "-wSonospy=" + list_txtctrlLabel[item] + "," + list_checkboxLabel[item] + " "

# DEBUG ------------------------------------------------------------------------
#            print launchCMD
# ------------------------------------------------------------------------------
        if os.name != 'nt':
            proc = subprocess.Popen([launchCMD],shell=True)
            if self.bt_Launch.Label == "Stop":
                self.bt_Launch.Label = "Launch"
                self.bt_Launch.SetToolTip(wx.ToolTip("Click here to launch the Sonospy service."))
                guiFunctions.statusText(self, "Sonospy Service Stopped...")
            else:
                self.bt_Launch.Label = "Stop"
                self.bt_Launch.SetToolTip(wx.ToolTip("Click here to stop the Sonospy service."))
                guiFunctions.statusText(self, "Sonospy Service Started...")
        else:
            proc = subprocess.Popen(launchCMD, shell=True)

        # set back to original working directory
        os.chdir(owd)
示例#15
0
    def bt_FoldersToScanAddClick(self, event):
        dialog = wx.DirDialog(self, "Add a Directory...", defaultPath=guiFunctions.configMe("general", "default_music_path"), style=wx.DD_DEFAULT_STYLE)
        if dialog.ShowModal() == wx.ID_OK:
            if self.tc_FilesFolders.Value == "":
                self.tc_FilesFolders.AppendText("%s" % dialog.GetPath())
            else:
                self.tc_FilesFolders.AppendText("\n%s" % dialog.GetPath())

        dialog.Destroy()
        guiFunctions.statusText(self, "Folder: " + "%s" % dialog.GetPath() + " added.")
示例#16
0
    def bt_FoldersToScanAddClick(self, event):
        dialog = wx.DirDialog(self, "Add a Directory...", style=wx.DD_DEFAULT_STYLE)
        if dialog.ShowModal() == wx.ID_OK:
            if self.tc_FilesFolders.Value == "":
                self.tc_FilesFolders.AppendText("%s" % dialog.GetPath())
            else:
                self.tc_FilesFolders.AppendText("\n%s" % dialog.GetPath())

        dialog.Destroy()
        guiFunctions.statusText(self, "Folder: " + "%s" % dialog.GetPath() + " added.")
示例#17
0
    def browseDB(self, event):
        filters = 'Text files (*.db)|*.db|All files (*.*)|*.*'
        dialog = wx.FileDialog ( None, message = 'Select Database File...', wildcard = filters, style = wxOPEN)

        # Open Dialog Box and get Selection
        if dialog.ShowModal() == wxID_OK:
            selected = dialog.GetFilenames()
            for selection in selected:
                tc.Value = selection
                guiFunctions.statusText(self, "Database: " + selection + " selected...")
        dialog.Destroy()
示例#18
0
    def bt_FoldersToScanAddClick(self, event):
        dialog = wx.DirDialog(self, "Add a Directory...", defaultPath=guiFunctions.configMe("general", "default_music_path"), style=wx.DD_DEFAULT_STYLE)

        if dialog.ShowModal() == wx.ID_OK:
            if self.multiText.Value == "":
                self.multiText.AppendText("%s" % dialog.GetPath())
            else:
                self.multiText.AppendText("\n%s" % dialog.GetPath())

        dialog.Destroy()
        guiFunctions.statusText(self, "Folder: " + "%s" % dialog.GetPath() + " added.")
示例#19
0
 def bt_FilesToScanAddClick(self, event):
     dialog = wx.FileDialog(self, "Add Track(s)...", defaultDir=guiFunctions.configMe("general", "default_music_path"), style=wx.DD_DEFAULT_STYLE|wx.FD_MULTIPLE)
     if dialog.ShowModal() == wxID_OK:
         selected = dialog.GetFilenames()
         for selection in selected:
             if self.tc_FilesFolders.Value == "":
                 self.tc_FilesFolders.AppendText(selection)
             else:
                 self.tc_FilesFolders.AppendText("\n" + selection)
     dialog.Destroy()
     guiFunctions.statusText(self, "Tracks added.")
示例#20
0
 def bt_FilesToScanAddClick(self, event):
     dialog = wx.FileDialog(self, "Add Track(s)...", style=wx.DD_DEFAULT_STYLE|wx.FD_MULTIPLE)
     if dialog.ShowModal() == wxID_OK:
         selected = dialog.GetFilenames()
         for selection in selected:
             if self.tc_FilesFolders.Value == "":
                 self.tc_FilesFolders.AppendText(selection)
             else:
                 self.tc_FilesFolders.AppendText("\n" + selection)
     dialog.Destroy()
     guiFunctions.statusText(self, "Tracks added.")
示例#21
0
 def onResult(self, event):
     """Show Result status."""
     if event.data is None:
         # Thread aborted (using our convention of None return)
         self.LogWindow.AppendText("\n[Complete]\n\n")
         guiFunctions.statusText(self, "Job Complete...")
         self.setButtons(True)
     else:
         # Process results here
         self.LogWindow.AppendText(event.data)
     # In either event, the worker is done
     self.worker = None
示例#22
0
    def onResult(self, event):
        """Show Result status."""
        if event.data is None:
            # Thread aborted (using our convention of None return)
            endTime = datetime.now()
            calcdTime = endTime - startTime

            self.LogWindow.AppendText("\n[ Job Complete ] (Duration: " + str(calcdTime)[:-4] +")\n\n")
            guiFunctions.statusText(self, "Job Complete...")
            self.setButtons(True)
        else:
            # Process results here
            self.LogWindow.AppendText(event.data)
        # In either event, the worker is done
        self.worker = None
示例#23
0
    def onResult(self, event):
        """Show Result status."""
        if event.data is None:
            # Thread aborted (using our convention of None return)
            endTime = datetime.now()
            calcdTime = endTime - startTime

            self.LogWindow.AppendText("\n[ Job Complete ] (Duration: " +
                                      str(calcdTime)[:-4] + ")\n\n")
            guiFunctions.statusText(self, "Job Complete...")
            self.setButtons(True)
        else:
            # Process results here
            self.LogWindow.AppendText(event.data)
        # In either event, the worker is done
        self.worker = None
示例#24
0
    def bt_SaveDefaultsClick(self, event):
        section = "extract"

        guiFunctions.configWrite(section, "database_source",
                                 self.tc_MainDatabase.Value)
        guiFunctions.configWrite(section, "database_target",
                                 self.tc_TargetDatabase.Value)
        guiFunctions.configWrite(
            section, "createdidx",
            self.combo_LogicalCreated.GetCurrentSelection())
        guiFunctions.configWrite(section, "createdval",
                                 self.tc_DaysAgoCreated.Value)
        guiFunctions.configWrite(
            section, "insertedidx",
            self.combo_LogicalInserted.GetCurrentSelection())
        guiFunctions.configWrite(section, "insertedval",
                                 self.tc_DaysAgoInserted.Value)
        guiFunctions.configWrite(
            section, "modifiedidx",
            self.combo_LogicalModified.GetCurrentSelection())
        guiFunctions.configWrite(section, "modifiedval",
                                 self.tc_DaysAgoModified.Value)
        guiFunctions.configWrite(
            section, "accessedidx",
            self.combo_LogicalAccessed.GetCurrentSelection())
        guiFunctions.configWrite(section, "accessedval",
                                 self.tc_DaysAgoAccessed.Value)
        guiFunctions.configWrite(section, "yearidx",
                                 self.combo_LogicalYear.GetCurrentSelection())
        guiFunctions.configWrite(section, "yearval", self.tc_Year.Value)
        guiFunctions.configWrite(section, "genre", self.tc_Genre.Value)
        guiFunctions.configWrite(section, "artist", self.tc_Artist.Value)
        guiFunctions.configWrite(section, "composer", self.tc_Composer.Value)
        guiFunctions.configWrite(
            section, "bitrateidx",
            self.combo_LogicalBitrate.GetCurrentSelection())
        guiFunctions.configWrite(section, "bitrateval", self.tc_Bitrate.Value)
        guiFunctions.configWrite(section, "last", self.tc_Last.Value)
        guiFunctions.configWrite(section, "verbose",
                                 self.ck_ExtractVerbose.Value)
        guiFunctions.configWrite(section, "overwrite",
                                 self.ck_OverwriteExisting.Value)

        guiFunctions.statusText(self, "Defaults saved...")
示例#25
0
    def bt_INIClick(self, event):
        filters = "*.ini"
        wildcards = "INIFiles (" + filters + ")|" + filters + "|All files (*.*)|*.*"

        # back up to the folder below our current one.  save cwd in variable
        owd = os.getcwd()
        os.chdir(os.pardir)

        dialog = wx.FileDialog ( None, message = 'Select INI File...', defaultDir=guiFunctions.configMe("general", "default_ini_path"), wildcard = wildcards, style = wxOPEN)

        # Open Dialog Box and get Selection
        if dialog.ShowModal() == wxID_OK:
            selected = dialog.GetFilenames()
            for selection in selected:
                self.tc_INI.Value = selection
                guiFunctions.statusText(self, "INI File: " + selection + " selected...")
        dialog.Destroy()

        # set back to original working directory
        os.chdir(owd)
示例#26
0
    def bt_TargetDatabaseClick(self, event):
        filters = guiFunctions.configMe("general", "database_extensions")
        wildcards = "Sonospy Database (" + filters + ")|" + filters.replace(" ", ";") + "|All files (*.*)|*.*"
        
        # back up to the folder below our current one.  save cwd in variable
        owd = os.getcwd()
        os.chdir(os.pardir)
        
        dialog = wx.FileDialog ( None, message = 'Select Target Database File...', wildcard = wildcards, style = wxOPEN )

        # Open Dialog Box and get Selection
        if dialog.ShowModal() == wxID_OK:
            selected = dialog.GetFilenames()
            for selection in selected:
                self.tc_TargetDatabase.Value = selection
        dialog.Destroy()
        guiFunctions.statusText(self, "Target Database: " + selection + " selected...")

        # set back to original working directory
        os.chdir(owd)
示例#27
0
    def bt_SaveDefaultsClick(self, event):
        section = "scan"

        # Verbose setting
        guiFunctions.configWrite(section, "verbose", self.ck_ScanVerbose.Value)

        # Database setting
        guiFunctions.configWrite(section, "database", self.tc_MainDatabase.Value)

        # Folder setting, comma delineate multiple folder entries
        folders = ""
        numLines = 0
        maxLines=(int(self.multiText.GetNumberOfLines()))
        while (numLines < maxLines):
            folders += str(self.multiText.GetLineText(numLines))
            numLines += 1
            if numLines != maxLines:
                folders += "|"
        guiFunctions.configWrite(section, "folder", folders)

        guiFunctions.statusText(self, "Defaults saved...")
示例#28
0
    def bt_ScanRepairClick(self, event):
        global scanCMD
        global startTime
        
        # Set Original Working Directory so we can get back to here.
        owd = os.getcwd()
        os.chdir(os.pardir)

        getOpts = ""
        iniOverride = ""

        if os.name == 'nt':
            cmdroot = 'python '
        else:
            cmdroot = './'

        self.LogWindow.Enable()
        if self.tc_MainDatabase.Value == "":
            self.LogWindow.AppendText("ERROR:\tNo database name selected!\n")
        else:
            if self.ck_ScanVerbose.Value == True:
                getOpts = "-v "
#            if self.tc_INI.Value != "":
##                iniOverride = ""
#                iniOverride = "-i " + self.tc_INI.Value

            scanCMD = cmdroot + "scan.py " + getOpts +"-d " + self.tc_MainDatabase.Value + " -r"
            startTime = datetime.now()
            self.LogWindow.AppendText("[ Starting Repair ] (" + startTime.strftime("%T") + ")\n\n")
            guiFunctions.statusText(self, "[ Repair Started ]")

            if not self.worker:
                self.worker = WorkerThread(self)
                self.setButtons(False)
                wx.SetCursor(wx.StockCursor(wx.CURSOR_WATCH))

        # set back to original working directory
        os.chdir(owd)
示例#29
0
    def bt_SavePlaylistClick(self, event):
        dataToSave = "type=" + self.combo_typeOptions.GetValue()
        dataToSave += "\n" + "title=" + self.tc_Title.Value
        dataToSave += "\n" + "artist=" + self.tc_Artist.Value
        dataToSave += "\n" + "albumartist=" + self.tc_AlbumArtist.Value
        dataToSave += "\n" + "composer=" + self.tc_Composer.Value
        dataToSave += "\n" + "year=" + self.tc_Year.Value
        dataToSave += "\n" + "genre=" + self.tc_Genre.Value
        dataToSave += "\n" + "cover=" + self.tc_Cover.Value
        dataToSave += "\n" + "discnumber=" + self.tc_DiscNumber.Value
        dataToSave += "\n" + "inserted="
        dataToSave += "\n" + "created="
        dataToSave += "\n" + "lastmodified="
        dataToSave += "\n\n"
        dataToSave += self.tc_FilesFolders.Value

        dialog = wx.FileDialog(self, message='Choose a file', wildcard="Playlist Files (*.sp)|*.sp", style=wx.SAVE|wx.OVERWRITE_PROMPT)
        if dialog.ShowModal() == wx.ID_OK:
            savefile = dialog.GetFilename()
            saveMe = open(savefile, 'w')
            saveMe.write(dataToSave)
            saveMe.close()
            guiFunctions.statusText(self, "SP: " + savefile + " saved...")
示例#30
0
    def bt_SaveDefaultsClick(self, event):
        section = "scan"

        # Verbose setting
        guiFunctions.configWrite(section, "verbose", self.ck_ScanVerbose.Value)

        # Database setting
        guiFunctions.configWrite(section, "database", self.tc_MainDatabase.Value)

        # INI Setting
#        guiFunctions.configWrite(section, "inioverride", self.tc_INI.Value)
        
        # Folder setting, comma delineate multiple folder entries
        folders = ""
        numLines = 0
        maxLines=(int(self.multiText.GetNumberOfLines()))
        while (numLines < maxLines):
            folders += str(self.multiText.GetLineText(numLines))
            numLines += 1
            if numLines != maxLines:
                folders += "|"
        guiFunctions.configWrite(section, "folder", folders)

        guiFunctions.statusText(self, "Defaults saved...")
示例#31
0
    def bt_LoadVirtualClick(self, event):
        filters = guiFunctions.configMe("general", "playlist_extensions")
        defDir = guiFunctions.configMe("general", "default_sp_path")
        wildcards = "Virtual/Work Playlists (" + filters + ")|" + filters.replace(" ", ";") + "|All files (*.*)|*.*"

        # back up to the folder below our current one.  save cwd in variable
        owd = os.getcwd()
        os.chdir(os.pardir)

        dialog = wx.FileDialog ( None, message = 'Select Virtual/Works Playlist File...', defaultDir=defDir, wildcard = wildcards, style = wxOPEN)

        
        # Open Dialog Box and get Selection
        if dialog.ShowModal() == wxID_OK:
            selected = dialog.GetFilenames()
            for selection in selected:
                # All the hard work goes here...
                file = open(selection)
                print file.read()
                guiFunctions.statusText(self, "Playlist: " + selection + " selected...")
        dialog.Destroy()

        # set back to original working directory
        os.chdir(owd)
示例#32
0
    def bt_ScanRepairClick(self, event):
# DEBUG ------------------------------------------------------------------------
# self.tc_MainDatabase.Value = "test.db"
# ------------------------------------------------------------------------------
        global scanCMD

        # Set Original Working Directory so we can get back to here.
        owd = os.getcwd()
        os.chdir(os.pardir)

        getOpts = ""

        if os.name == 'nt':
            cmdroot = 'python '
        else:
            cmdroot = './'

        self.LogWindow.Enable()
        if self.tc_MainDatabase.Value == "":
            self.LogWindow.AppendText("ERROR:\tNo database name selected!\n")
        else:
            if self.ck_ScanVerbose.Value == True:
                getOpts = "-v "

            scanCMD = cmdroot + "scan.py " + getOpts +"-d " + self.tc_MainDatabase.Value + " -r"

            self.LogWindow.AppendText("Running Repair on " + self.tc_MainDatabase.Value + "...\n\n")
            guiFunctions.statusText(self, "Running Repair...")

            if not self.worker:
                self.worker = WorkerThread(self)
                self.setButtons(False)
                wx.SetCursor(wx.StockCursor(wx.CURSOR_WATCH))

        # set back to original working directory
        os.chdir(owd)
示例#33
0
    def bt_ExtractClick(self, event):
        global scanCMD
        global getOpts
        # Set Original Working Directory so we can get back to here.
        owd = os.getcwd()
        os.chdir(os.pardir)

        if os.name == 'nt':
            cmdroot = 'python '
        else:
            cmdroot = './'

        self.LogWindow.Enable()

        if self.tc_MainDatabase.Value == "":
            self.LogWindow.AppendText("ERROR:\tNo source database name selected!\n")
        elif self.tc_TargetDatabase.Value == "":
            self.LogWindow.AppendText("ERROR:\tNo target database name selected.\n")
        elif self.tc_MainDatabase.Value == self.tc_TargetDatabase.Value:
            self.LogWindow.AppendText("ERROR:\tSource database and target database cannot be the same database!\n")
        else:
            searchCMD = ""
            # Scrub the fields to see what our extract command should be.
            # Eventually stack these with some sort of AND query.

            if self.tc_DaysAgoCreated.Value != "":
                if searchCMD == "":
                    searchCMD = "where (julianday(datetime(\'now\')) - julianday(datetime(created, \'unixepoch\'))) " + self.combo_LogicalCreated.Value + " " + self.tc_DaysAgoCreated.Value
                else:
                    searchCMD += " AND where (julianday(datetime(\'now\')) - julianday(datetime(created, \'unixepoch\'))) " + self.combo_LogicalCreated.Value + " " + self.tc_DaysAgoCreated.Value

            if self.tc_DaysAgoInserted.Value != "":
                if searchCMD == "":
                    searchCMD = "where (julianday(datetime(\'now\')) - julianday(datetime(inserted, \'unixepoch\'))) " + self.combo_LogicalInserted.Value + " " + self.tc_DaysAgoInserted.Value
                else:
                    searchCMD += " AND where (julianday(datetime(\'now\')) - julianday(datetime(inserted, \'unixepoch\'))) " + self.combo_LogicalInserted.Value + " " + self.tc_DaysAgoInserted.Value

            if self.tc_DaysAgoModified.Value != "":
                if searchCMD == "":
                    searchCMD = "where (julianday(datetime(\'now\')) - julianday(datetime(lastmodified, \'unixepoch\'))) " + self.combo_LogicalModified.Value + " " + self.tc_DaysAgoModified.Value
                else:
                    searchCMD += " AND where (julianday(datetime(\'now\')) - julianday(datetime(lastmodified, \'unixepoch\'))) " + self.combo_LogicalModified.Value + " " + self.tc_DaysAgoModified.Value

            if self.tc_DaysAgoAccessed.Value != "":
                if searchCMD == "":
                    searchCMD = "where (julianday(datetime(\'now\')) - julianday(datetime(lastaccessed, \'unixepoch\'))) " + self.combo_LogicalAccessed.Value + " " + self.tc_DaysAgoAccessed.Value
                else:
                    searchCMD += " AND where (julianday(datetime(\'now\')) - julianday(datetime(lastaccessed, \'unixepoch\'))) " + self.combo_LogicalAccessed.Value + " " + self.tc_DaysAgoAccessed.Value

            if self.tc_Year.Value != "":
                if searchCMD == "":
                    searchCMD = "where year " + self.combo_LogicalYear.Value + " " + self.tc_Year.Value
                else:
                    searchCMD += " AND where year " + self.combo_LogicalYear.Value + " " + self.tc_Year.Value

            if self.tc_Genre.Value != "":
                if searchCMD == "":
                    searchCMD = "where genre=\'" + self.tc_Genre.Value + "\'"
                else:
                    searchCMD += " AND where genre=\'" + self.tc_Genre.Value + "\'"

            if self.tc_Artist.Value != "":
                if searchCMD == "":
                    searchCMD = "where artist=\'" + self.tc_Artist.Value + "\'"
                else:
                    searchCMD += " AND where artist=\'" + self.tc_Artist.Value + "\'"

            if self.tc_Composer.Value != "":
                if searchCMD == "":
                    searchCMD = " AND where composer=\'" + self.tc_Composer.Value + "\'"
                else:
                    searchCMD += " AND where composer=\'" + self.tc_Composer.Value + "\'"

            if self.tc_Bitrate.Value != "":
                if searchCMD == "":
                    searchCMD = "where bitrate " + self.combo_LogicalBitrate.Value + " " + self.tc_Bitrate.Value
                else:
                    searchCMD += "AND where bitrate " + self.combo_LogicalBitrate.Value + " " + self.tc_Bitrate.Value

            if self.tc_Last.Value != "":
                if searchCMD != "":
                    self.LogWindow.AppendText("You cannot combine Last " + self.tc_Last.Value + " albums with other search options...")
                else:
                    searchCMD = "AS t WHERE t.created >= (SELECT a.created FROM albums AS a WHERE a.albumartist != 'Various Artists' ORDER BY a.created DESC LIMIT " + str(int(self.tc_Last.Value) - 1) + ",1)"

            if searchCMD !="":
                searchCMD = "\"" + searchCMD + "\""

                if self.ck_OverwriteExisting.Value == True:
                    if os.path.exists(self.tc_TargetDatabase.Value) == True:
                        illegals = ["/", "~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "+","=",","]
                        for illegal in illegals:
                            if illegal in self.tc_TargetDatabase.Value:
                                self.LogWindow.AppendText("\nERROR:\tInvalid target database! You cannot use " + illegal + " in the database name.")
                                return(1)
                        self.LogWindow.AppendText("\nRemoving file: " + self.tc_TargetDatabase.Value + " because 'Overwrite' is checked.")
                        os.remove(self.tc_TargetDatabase.Value)

                getOpts = ""
                if self.ck_ExtractVerbose.Value == True:
                    getOpts = "-v "

                scanCMD = cmdroot + "scan.py " + getOpts +"-d " + self.tc_MainDatabase.Value + " -x " + self.tc_TargetDatabase.Value + " -w " + searchCMD
                self.LogWindow.AppendText("\nExtracting from " + self.tc_MainDatabase.Value +" into " + self.tc_TargetDatabase.Value + "...\n\n")
                guiFunctions.statusText(self, "Extracting from " + self.tc_MainDatabase.Value +" into " + self.tc_TargetDatabase.Value + "...")


                
# DEBUG ------------------------------------------------------------------------
#                self.LogWindow.AppendText(scanCMD)
# ------------------------------------------------------------------------------

# Multithreading is below this line.
                if not self.worker:
                    self.worker = WorkerThread(self)
                    self.setButtons(False)
                    # set back to original working directory
                    os.chdir(owd)
# ------------------------------------------------------------------------------
            else:
                self.LogWindow.AppendText("\nERROR:\tYou have no extract options selected!")

            # set back to original working directory
            os.chdir(owd)
示例#34
0
 def bt_FoldersToScanClearClick(self, event):
     self.tc_FilesFolders.Value = ""
     guiFunctions.statusText(self, "Cleared folder and track list...")
示例#35
0
    def bt_LoadVirtualClick(self, event):
        filters = guiFunctions.configMe("general", "playlist_extensions")
        defDir = guiFunctions.configMe("general", "default_sp_path")
        wildcards = "Virtual/Work Playlists (" + filters + ")|" + filters.replace(" ", ";") + "|All files (*.*)|*.*"

        # back up to the folder below our current one.  save cwd in variable
        owd = os.getcwd()
        os.chdir(os.pardir)

        dialog = wx.FileDialog ( None, message = 'Select Virtual/Works Playlist File...', defaultDir=defDir, wildcard = wildcards, style = wxOPEN)

        
        # Open Dialog Box and get Selection
        if dialog.ShowModal() == wxID_OK:
            selected = dialog.GetPaths()
            for selection in selected:
                # All the hard work goes here...
                file = open(selection, 'r')
                lines = file.readlines()
                guiFunctions.statusText(self, "Playlist: " + selection + " selected...")
                tracksStart = False
                
            for line in lines:
                if tracksStart == True:
                    if line != "\n":
                        if line[0] != "#":
                            self.tc_FilesFolders.AppendText(line)
                if "type=" in line:
                    if "virtual" in line.lower():
                        self.combo_typeOptions.Select(1)
                    else:
                        self.combo_typeOptions.Select(0)
                if "title=" in line:
                    newLine = line.replace("title=","")
                    newLine = newLine.replace("\n","")
                    self.tc_Title.Value = newLine
                if "artist=" in line:
                    newLine = line.replace("artist=","")
                    newLine = newLine.replace("\n","")
                    self.tc_Artist.Value = newLine
                if "albumartist=" in line:
                    newLine = line.replace("albumartist=","")
                    newLine = newLine.replace("\n","")
                    self.tc_AlbumArtist.Value = newLine
                if "composer=" in line:
                    newLine = line.replace("composer=","")
                    newLine = newLine.replace("\n","")
                    self.tc_Composer.Value = newLine
                if "year=" in line:
                    newLine = line.replace("year=","")
                    newLine = newLine.replace("\n","")
                    self.tc_Year.Value = newLine
                if "genre=" in line:
                    newLine = line.replace("genre=","")
                    newLine = newLine.replace("\n","")
                    self.tc_Genre.Value = newLine
                if "cover=" in line:
                    newLine = line.replace("cover=","")
                    newLine = newLine.replace("\n","")
                    self.tc_Cover.Value = newLine
                if "discnumber=" in line:
                    newLine = line.replace("discnumber=","")
                    newLine = newLine.replace("\n","")
                    self.tc_DiscNumber.Value = newLine
                if "inserted=" in line:
                    pass
                if "created=" in line:
                    pass
                if "lastmodified" in line:
                    tracksStart = True
                    pass
        dialog.Destroy()

        # set back to original working directory
        os.chdir(owd)
示例#36
0
 def bt_FoldersToScanClearClick(self, event):
     self.tc_FilesFolders.Value = ""
     guiFunctions.statusText(self, "Cleared folder and track list...")
示例#37
0
    def bt_ExtractClick(self, event):
        global scanCMD
        global getOpts
        global startTime

        # Set Original Working Directory so we can get back to here.
        owd = os.getcwd()
        os.chdir(os.pardir)

        if os.name == 'nt':
            cmdroot = 'python '
        else:
            cmdroot = './'

        self.LogWindow.Enable()

        if self.tc_MainDatabase.Value == "":
            self.LogWindow.AppendText(
                "ERROR:\tNo source database name selected!\n")
        elif self.tc_TargetDatabase.Value == "":
            self.LogWindow.AppendText(
                "ERROR:\tNo target database name selected.\n")
        elif self.tc_MainDatabase.Value == self.tc_TargetDatabase.Value:
            self.LogWindow.AppendText(
                "ERROR:\tSource database and target database cannot be the same database!\n"
            )
        else:
            searchCMD = ""
            # Scrub the fields to see what our extract command should be.
            # Eventually stack these with some sort of AND query.

            if self.tc_DaysAgoCreated.Value != "":
                if searchCMD == "":
                    searchCMD = "where (julianday(datetime(\'now\')) - julianday(datetime(created, \'unixepoch\'))) " + self.combo_LogicalCreated.Value + " " + self.tc_DaysAgoCreated.Value
                else:
                    searchCMD += " AND where (julianday(datetime(\'now\')) - julianday(datetime(created, \'unixepoch\'))) " + self.combo_LogicalCreated.Value + " " + self.tc_DaysAgoCreated.Value

            if self.tc_DaysAgoInserted.Value != "":
                if searchCMD == "":
                    searchCMD = "where (julianday(datetime(\'now\')) - julianday(datetime(inserted, \'unixepoch\'))) " + self.combo_LogicalInserted.Value + " " + self.tc_DaysAgoInserted.Value
                else:
                    searchCMD += " AND where (julianday(datetime(\'now\')) - julianday(datetime(inserted, \'unixepoch\'))) " + self.combo_LogicalInserted.Value + " " + self.tc_DaysAgoInserted.Value

            if self.tc_DaysAgoModified.Value != "":
                if searchCMD == "":
                    searchCMD = "where (julianday(datetime(\'now\')) - julianday(datetime(lastmodified, \'unixepoch\'))) " + self.combo_LogicalModified.Value + " " + self.tc_DaysAgoModified.Value
                else:
                    searchCMD += " AND where (julianday(datetime(\'now\')) - julianday(datetime(lastmodified, \'unixepoch\'))) " + self.combo_LogicalModified.Value + " " + self.tc_DaysAgoModified.Value

            if self.tc_DaysAgoAccessed.Value != "":
                if searchCMD == "":
                    searchCMD = "where (julianday(datetime(\'now\')) - julianday(datetime(lastaccessed, \'unixepoch\'))) " + self.combo_LogicalAccessed.Value + " " + self.tc_DaysAgoAccessed.Value
                else:
                    searchCMD += " AND where (julianday(datetime(\'now\')) - julianday(datetime(lastaccessed, \'unixepoch\'))) " + self.combo_LogicalAccessed.Value + " " + self.tc_DaysAgoAccessed.Value

            if self.tc_Year.Value != "":
                if searchCMD == "":
                    searchCMD = "where year " + self.combo_LogicalYear.Value + " " + self.tc_Year.Value
                else:
                    searchCMD += " AND where year " + self.combo_LogicalYear.Value + " " + self.tc_Year.Value

            if self.tc_Genre.Value != "":
                if searchCMD == "":
                    searchCMD = "where genre=\'" + self.tc_Genre.Value + "\'"
                else:
                    searchCMD += " AND where genre=\'" + self.tc_Genre.Value + "\'"

            if self.tc_Artist.Value != "":
                if searchCMD == "":
                    searchCMD = "where artist=\'" + self.tc_Artist.Value + "\'"
                else:
                    searchCMD += " AND where artist=\'" + self.tc_Artist.Value + "\'"

            if self.tc_Composer.Value != "":
                if searchCMD == "":
                    searchCMD = " AND where composer=\'" + self.tc_Composer.Value + "\'"
                else:
                    searchCMD += " AND where composer=\'" + self.tc_Composer.Value + "\'"

            if self.tc_Bitrate.Value != "":
                if searchCMD == "":
                    searchCMD = "where bitrate " + self.combo_LogicalBitrate.Value + " " + self.tc_Bitrate.Value
                else:
                    searchCMD += "AND where bitrate " + self.combo_LogicalBitrate.Value + " " + self.tc_Bitrate.Value

            if self.tc_Last.Value != "":
                if searchCMD != "":
                    self.LogWindow.AppendText(
                        "You cannot combine Last " + self.tc_Last.Value +
                        " albums with other search options...")
                else:
                    searchCMD = "AS t WHERE t.created >= (SELECT a.created FROM albums AS a WHERE a.albumartistlist != 'Various Artists' ORDER BY a.created DESC LIMIT " + str(
                        int(self.tc_Last.Value) - 1) + ",1)"

            if searchCMD != "":
                searchCMD = "\"" + searchCMD + "\""

                if self.ck_OverwriteExisting.Value == True:
                    if os.path.exists(self.tc_TargetDatabase.Value) == True:
                        illegals = [
                            "/", "~", "!", "@", "#", "$", "%", "^", "&", "*",
                            "(", ")", "+", "=", ","
                        ]
                        for illegal in illegals:
                            if illegal in self.tc_TargetDatabase.Value:
                                self.LogWindow.AppendText(
                                    "\nERROR:\tInvalid target database! You cannot use "
                                    + illegal + " in the database name.")
                                return (1)
                        self.LogWindow.AppendText(
                            "\nRemoving file: " +
                            self.tc_TargetDatabase.Value +
                            " because 'Overwrite' is checked.")
                        os.remove(self.tc_TargetDatabase.Value)

                getOpts = ""
                if self.ck_ExtractVerbose.Value == True:
                    getOpts = "-v "

                scanCMD = cmdroot + "scan.py " + getOpts + "-d " + self.tc_MainDatabase.Value + " -x " + self.tc_TargetDatabase.Value + " -w " + searchCMD
                startTime = datetime.now()
                self.LogWindow.AppendText("[ Starting Extract ] (" +
                                          startTime.strftime("%T") + ")\n")
                self.LogWindow.AppendText("Extracting from " +
                                          self.tc_MainDatabase.Value +
                                          " into " +
                                          self.tc_TargetDatabase.Value + "\n")
                self.LogWindow.AppendText("Command: " + scanCMD + "\n\n")
                guiFunctions.statusText(
                    self, "Extracting from " + self.tc_MainDatabase.Value +
                    " into " + self.tc_TargetDatabase.Value + "...")

                # DEBUG ------------------------------------------------------------------------
                #                self.LogWindow.AppendText(scanCMD)
                # ------------------------------------------------------------------------------

                # Multithreading is below this line.
                if not self.worker:
                    self.worker = WorkerThread(self)
                    self.setButtons(False)
                    # set back to original working directory
                    os.chdir(owd)
# ------------------------------------------------------------------------------
            else:
                self.LogWindow.AppendText(
                    "\nERROR:\tYou have no extract options selected!")

            # set back to original working directory
            os.chdir(owd)
示例#38
0
 def bt_FoldersToScanClearClick(self, event):
     self.multiText.Value = ""
     guiFunctions.statusText(self, "Cleared folder list...")