diff -Nru pykaraoke-0.7.3/debian/changelog pykaraoke-0.7.5/debian/changelog --- pykaraoke-0.7.3/debian/changelog 2011-12-12 14:38:01.000000000 +0000 +++ pykaraoke-0.7.5/debian/changelog 2011-11-29 00:21:54.000000000 +0000 @@ -1,8 +1,14 @@ -pykaraoke (0.7.3-1build1) natty; urgency=low +pykaraoke (0.7.5-1) unstable; urgency=low - * Rebuild to add support for python 2.7. + [ Miriam Ruiz ] + * New Upstream Release. + * Upgraded Standards-Version from 3.8.4 to 3.9.2 + * Transitioned to dh_python2 + See: http://wiki.debian.org/Python/TransitionToDHPython2 + * Changed dependency from python-wxgtk2.6 + to python-wxgtk2.8 | python-wxgtk2.6 - -- Matthias Klose Fri, 03 Dec 2010 00:08:11 +0000 + -- Miriam Ruiz Thu, 24 Nov 2011 11:47:47 +0100 pykaraoke (0.7.3-1) unstable; urgency=low diff -Nru pykaraoke-0.7.3/debian/control pykaraoke-0.7.5/debian/control --- pykaraoke-0.7.3/debian/control 2011-12-12 14:38:01.000000000 +0000 +++ pykaraoke-0.7.5/debian/control 2011-11-24 10:52:27.000000000 +0000 @@ -4,17 +4,16 @@ Maintainer: Python Applications Packaging Team Uploaders: Miriam Ruiz Homepage: http://www.kibosh.org/pykaraoke/ -Build-Depends: debhelper (>= 5.0.37.2), python-all-dev (>= 2.5.4-1~), python-support (>= 0.4), - libsdl-dev | libsdl1.2-dev, python-pygame, python-wxgtk2.6, quilt +Build-Depends: debhelper (>= 5.0.37.2), python-all-dev (>= 2.6.6-3~), + libsdl-dev | libsdl1.2-dev, python-pygame, python-wxgtk2.8 | python-wxgtk2.6, quilt Vcs-Svn: svn://svn.debian.org/svn/python-apps/packages/pykaraoke/trunk/ Vcs-Browser: http://svn.debian.org/wsvn/python-apps/packages/pykaraoke/trunk/?op=log -Standards-Version: 3.8.4 +Standards-Version: 3.9.2 Package: pykaraoke Architecture: all -Depends: pykaraoke-bin (= ${source:Version}), - python-pykaraoke (>= ${source:Version}), - ${python:Depends}, python-pygame, python-wxgtk2.6, ${misc:Depends} +Depends: pykaraoke-bin (= ${source:Version}), python-pykaraoke (>= ${source:Version}), + ${python:Depends}, python-pygame, python-wxgtk2.8 | python-wxgtk2.6, ${misc:Depends} Suggests: python-numpy Description: free CDG/MIDI/MPEG karaoke player PyKaraoke is a free karaoke player. You can use this program to play your diff -Nru pykaraoke-0.7.3/debian/patches/remove_hashbangs.patch pykaraoke-0.7.5/debian/patches/remove_hashbangs.patch --- pykaraoke-0.7.3/debian/patches/remove_hashbangs.patch 2011-12-12 14:38:01.000000000 +0000 +++ pykaraoke-0.7.5/debian/patches/remove_hashbangs.patch 2011-11-28 23:27:08.000000000 +0000 @@ -1,43 +1,33 @@ -Index: pykaraoke-0.5.1/pycdg.py -=================================================================== ---- pykaraoke-0.5.1.orig/pycdg.py -+++ pykaraoke-0.5.1/pycdg.py +--- pykaraoke-0.7.5.orig/pycdg.py ++++ pykaraoke-0.7.5/pycdg.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # pycdg - CDG/MP3+G Karaoke Player -Index: pykaraoke-0.5.1/pykar.py -=================================================================== ---- pykaraoke-0.5.1.orig/pykar.py -+++ pykaraoke-0.5.1/pykar.py +--- pykaraoke-0.7.5.orig/pykar.py ++++ pykaraoke-0.7.5/pykar.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # pykar - KAR/MID Karaoke Player # -Index: pykaraoke-0.5.1/pykaraoke.py -=================================================================== ---- pykaraoke-0.5.1.orig/pykaraoke.py -+++ pykaraoke-0.5.1/pykaraoke.py +--- pykaraoke-0.7.5.orig/pykaraoke.py ++++ pykaraoke-0.7.5/pykaraoke.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # pykaraoke - Karaoke Player Frontend # -Index: pykaraoke-0.5.1/pykaraoke_mini.py -=================================================================== ---- pykaraoke-0.5.1.orig/pykaraoke_mini.py -+++ pykaraoke-0.5.1/pykaraoke_mini.py +--- pykaraoke-0.7.5.orig/pykaraoke_mini.py ++++ pykaraoke-0.7.5/pykaraoke_mini.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # pykaraoke - Karaoke Player Frontend # -Index: pykaraoke-0.5.1/pympg.py -=================================================================== ---- pykaraoke-0.5.1.orig/pympg.py -+++ pykaraoke-0.5.1/pympg.py +--- pykaraoke-0.7.5.orig/pympg.py ++++ pykaraoke-0.7.5/pympg.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python diff -Nru pykaraoke-0.7.3/debian/rules pykaraoke-0.7.5/debian/rules --- pykaraoke-0.7.3/debian/rules 2011-12-12 14:38:01.000000000 +0000 +++ pykaraoke-0.7.5/debian/rules 2011-11-24 10:51:00.000000000 +0000 @@ -55,7 +55,7 @@ rm -rf debian/python-pykaraoke/usr/bin dh_compress -i dh_fixperms -i - dh_pysupport -i + dh_python2 -i dh_installdeb -i dh_gencontrol -i dh_md5sums -i @@ -74,7 +74,7 @@ dh_compress -a dh_fixperms -a # dh_makeshlibs -a - dh_pysupport -a + dh_python2 -a dh_installdeb -a dh_shlibdeps -a dh_gencontrol -a diff -Nru pykaraoke-0.7.3/debian/source/format pykaraoke-0.7.5/debian/source/format --- pykaraoke-0.7.3/debian/source/format 2011-12-12 14:38:01.000000000 +0000 +++ pykaraoke-0.7.5/debian/source/format 2011-12-12 14:38:02.000000000 +0000 @@ -1 +1 @@ -1.0 +3.0 (quilt) diff -Nru pykaraoke-0.7.3/debian/source/options pykaraoke-0.7.5/debian/source/options --- pykaraoke-0.7.3/debian/source/options 1970-01-01 00:00:00.000000000 +0000 +++ pykaraoke-0.7.5/debian/source/options 2011-11-24 10:53:00.000000000 +0000 @@ -0,0 +1,5 @@ +# Bzip2 compression for debian.tar +compression = "bzip2" +compression-level = 7 +# Do not generate diff for changes in config.(sub|guess) +extend-diff-ignore = "(^|/)config.(sub|guess)$" diff -Nru pykaraoke-0.7.3/performer_prompt.py pykaraoke-0.7.5/performer_prompt.py --- pykaraoke-0.7.3/performer_prompt.py 2010-05-11 20:15:18.000000000 +0000 +++ pykaraoke-0.7.5/performer_prompt.py 2011-06-14 18:59:31.000000000 +0000 @@ -29,7 +29,7 @@ """ An interface for requesting a performer's name. """ def __init__(self, parent): """ Creates the interface. """ - wx.Dialog.__init__(self, parent, -1, "Karaoke Performer Prompt", size=(300, 70)) + wx.Dialog.__init__(self, parent, -1, "Karaoke Performer Prompt") # Add the performer prompt self.PerformerText = wx.StaticText(self, wx.ID_ANY, "Performer Name:") @@ -48,7 +48,7 @@ self.MainSizer = wx.BoxSizer(wx.VERTICAL) self.MainSizer.Add(self.PerformerSizer, 0, wx.ALL, 3) self.MainSizer.Add(self.ButtonSizer, 0, wx.ALL, 3) - self.SetSizer(self.MainSizer) + self.SetSizerAndFit(self.MainSizer) self.performer = "" self.PerformerTxtCtrl.SetFocus() diff -Nru pykaraoke-0.7.3/PKG-INFO pykaraoke-0.7.5/PKG-INFO --- pykaraoke-0.7.3/PKG-INFO 2010-05-11 20:19:07.000000000 +0000 +++ pykaraoke-0.7.5/PKG-INFO 2011-08-25 23:47:28.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: pykaraoke -Version: 0.7.3 +Version: 0.7.5 Summary: PyKaraoke = CD+G/MPEG/KAR Karaoke Player Home-page: http://www.kibosh.org/pykaraoke Author: Kelvin Lawson diff -Nru pykaraoke-0.7.3/pykaraoke.py pykaraoke-0.7.5/pykaraoke.py --- pykaraoke-0.7.3/pykaraoke.py 2010-05-11 20:15:18.000000000 +0000 +++ pykaraoke-0.7.5/pykaraoke.py 2011-08-22 23:41:29.000000000 +0000 @@ -536,7 +536,7 @@ # Window placement only seems to work reliably on Linux. Only # offer it there. self.DefaultPosCheckBox = None - if env == ENV_LINUX: + if env == ENV_POSIX: text = wx.StaticText(panel, -1, "Player Placement:") gsizer.Add(text, flag = wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, border = 5) pos_x = pos_y = '' @@ -1958,7 +1958,7 @@ # Empty the previous results and perform a new search self.StatusBar.SetStatusText ("Please Wait... Searching") songList = self.KaraokeMgr.SongDB.SearchDatabase( - str(self.SearchText.GetValue()), wxAppYielder()) + self.SearchText.GetValue(), wxAppYielder()) if self.KaraokeMgr.SongDB.GetDatabaseSize() == 0: setupString = "You do not have any songs in your database. Would you like to add folders now?" answer = wx.MessageBox(setupString, "Setup database now?", wx.YES_NO | wx.ICON_QUESTION) @@ -2161,7 +2161,11 @@ else: detailsString += '\nTitles file: ' + titles.Filepath + '\n' - wx.MessageBox(detailsString, song.DisplayFilename, wx.OK) + # Display string, handle non-unicode filenames that are byte-strings + try: + wx.MessageBox(detailsString, song.DisplayFilename, wx.OK) + except UnicodeDecodeError: + wx.MessageBox(detailsString.decode('ascii', 'replace'), song.DisplayFilename, wx.OK) def onResize(self, event): self.doResize(resize_event = True) @@ -3000,7 +3004,7 @@ ppiScreenX, ppiScreenY = self.GetPPIScreen() logScale = float(ppiPrinterX) / float(ppiScreenX) - if env == ENV_LINUX: + if env == ENV_POSIX: # For some reason on Linux this scale seems to come out a # little bit wrong. Experimentally, it seems it really # wants to be 1.0, but it always comes out 72/86 instead. diff -Nru pykaraoke-0.7.3/pykar.py pykaraoke-0.7.5/pykar.py --- pykaraoke-0.7.3/pykar.py 2010-05-11 20:15:18.000000000 +0000 +++ pykaraoke-0.7.5/pykar.py 2011-06-19 23:01:06.000000000 +0000 @@ -1024,16 +1024,6 @@ if env != ENV_WINDOWS: self.InternalOffsetTime += self.midifile.earliestNoteMS - if env == ENV_LINUX: - # For some reason, a further offset of -250 ms seems about - # right empirically, on Linux, but not on Windows or on - # the GP2X. - - # Actually, on further experimentation, this seems to be - # specific to my particular machine. Leave it out. - #self.InternalOffsetTime -= 250 - pass - # Now word-wrap the text to fit our window. self.lyrics = self.midifile.lyrics.wordWrapLyrics(self.font) diff -Nru pykaraoke-0.7.3/pykconstants.py pykaraoke-0.7.5/pykconstants.py --- pykaraoke-0.7.3/pykconstants.py 2010-05-11 20:15:18.000000000 +0000 +++ pykaraoke-0.7.5/pykconstants.py 2011-06-14 18:59:31.000000000 +0000 @@ -20,9 +20,10 @@ # Environment ENV_WINDOWS = 1 -ENV_LINUX = 2 +ENV_POSIX = 2 ENV_OSX = 3 ENV_GP2X = 4 +ENV_UNKNOWN = 5 # States STATE_INIT = 0 diff -Nru pykaraoke-0.7.3/pykdb.py pykaraoke-0.7.5/pykdb.py --- pykaraoke-0.7.3/pykdb.py 2010-05-11 20:15:18.000000000 +0000 +++ pykaraoke-0.7.5/pykdb.py 2011-08-25 18:19:21.000000000 +0000 @@ -437,8 +437,11 @@ # zip, too. for file in filelist: - data = zip.read(file) - songDatas.append(SongData(file, data)) + try: + data = zip.read(file) + songDatas.append(SongData(file, data)) + except: + print "Error in ZIP containing " + file else: # A non-zipped file; this is an easy case. songDatas.append(SongData(self.Filepath, None)) @@ -450,6 +453,18 @@ # the zip file. This time we are just looking for loose # files on the disk. for file in os.listdir(dir): + # Handle potential byte-strings with invalid characters + # that startswith() will not handle. + try: + file = unicode(file) + except UnicodeDecodeError: + file = file.decode("ascii", "replace") + try: + prefix = unicode(prefix) + except UnicodeDecodeError: + prefix = prefix.decode("ascii", "replace") + + # Check for a file which matches the prefix if file.startswith(prefix): path = os.path.join(dir, file) if path != self.Filepath: @@ -636,7 +651,7 @@ try: catalogFile = open(catalogPathname, "rU") except: - print "Could not open titles file %s" % (catalogPathname) + print "Could not open titles file %s" % (repr(catalogPathname)) return for line in catalogFile: @@ -644,7 +659,7 @@ line = line.decode('utf-8').strip() except UnicodeDecodeError: line = line.decode('utf-8', 'replace') - print "Invalid characters in %s:\n%s" % (catalogPathname, line) + print "Invalid characters in %s:\n%s" % (repr(catalogPathname), line) if line: tuple = line.split('\t') @@ -654,7 +669,7 @@ elif len(tuple) == 3: filename, title, artist = tuple else: - print "Invalid line in %s:\n%s" % (catalogPathname, line) + print "Invalid line in %s:\n%s" % (repr(catalogPathname), line) continue # Allow a forward slash in the file to stand in for @@ -664,7 +679,7 @@ pathname = os.path.join(dirname, filename) song = songDb.filesByFullpath.get(pathname, None) if song is None: - print "Unknown file in %s:\n%s" % (catalogPathname, filename) + print "Unknown file in %s:\n%s" % (repr(catalogPathname), repr(filename)) else: song.titles = self self.songs.append(song) @@ -709,7 +724,7 @@ try: catalogFile = open(catalogPathname, "w") except: - print "Could not rewrite titles file %s" % (catalogPathname) + print "Could not rewrite titles file %s" % (repr(catalogPathname)) return relTo = os.path.normcase(os.path.normpath(catalogPathname)) @@ -1384,10 +1399,15 @@ try: filedir_list = os.listdir(FolderToScan) except: - print "Couldn't scan %s" % (FolderToScan) + print "Couldn't scan %s" % (repr(FolderToScan)) return False - filedir_list.sort() + # Sort the list, using printable strings for the sort key to + # prevent issues with unicode characters in non-unicode strings + # in the list + filedir_list.sort(key=repr) + + # Loop through the list for i in range(len(filedir_list)): item = filedir_list[i] if self.BusyDlg.Clicked: @@ -1395,7 +1415,15 @@ # Allow windows to refresh now and again while scanning yielder.ConsiderYield() - full_path = os.path.join(FolderToScan, item) + + # Build the full file path. Check file types match, as + # os.listdir() can return non-unicode while the folder + # is still unicode. + if (type(FolderToScan) != type(item)): + full_path = os.path.join(str(FolderToScan), str(item)) + print "Folder %s and file %s do not match types" % (repr(FolderToScan), repr(item)) + else: + full_path = os.path.join(FolderToScan, item) nextProgress = progress + [(i, len(filedir_list))] self.fileScan(full_path, nextProgress, yielder) @@ -1429,6 +1457,11 @@ if now - self.lastBusyUpdate > 0.1: # Every so often, update the progress bar. basename = os.path.split(full_path)[1] + # Sanitise byte-strings + try: + basename = unicode(basename) + except UnicodeDecodeError: + basename = basename.decode("ascii", "replace") self.BusyDlg.SetProgress( "Scanning %s" % basename, self.__computeProgressValue(progress)) @@ -1456,7 +1489,7 @@ try: self.addSong(SongStruct(full_path, self.Settings, DatabaseAdd = True)) except KeyError: - print "Excluding filename with unexpected format: %s " % os.path.basename(full_path) + print "Excluding filename with unexpected format: %s " % repr(os.path.basename(full_path)) # Look inside ZIPs if configured to do so elif self.Settings.LookInsideZips and ext.lower() == ".zip": try: @@ -1471,8 +1504,13 @@ # Every so often, update the progress bar. nextProgress = progress + [(i, len(namelist))] basename = os.path.split(full_path)[1] + # Sanitise byte-strings + try: + basename = unicode(basename) + except UnicodeDecodeError: + basename = basename.decode("ascii", "replace") self.BusyDlg.SetProgress( - "Scanning %s" % (basename), + "Scanning %s" % basename, self.__computeProgressValue(nextProgress)) yielder.Yield() self.lastBusyUpdate = now @@ -1485,17 +1523,17 @@ # Python zipfile only supports deflated and stored info = zip.getinfo(filename) if info.compress_type == zipfile.ZIP_STORED or info.compress_type == zipfile.ZIP_DEFLATED: - #print ("Adding song %s in ZIP file %s"%(filename, full_path)) + #print ("Adding song %s in ZIP file %s"%(repr(filename), repr(full_path))) try: self.addSong(SongStruct(full_path, self.Settings, ZipStoredName = filename, DatabaseAdd = True)) except KeyError: - print "Excluding filename with unexpected format: %s " % os.path.basename(full_path) + print "Excluding filename with unexpected format: %s " % repr(os.path.basename(full_path)) else: - print ("ZIP member compressed with unsupported type (%d): %s"%(info.compress_type, full_path)) + print ("ZIP member compressed with unsupported type (%d): %s"%(info.compress_type, repr(full_path))) else: - print "Cannot parse ZIP file: " + full_path + print "Cannot parse ZIP file: " + repr(full_path) except: - print "Error looking inside zip " + full_path + print "Error looking inside zip " + repr(full_path) # Add a folder to the database search list def FolderAdd (self, FolderPath): @@ -1533,11 +1571,15 @@ LowerZipName = "" misses = 0 for term in TermsList: - if (term not in LowerTitle) and \ - (term not in LowerArtist) and \ - (term not in LowerZipName) and \ - (term not in LowerPath): - misses = misses + 1 + try: + if (term not in LowerTitle) and \ + (term not in LowerArtist) and \ + (term not in LowerZipName) and \ + (term not in LowerPath): + misses = misses + 1 + except UnicodeDecodeError: + print "Unicode error looking up %s in %s" % (repr(term), repr(LowerZipName)) + misses = misses + 1 if misses == 0: ResultsList.append(song) return ResultsList @@ -1751,13 +1793,31 @@ if self.BusyDlg.Clicked: return - song = self.FullSongList[i] + + # Calculate the MD5 hash of the songfile. m = md5() - m.update(song.GetSongDatas()[0].GetData()) - list = fileHashes.setdefault(m.digest(), []) - if list: - numDuplicates += 1 - list.append(i) + + # Get details of the associated files + song = self.FullSongList[i] + datas = song.GetSongDatas() + if len(datas) > 0: + song_data = datas[0] + # If the data has already been read in, use it directly. + # Otherwise read the file off disk for temporary use. + if song_data.data != None: + m.update(song_data.data) + else: + f = open(song_data.filename) + if f != None: + while True: + data = f.read(64*1024) + if not data: + break + m.update(data) + list = fileHashes.setdefault(m.digest(), []) + if list: + numDuplicates += 1 + list.append(i) # Remove the identical files from the database. If specified, # remove them from disk too. @@ -1765,7 +1825,7 @@ for list in fileHashes.values(): if len(list) > 1: filenames = map(lambda i: self.FullSongList[i].DisplayFilename, list) - print "Identical songs: %s" % (', '.join(filenames)) + print "Identical songs: %s" % repr((', '.join(filenames))) for i in list[1:]: extra = self.FullSongList[i] removeIndexes[i] = True diff -Nru pykaraoke-0.7.3/pykenv.py pykaraoke-0.7.5/pykenv.py --- pykaraoke-0.7.3/pykenv.py 2010-05-11 20:15:18.000000000 +0000 +++ pykaraoke-0.7.5/pykenv.py 2011-06-14 18:59:31.000000000 +0000 @@ -21,16 +21,15 @@ import os # Try to guess which environment we're running in. -env = 0 if os.name == "posix": (uname, host, release, version, machine) = os.uname() if host == "gp2x": env = ENV_GP2X - elif (uname.lower()[:5] == "linux"): - env = ENV_LINUX - else: + elif (uname.lower()[:6] == "darwin"): env = ENV_OSX -else: + else: + env = ENV_POSIX +elif os.name == "nt": env = ENV_WINDOWS - -#env = ENV_GP2X +else: + env = ENV_UNKNOWN diff -Nru pykaraoke-0.7.3/pykversion.py pykaraoke-0.7.5/pykversion.py --- pykaraoke-0.7.3/pykversion.py 2010-05-11 20:15:18.000000000 +0000 +++ pykaraoke-0.7.5/pykversion.py 2011-08-25 23:44:05.000000000 +0000 @@ -1,7 +1,7 @@ #****************************************************************************** #**** **** -#**** Copyright (C) 2010 Kelvin Lawson (kelvinl@users.sourceforge.net) **** -#**** Copyright (C) 2010 PyKaraoke Development Team **** +#**** Copyright (C) 2011 Kelvin Lawson (kelvinl@users.sourceforge.net) **** +#**** Copyright (C) 2011 PyKaraoke Development Team **** #**** **** #**** This library is free software; you can redistribute it and/or **** #**** modify it under the terms of the GNU Lesser General Public **** @@ -21,4 +21,4 @@ #****************************************************************************** # Version string -PYKARAOKE_VERSION_STRING = "0.7.3" +PYKARAOKE_VERSION_STRING = "0.7.5" diff -Nru pykaraoke-0.7.3/README.txt pykaraoke-0.7.5/README.txt --- pykaraoke-0.7.3/README.txt 2010-05-11 20:15:18.000000000 +0000 +++ pykaraoke-0.7.5/README.txt 2011-08-25 23:44:54.000000000 +0000 @@ -1,8 +1,8 @@ --------------------------------------------------------------------------- -Release: pykaraoke v0.7.3 -Date: 11/05/2010 +Release: pykaraoke v0.7.5 +Date: 26/08/2011 Author: Kelvin Lawson License: LGPL Website: http://www.kibosh.org/pykaraoke/ @@ -34,19 +34,6 @@ --------------------------------------------------------------------------- -WHAT'S NEW - -PyKaraoke now works together with WxPython v2.8. Users with WxPython v2.6 -are, however, still supported. - -There are also some other minor changes to the layout of the search results -page, a change to the scrolling behaviour, and improved handling of corrupt -CDG rip files. - -There are now vastly more options available on the Configure page. - ---------------------------------------------------------------------------- - INSTALLATION (LINUX, SOURCE INSTALLS) PyKaraoke requires the following libraries to be installed: