Exemplo n.º 1
0
 def nameIsValid(self, name):
     self.notify.debug('nameIsValid')
     if name in self.usedNames:
         return Localizer.ToonAlreadyExists % name
     problem = NameCheck.checkName(name)
     if problem:
         return problem
     return None
     return
Exemplo n.º 2
0
    def nameIsValid(self, name):
        self.notify.debug("nameIsValid")
        if name in self.usedNames:
            return Localizer.ToonAlreadyExists % name

        problem = NameCheck.checkName(name)
        if problem:
            return problem

        return None
Exemplo n.º 3
0
def checkNames(names, goodFlags=None):
    if goodFlags:
        pass
    for i in range(len(names)):
        name = names[i]
        problem = NameCheck.checkName(name.strip())
        if problem:
            print '   user msg: ' + problem
        if goodFlags:
            if problem:
                pass
Exemplo n.º 4
0
def checkNames(names, goodFlags = None):
    if goodFlags:
        pass
    1
    for i in range(len(names)):
        name = names[i]
        problem = NameCheck.checkName(name.strip())
        if problem:
            print '   user msg: ' + problem
        
        if goodFlags:
            if problem:
                pass
            1
Exemplo n.º 5
0
def checkNames(names, goodFlags=None):
    if goodFlags:
        # make sure they're the same length
        assert len(names) == len(goodFlags)
    for i in range(len(names)):
        name = names[i]
        # the game does the strip() in NameShop.py
        problem = NameCheck.checkName(name.strip())
        if problem:
            print('   user msg: ' + problem)
        if goodFlags:
            # make sure our results are consistent
            if problem:
                assert not goodFlags[i], "good name was rejected: '%s'" % name
            else:
                assert goodFlags[i], "bad name was accepted: '%s'" % name