def init(config):
    """
    init function
    """
    merge_config(config, VALIDATOR_CONFIG)
    
    TIDDLER_VALIDATORS.append(validate)
def init(config):
    """
    init function
    """
    merge_config(config, VALIDATOR_CONFIG)

    TIDDLER_VALIDATORS.append(validate)
Exemplo n.º 3
0
        tiddler.tags = []
        tiddler.fields = {}
        tiddler.fields['mapped_user'] = environ['tiddlyweb.usersign']['name']
    return tiddler


def validate_mapspace(tiddler, environ):
    """
    If a tiddler is put to the MAPSPACE bag clear
    out the tiddler and set fields['mapped_space']
    to the current space.

    Elsewhere in the space the mapped_space can map
    a alien domain to space.
    """
    if tiddler.bag == 'MAPSPACE':
        current_space = determine_space(environ, determine_host(environ)[0])
        recipe_name = determine_space_recipe(environ, current_space)
        if recipe_name != '%s_private' % current_space:
            raise InvalidTiddlerError('non member may not map space')

        tiddler.text = ''
        tiddler.tags = []
        tiddler.fields = {}
        tiddler.fields['mapped_space'] = current_space
    return tiddler


TIDDLER_VALIDATORS.append(validate_mapuser)
TIDDLER_VALIDATORS.append(validate_mapspace)
Exemplo n.º 4
0
def init(config):
    TIDDLER_VALIDATORS.append(lowerit)
Exemplo n.º 5
0
        tiddler.tags = []
        tiddler.fields = {}
        tiddler.fields['mapped_user'] = environ['tiddlyweb.usersign']['name']
    return tiddler


def validate_mapspace(tiddler, environ):
    """
    If a tiddler is put to the MAPSPACE bag clear
    out the tiddler and set fields['mapped_space']
    to the current space.

    Elsewhere in the space the mapped_space can map
    a alien domain to space.
    """
    if tiddler.bag == 'MAPSPACE':
        current_space = determine_space(environ, determine_host(environ)[0])
        recipe_name = determine_space_recipe(environ, current_space)
        if recipe_name != '%s_private' % current_space:
            raise InvalidTiddlerError('non member may not map space')

        tiddler.text = ''
        tiddler.tags = []
        tiddler.fields = {}
        tiddler.fields['mapped_space'] = current_space
    return tiddler


TIDDLER_VALIDATORS.append(validate_mapuser)
TIDDLER_VALIDATORS.append(validate_mapspace)
def init(config_in):
    """
    init function
    """
    TIDDLER_VALIDATORS.append(validate_tiddlywiki)
						call(['convert', svgPath, pngPath])
				try:
						f = open(pngPath, "rb")
						return f.readlines()
				except IOError:
						return ""

		def list_tiddlers(self, bag):
				return ""

		def list_recipes(self, recipes):
				return ""
		def list_bags(self, bags):
				return ""

def update_image_cache(tiddler, environ):
		path = "%s/%s/%s.png"%(CACHE_LOCATION, tiddler.bag, tiddler.title)
		svgPath = "%s.svg"%path
		pngPath = "%s.png"%path
		if ".." not in path:
			try:
				os.remove(svgPath)
			except OSError:
				pass
			try:
				os.remove(pngPath)
			except OSError:
				pass

TIDDLER_VALIDATORS.append(update_image_cache)
def init(config_in):
    """
    init function
    """
    TIDDLER_VALIDATORS.append(validate_tiddlywiki)
Exemplo n.º 9
0
def setup_validator():
  TIDDLER_VALIDATORS.extend([tiddlyvoting_validator])     
Exemplo n.º 10
0
def init(config):
    """
    add the validator to the current list
    """
    TIDDLER_VALIDATORS.append(check_recaptcha)
Exemplo n.º 11
0
            return f.readlines()
        except IOError:
            return ""

    def list_tiddlers(self, bag):
        return ""

    def list_recipes(self, recipes):
        return ""

    def list_bags(self, bags):
        return ""


def update_image_cache(tiddler, environ):
    path = "%s/%s/%s.png" % (CACHE_LOCATION, tiddler.bag, tiddler.title)
    svgPath = "%s.svg" % path
    pngPath = "%s.png" % path
    if ".." not in path:
        try:
            os.remove(svgPath)
        except OSError:
            pass
        try:
            os.remove(pngPath)
        except OSError:
            pass


TIDDLER_VALIDATORS.append(update_image_cache)
Exemplo n.º 12
0
def make_validators():
    BAG_VALIDATORS.append(bag_quota)
    TIDDLER_VALIDATORS.append(binary_trap)
Exemplo n.º 13
0
def make_validators():
    BAG_VALIDATORS.append(bag_quota)
    TIDDLER_VALIDATORS.append(binary_trap)
Exemplo n.º 14
0
def init(config):
    """
    add the validator to the current list
    """
    TIDDLER_VALIDATORS.append(check_recaptcha)
Exemplo n.º 15
0
def init(config_in):
    """
    init function
    """
    TIDDLER_VALIDATORS.append(sanitise_xss)