diff --git a/src/python/pants/pantsd/lumberjack/BUILD b/src/python/pants/pantsd/lumberjack/BUILD new file mode 100644 index 00000000000..a130d10215d --- /dev/null +++ b/src/python/pants/pantsd/lumberjack/BUILD @@ -0,0 +1,10 @@ +# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). +# Licensed under the Apache License, Version 2.0 (see LICENSE). + +python_binary( + name = 'lumberjack', + source = 'lumberjack.py', + dependencies = [ + 'src/python/pants/pantsd/service:fs_event_service', + ] +) diff --git a/src/python/pants/pantsd/lumberjack/__init__.py b/src/python/pants/pantsd/lumberjack/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/python/pants/pantsd/lumberjack/lumberjack.py b/src/python/pants/pantsd/lumberjack/lumberjack.py new file mode 100644 index 00000000000..c44c731a634 --- /dev/null +++ b/src/python/pants/pantsd/lumberjack/lumberjack.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). +# Licensed under the Apache License, Version 2.0 (see LICENSE). + +from __future__ import (absolute_import, division, generators, nested_scopes, print_function, + unicode_literals, with_statement) + +from collections import namedtuple + +from pants.pantsd.service.fs_event_service import FSEventService + + +class TestExecutor(object): + FakeFuture = namedtuple('FakeFuture', ['done', 'result']) + + def submit(self, closure, *args, **kwargs): + result = closure(*args, **kwargs) + return self.FakeFuture(lambda: True, lambda: result) + + +class LumberJack: + BUILD_ROOT = '/Users/sserebryakov/workspace/source' + + def run(self): + self.service = FSEventService(self.BUILD_ROOT, TestExecutor()) + self.service.register_simple_handler('BUILD', lambda x: print(x)) + self.service.run() + + +if __name__ == '__main__': + LumberJack().run()