Example #1
0
 def testConfigurationParser(self):
     ''' '''
     assemblyScanning = Assembly('Files scanner')
     registerListeners = RegisterListeners()
     registerListeners.patterns = ['file:///home/mihaigociu/Work/notifier_test/test1.txt',
                                   'file:///home/mihaigociu/Work/*/test1.txt']
     
     assemblyScanning.add(initialize(registerListeners), initialize(FileSystemScanner()))
     # assemblyScanning.add(initialize(RegisterListeners()))
     
     proc = assemblyScanning.create()
     assert isinstance(proc, Processing)
     
     proc.execute(FILL_ALL)
Example #2
0
    def testConfigurationParser(self):
        ''' '''
        assemblyScanning = Assembly('Files scanner')
        registerListeners = RegisterListeners()
        registerListeners.patterns = [
            'file:///home/mihaigociu/Work/notifier_test/test1.txt',
            'file:///home/mihaigociu/Work/*/test1.txt'
        ]

        assemblyScanning.add(initialize(registerListeners),
                             initialize(FileSystemScanner()))
        # assemblyScanning.add(initialize(RegisterListeners()))

        proc = assemblyScanning.create()
        assert isinstance(proc, Processing)

        proc.execute(FILL_ALL)
Example #3
0
 def createAssemplyParsing(self):
     parser = ParserHandler()
     parser.rootNode = RuleRoot()
     
     anonymous = parser.rootNode.addRule(GroupRule(), 'Config/Anonymous')
     captcha = parser.rootNode.addRule(GroupRule(), 'Config/Captcha')
     right = parser.rootNode.addRule(RightRule('name', 'inherits'), 'Config/Right')
     right.addRule(DescriptionRule(), 'Description')
     
     #allows = anonymous.addRule(AccessRule(), 'Allows')
     allows = Node('Allows')
     allows.addRule(AccessRule())
     #allows.addRule(MethodRule(fromAttributes=True))
     allows.addRule(URLRule(), 'URL')
     allows.addRule(MethodRule(), 'Method')
     
     action = Node('Action')
     action.addRule(ActionRule())
     action.childrens['Action'] = action
     
     actions = Node('Actions')
     actions.childrens['Action'] = action
     
     anonymous.childrens['Actions'] = actions
     anonymous.childrens['Action'] = action
     anonymous.childrens['Allows'] = allows
     
     #no actions for captcha
     captcha.childrens['Allows'] = allows
     
     right.childrens['Actions'] = actions
     right.childrens['Action'] = action
     right.childrens['Allows'] = allows
     
     assemblyParsing = Assembly('Parsing XML')
     assemblyParsing.add(initialize(parser))
     return assemblyParsing
Example #4
0
 def assemblyResourcesGateway():
     b = Assembly('Gateway REST resources')
     b.add(assemblyResources())
     b.replace(uri(), uriGateway())
     return b
Example #5
0
 def assemblyResourcesGateway():
     b = Assembly('Gateway REST resources')
     b.add(assemblyResources())
     b.replace(encoderPathResource(), encoderPathResourceGateway())
     return b