def validate_name(self, name, app_or_project):
    if (name is None):
        raise CommandError(('you must provide %s %s name' % (('an' if (app_or_project == 'app') else 'a'), app_or_project)))
    if (not re.search('^[_a-zA-Z]\\w*$', name)):
        if (not re.search('^[_a-zA-Z]', name)):
            message = 'make sure the name begins with a letter or underscore'
        else:
            message = 'use only numbers, letters and underscores'
        raise CommandError(('%r is not a valid %s name. Please %s.' % (name, app_or_project, message)))
def validate_name(self, name, app_or_project):
    if (name is None):
        raise CommandError(('you must provide %s %s name' % (('an' if (app_or_project == 'app') else 'a'), app_or_project)))
    if (not re.search('^[_a-zA-Z]\\w*$', name)):
        if (not re.search('^[_a-zA-Z]', name)):
            message = 'make sure the name begins with a letter or underscore'
        else:
            message = 'use only numbers, letters and underscores'
        raise CommandError(('%r is not a valid %s name. Please %s.' % (name, app_or_project, message)))