Skip to content

Commit

Permalink
Remove copy-pasted code from SongChoosingScene.
Browse files Browse the repository at this point in the history
  • Loading branch information
stump committed Jul 15, 2010
1 parent 5ebb3b3 commit f779422
Showing 1 changed file with 1 addition and 31 deletions.
32 changes: 1 addition & 31 deletions src/SongChoosingScene.py
Expand Up @@ -372,7 +372,7 @@ def prepareSetlist(self, songs):

for item in self.items:
if isinstance(item, Song.SongInfo):
self.removeSongOrderPrefixFromItem(item) #TODO: I don't like this.
item.name = Dialogs.removeSongOrderPrefixFromName(item.name) #TODO: I don't like this.
elif not self.tiersPresent and (isinstance(item, Song.TitleInfo) or isinstance(item, Song.SortTitleInfo)):
self.tiersPresent = True

Expand All @@ -394,36 +394,6 @@ def prepareSetlist(self, songs):
Dialogs.hideLoadingSplashScreen(self.engine, self.splash)
self.splash = None

def isInt(self, possibleInt): #copypaste
try:
#MFH - remove any leading zeros (for songs with 01. or 02. for example)
splitName = possibleInt.split("0",1)
while splitName[0] == "":
splitName = possibleInt.split("0",1)
if len(splitName) > 1:
if splitName[0] == "":
possibleInt = splitName[1]
if str(int(possibleInt)) == str(possibleInt):
#Log.debug("Dialogs.isInt: " + str(possibleInt) + " = TRUE")
return True
else:
#Log.debug("Dialogs.isInt: " + str(possibleInt) + " = FALSE")
return False
except Exception, e:
return False

def removeSongOrderPrefixFromItem(self, item): #copypaste
if not item.name.startswith("."):
splitName = item.name.split(".",1)
if self.isInt(splitName[0]) and len(splitName) > 1:
item.name = splitName[1]
splitName[0] = ""
while splitName[0] == "":
splitName = item.name.split(" ",1)
if len(splitName) > 1:
if splitName[0] == "":
item.name = splitName[1]

def checkCmdPlay(self):
info = Song.loadSongInfo(self.engine, self.songName, library = self.libraryName)
guitars = []
Expand Down

0 comments on commit f779422

Please sign in to comment.