예제 #1
0
파일: setglobal.py 프로젝트: AoJ/alex
 def __init__(self, scenario, args):
     """\
     Constructor, sets the arguments given to this block as global.
     """
     Block.__init__(self, scenario, args)
     for arg, value in args.iteritems():
         scenario.global_args[arg] = value
예제 #2
0
 def __init__(self, scenario, args):
     """\
     Constructor, sets the arguments given to this block as global.
     """
     Block.__init__(self, scenario, args)
     for arg, value in args.iteritems():
         scenario.global_args[arg] = value
예제 #3
0
 def __init__(self, scenario, args):
     """\
     Constructor, just checking the argument values.
     """
     Block.__init__(self, scenario, args)
     if self.language is None:
         raise LoadingException('Language must be defined!')
     self.lexicon = Lexicon()
 def __init__(self, scenario, args):
     """\
     Constructor, just checking the argument values.
     """
     Block.__init__(self, scenario, args)
     if self.language is None:
         raise LoadingException('Language must be defined!')
     self.lexicon = Lexicon()
예제 #5
0
 def __init__(self, scenario, args):
     """\
     Constructor, checks if language is set and selects encoding according
     to args, defauts to UTF-8.
     """
     Block.__init__(self, scenario, args)
     if self.language is None:
         raise LoadingException('Language must be defined!')
     self.encoding = args.get('encoding', 'UTF-8')
예제 #6
0
파일: eval.py 프로젝트: henrypig/alex-1
 def __init__(self, scenario, args):
     "Constructor, checking the argument values"
     Block.__init__(self, scenario, args)
     # just check if there is any valid argument in the argument dictionary
     if not [
             True for arg in args.keys() if arg in self.__class__.valid_args
     ]:
         raise LoadingException(
             'No valid argument given (document, bundle, zone, X(tree|node)'
         )
예제 #7
0
 def __init__(self, scenario, args):
     "Empty constructor (just call the base constructor)"
     Block.__init__(self, scenario, args)
     self.to = None
     self.path = None
     self.add_to_name = None
     if 'to' in args:
         self.to = args['to']
     elif 'path' in args:
         self.path = args['path']
     elif 'add_to_name' in args:
         self.add_to_name = args['add_to_name']
예제 #8
0
파일: copytree.py 프로젝트: AoJ/alex
 def __init__(self, scenario, args):
     "Constructor, checking the argument values"
     Block.__init__(self, scenario, args)
     if self.language is None: 
         raise LoadingException('Language must be defined!')
     self.source_language = args.get('source_language') or self.language
     self.source_selector = args.get('source_selector')
     if self.source_selector is None: self.source_selector = self.selector
     if self.language == self.source_language and self.selector == self.source_selector:
         raise LoadingException('Can\'t copy tree: destination and source zones are the same!')
     self.layer = args.get('layer')
     if not self.layer:
         raise LoadingException('Can\'t copy tree: layer must be given!')
예제 #9
0
 def __init__(self, scenario, args):
     "Constructor, checking the argument values"
     Block.__init__(self, scenario, args)
     if self.language is None:
         raise LoadingException('Language must be defined!')
     self.source_language = args.get('source_language') or self.language
     self.source_selector = args.get('source_selector')
     if self.source_selector is None: self.source_selector = self.selector
     if self.language == self.source_language and self.selector == self.source_selector:
         raise LoadingException(
             'Can\'t copy tree: destination and source zones are the same!')
     self.layer = args.get('layer')
     if not self.layer:
         raise LoadingException('Can\'t copy tree: layer must be given!')
예제 #10
0
파일: copyttree.py 프로젝트: AoJ/alex
 def __init__(self, scenario, args):
     "Constructor, checking the argument values"
     Block.__init__(self, scenario, args)
     if self.language is None:
         raise LoadingException('Language must be defined!')
예제 #11
0
파일: eval.py 프로젝트: AoJ/alex
 def __init__(self, scenario, args):
     "Constructor, checking the argument values"
     Block.__init__(self, scenario, args)
     # just check if there is any valid argument in the argument dictionary 
     if not [True for arg in args.keys() if arg in self.__class__.valid_args]:
         raise LoadingException('No valid argument given (document, bundle, zone, X(tree|node)')        
예제 #12
0
 def __init__(self, scenario, args):
     "Constructor, checking the argument values"
     Block.__init__(self, scenario, args)
     if self.language is None:
         raise LoadingException('Language must be defined!')
예제 #13
0
 def __init__(self, scenario, args):
     "Empty constructor (just call the base constructor)"
     Block.__init__(self, scenario, args)
예제 #14
0
파일: yaml.py 프로젝트: sih4sing5hong5/alex
 def __init__(self, scenario, args):
     "Empty constructor (just call the base constructor)"
     Block.__init__(self, scenario, args)