Skip to content

Commit

Permalink
buildgraph #1
Browse files Browse the repository at this point in the history
  • Loading branch information
megaserg committed Oct 7, 2015
1 parent 1e40756 commit c048752
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/python/pants/pantsd/lumberjack/BUILD
Original file line number Diff line number Diff line change
@@ -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',
]
)
Empty file.
31 changes: 31 additions & 0 deletions src/python/pants/pantsd/lumberjack/lumberjack.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit c048752

Please sign in to comment.