Example #1
0
def validateLocalPath(directive, value):
    martian.validateText(directive, value)
    if os.path.sep in value:
        raise GrokImportError(
            "The '%s' directive can not contain path separator."
            % directive.name)
    # XXX kinda hackish...
    dirname = os.path.dirname(directive.frame.f_locals['__file__'])
    if not os.path.isdir(os.path.join(dirname, value)):
        raise GrokImportError(
            "The directory '%s' specified by the '%s' directive "
            "cannot be found." % (value, directive.name))
Example #2
0
 def validate(self, permission, *attrs):
     super(protect_get, self).validate(permission)
     for name in attrs:
         # TODO We should probably check whether 'name' is a valid
         # Python identifier
         martian.validateText(self, name)
Example #3
0
 def validate(self, permission, *attrs):
     super(protect_get, self).validate(permission)
     for name in attrs:
         # TODO We should probably check whether 'name' is a valid
         # Python identifier
         martian.validateText(self, name)
Example #4
0
def validateLocalPath(directive, value):
    martian.validateText(directive, value)
    if os.path.sep in value:
        raise GrokImportError("The '%s' directive can not contain path separator."
                               % directive.name)