Ejemplo n.º 1
0
 def getGameSaveName(self, id):
     if os.path.supports_unicode_filenames:
         return self.getGameTitleName(id)
     n = self.gdb.get(id).en_name  # english name
     if not n:
         return None
     return re.sub(r"[\s]", "_", latin1_normalize(n))
Ejemplo n.º 2
0
 def getGameRulesFilename(self, id):
     gi = self.gdb.get(id)
     if gi is None:
         return None
     if gi.rules_filename is not None:
         return gi.rules_filename
     n = latin1_normalize(gi.en_name) + '.html'  # english name
     f = os.path.join(self.dataloader.dir, "html", "rules", n)
     if not os.path.exists(f):
         n = ''
     gi.rules_filename = n  # cache the filename for next use
     return n
Ejemplo n.º 3
0
def _get_game_rules_filename(n):
    if n.startswith('Mahjongg'):
        return 'mahjongg.html'
    return latin1_normalize(n) + '.html'
Ejemplo n.º 4
0
def getGameRulesFilename(n):
    if n.startswith('Mahjongg'):
        return 'mahjongg.html'
    return latin1_normalize(n) + '.html'
Ejemplo n.º 5
0
 def test_output(self):
     self.assertEqual(latin1_normalize('HELLO%%good'), 'hellogood')
Ejemplo n.º 6
0
 def test_output(self):
     self.assertEqual(latin1_normalize('HELLO%%good'), 'hellogood')
Ejemplo n.º 7
0
def getGameRulesFilename(n):
    if n.startswith('Mahjongg'):
        return 'mahjongg.html'
    return latin1_normalize(n) + '.html'