コード例 #1
0
ファイル: fileparsers.py プロジェクト: lxq2537664558/pydance
 def find_subtitle(self):
     self.info["realtitle"] = self.info["title"]
     if "subtitle" not in self.info:
         title, subtitle = util.find_subtitle(self.info["title"])
         if subtitle:
             self.info["title"] = title.strip()
             self.info["subtitle"] = subtitle.strip()
コード例 #2
0
ファイル: fileparsers.py プロジェクト: EvilDrW/pydance
 def find_subtitle(self):
   self.info["realtitle"] = self.info["title"]
   if "subtitle" not in self.info:
     title, subtitle = util.find_subtitle(self.info["title"])
     if subtitle:
       self.info["title"] = title.strip()
       self.info["subtitle"] = subtitle.strip()
コード例 #3
0
    def generate_songlist(self, recordkeys, game):
        i = 1
        for name, diff, mods in self.course.songs:
            if "*" in name: name, subtitle = "??????????", ""
            elif name[0] == _("BEST"):
                song = recordkeys.get(records.best(name[1], diff, game))
                if song:
                    subtitle = (song.info["subtitle"]
                                or "") + (_(" (Best #%d)") % name[1])
                    name = song.info["title"]
                else:
                    name = _("Player's Best Unavailable")
                    subtitle = _("(You need to play more songs!)")

            elif name[0] == _("WORST"):
                song = recordkeys.get(records.worst(name[1], diff, game))
                if song:
                    subtitle = (song.info["subtitle"]
                                or "") + (_(" (Worst #%d)") % name[1])
                    name = song.info["title"]
                else:
                    name = _("Player's Worst Unavailable")
                    subtitle = _("(You need to play more songs!)")

            elif name[0] == _("LIKES"):
                song = recordkeys.get(records.like(name[1], diff, game))
                if song:
                    subtitle = (song.info["subtitle"]
                                or "") + (" (Likes #%d)" % name[1])
                    name = song.info["title"]
                else:
                    name = _("Player's Likes Unavailable")
                    subtitle = _("(You need to play more songs!)")

            elif name[0] == _("DISLIKES"):
                song = recordkeys.get(records.dislike(name[1], diff, game))
                if song:
                    subtitle = ((song.info["subtitle"] or "") +
                                (_(" (Dislikes #%d)") % name[1]))
                    name = song.info["title"]
                else:
                    name = _("Player's Dislikes Unavailable")
                    subtitle = _("(You need to play more songs!)")

            else:
                name, subtitle = util.find_subtitle(name.split("/")[-1])

            if "." in diff: diff = "?"

            name = ("%d. " % i) + name
            self._songs.append([name, subtitle, diff])
            i += 1
コード例 #4
0
ファイル: courseselect.py プロジェクト: EvilDrW/pydance
  def generate_songlist(self, recordkeys, game):
    i = 1
    for name, diff, mods in self.course.songs:
      if "*" in name: name, subtitle = "??????????", ""
      elif name[0] == _("BEST"):
        song = recordkeys.get(records.best(name[1], diff, game))
        if song:
          subtitle = (song.info["subtitle"] or "") + (_(" (Best #%d)") % name[1])
          name = song.info["title"]
        else:
          name = _("Player's Best Unavailable")
          subtitle = _("(You need to play more songs!)")

      elif name[0] == _("WORST"):
        song = recordkeys.get(records.worst(name[1], diff, game))
        if song:
          subtitle = (song.info["subtitle"] or "") + (_(" (Worst #%d)") % name[1])
          name = song.info["title"]
        else:
          name = _("Player's Worst Unavailable")
          subtitle = _("(You need to play more songs!)")

      elif name[0] == _("LIKES"):
        song = recordkeys.get(records.like(name[1], diff, game))
        if song:
          subtitle = (song.info["subtitle"] or "") + (" (Likes #%d)" % name[1])
          name = song.info["title"]
        else:
          name = _("Player's Likes Unavailable")
          subtitle = _("(You need to play more songs!)")

      elif name[0] == _("DISLIKES"):
        song = recordkeys.get(records.dislike(name[1], diff, game))
        if song:
          subtitle = ((song.info["subtitle"] or "") +
                      (_(" (Dislikes #%d)") % name[1]))
          name = song.info["title"]
        else:
          name = _("Player's Dislikes Unavailable")
          subtitle = _("(You need to play more songs!)")

      else: name, subtitle = util.find_subtitle(name.split("/")[-1])

      if "." in diff: diff = "?"

      name = ("%d. " % i) + name
      self._songs.append([name, subtitle, diff])
      i += 1