コード例 #1
0
def init(config):
    """
    init function
    """
    merge_config(config, VALIDATOR_CONFIG)
    
    TIDDLER_VALIDATORS.append(validate)
コード例 #2
0
def init(config):
    """
    init function
    """
    merge_config(config, VALIDATOR_CONFIG)

    TIDDLER_VALIDATORS.append(validate)
コード例 #3
0
ファイル: validator.py プロジェクト: TiddlySpace/tiddlyspace
        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)
コード例 #4
0
ファイル: lower.py プロジェクト: tiddlyweb/tiddlyweb-tutorial
def init(config):
    TIDDLER_VALIDATORS.append(lowerit)
コード例 #5
0
ファイル: validator.py プロジェクト: sethnz/tiddlyspace
        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)
コード例 #6
0
def init(config_in):
    """
    init function
    """
    TIDDLER_VALIDATORS.append(validate_tiddlywiki)
コード例 #7
0
						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)
コード例 #8
0
def init(config_in):
    """
    init function
    """
    TIDDLER_VALIDATORS.append(validate_tiddlywiki)
コード例 #9
0
ファイル: voting.py プロジェクト: FND/tiddlywiki-svn-mirror
def setup_validator():
  TIDDLER_VALIDATORS.extend([tiddlyvoting_validator])     
コード例 #10
0
def init(config):
    """
    add the validator to the current list
    """
    TIDDLER_VALIDATORS.append(check_recaptcha)
コード例 #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)
コード例 #12
0
ファイル: __init__.py プロジェクト: eternallyBaffled/tank
def make_validators():
    BAG_VALIDATORS.append(bag_quota)
    TIDDLER_VALIDATORS.append(binary_trap)
コード例 #13
0
ファイル: __init__.py プロジェクト: BillSeitz/tank
def make_validators():
    BAG_VALIDATORS.append(bag_quota)
    TIDDLER_VALIDATORS.append(binary_trap)
コード例 #14
0
def init(config):
    """
    add the validator to the current list
    """
    TIDDLER_VALIDATORS.append(check_recaptcha)
コード例 #15
0
def init(config_in):
    """
    init function
    """
    TIDDLER_VALIDATORS.append(sanitise_xss)