Module ImportFrom alias alias alias alias alias alias alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ClassDef bases NameLoad body Expr Str Assign NameStore Num Assign NameStore Call NameLoad Str ListLoad Str Str Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Str NameLoad body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr keyword Str keyword Str keyword NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body If UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad keyword AttributeLoad NameLoad attr keyword Str keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return BoolOpAnd Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Raise Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Expr Call NameLoad AttributeLoad NameLoad attr Expr Call NameLoad AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Return BinOpAdd ListComp NameLoad comprehension NameStore NameLoad ListLoad Str Call AttributeLoad Str attr NameLoad Call AttributeLoad Str attr NameLoad Call AttributeLoad Str attr NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body TryExcept body Return SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Str handlers ExceptHandler type NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr keyword NameLoad Raise Call AttributeLoad NameLoad attr NameLoad ExceptHandler type NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Raise Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad Num TupleLoad AttributeLoad NameLoad attr Lambda arguments args NameParam defaults BinOpMult NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr Str Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore ListComp ListLoad Str NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr comprehension NameStore NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr NameLoad For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body If CompareIs NameLoad NameLoad body Expr Yield TupleLoad NameLoad NameLoad orelse If CompareIn Str NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr NameLoad Expr Yield TupleLoad NameLoad NameLoad orelse If CompareIn Str NameLoad body Expr Yield TupleLoad Call AttributeLoad NameLoad attr Str NameLoad orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr NameLoad decorator_list decorator_list
N/A __future__ absolute_import division generators nested_scopes print_function unicode_literals with_statement N/A functools N/A json N/A logging N/A os collections namedtuple pants.pantsd.process_manager ProcessManager pants.pantsd.watchman_client StreamableWatchmanClient pants.util.dirutil safe_file_dump safe_mkdir pants.util.retry retry_on_exception Watchman N/A ProcessManager N/A N/A Watchman process manager and helper class. N/A SOCKET_TIMEOUT_SECONDS 5.0 N/A EventHandler N/A namedtuple EventHandler N/A name metadata callback __init__ N/A N/A self watchman_path work_dir log_level timeout N/A 1 SOCKET_TIMEOUT_SECONDS N/A N/A 
    :param str watchman_path: The path to the watchman binary.
    :param str work_dir: The path to the pants work dir.
    :param float timeout: The watchman socket timeout (in seconds).
    :param str log_level: The watchman log level. Watchman has 3 log levels: '0' for no logging,
                          '1' for standard logging and '2' for verbose logging.
     N/A N/A N/A N/A super Watchman self __init__ name watchman process_name watchman socket_type str N/A N/A self _watchman_path N/A N/A self _normalize_watchman_path watchman_path N/A N/A self _watchman_work_dir N/A N/A N/A os path join work_dir N/A self name N/A N/A self _log_level log_level N/A N/A self _timeout timeout N/A N/A self _state_file N/A N/A N/A os path join N/A self _watchman_work_dir N/A N/A {}.state format N/A self name N/A N/A self _log_file N/A N/A N/A os path join N/A self _watchman_work_dir N/A N/A {}.log format N/A self name N/A N/A self _sock_file N/A N/A N/A os path join N/A self _watchman_work_dir N/A N/A {}.sock format N/A self name N/A N/A self _logger N/A N/A logging getLogger __name__ N/A N/A self _watchman_client None N/A client N/A N/A self N/A N/A N/A N/A N/A self _watchman_client N/A N/A N/A self _watchman_client N/A N/A self _make_client N/A N/A self _watchman_client N/A property _make_client N/A N/A self N/A N/A N/A Create a new watchman client using the BSER protocol over a UNIX socket. N/A N/A StreamableWatchmanClient sockpath N/A self socket transport local timeout N/A self _timeout N/A _is_valid_executable N/A N/A self binary_path N/A N/A N/A N/A N/A N/A N/A os path isfile binary_path N/A N/A os access binary_path N/A os X_OK N/A _normalize_watchman_path N/A N/A self watchman_path N/A N/A N/A N/A N/A N/A self _is_valid_executable watchman_path N/A N/A N/A N/A self ExecutionError N/A N/A invalid watchman binary at {}! format watchman_path N/A N/A N/A N/A os path abspath watchman_path N/A _maybe_init_metadata N/A N/A self N/A N/A N/A N/A N/A N/A self _logger debug N/A N/A ensuring creation of directory: {} format N/A self _watchman_work_dir N/A N/A safe_mkdir N/A self _watchman_work_dir N/A N/A safe_file_dump N/A self _state_file {} N/A _construct_cmd N/A N/A self cmd_parts state_file sock_file log_file log_level N/A N/A N/A N/A N/A part N/A part cmd_parts N/A --no-save-state N/A N/A --statefile={} format state_file N/A N/A --sockname={} format sock_file N/A N/A --logfile={} format log_file --log-level log_level N/A _parse_pid_from_output N/A N/A self output N/A N/A N/A N/A N/A N/A N/A N/A json loads output N/A pid N/A N/A N/A ValueError N/A N/A N/A N/A N/A self _logger critical N/A N/A invalid output from watchman!
{output!s} format output output N/A N/A N/A self InvalidCommandOutput output N/A N/A KeyError N/A N/A N/A N/A N/A self _logger critical no pid from watchman! N/A N/A N/A self InvalidCommandOutput output N/A launch N/A N/A self N/A N/A N/A Launch and synchronously write metadata.

    This is possible due to watchman's built-in async server startup - no double-forking required.
     N/A cmd N/A N/A self _construct_cmd N/A N/A self _watchman_path get-pid state_file N/A self _state_file sock_file N/A self _sock_file log_file N/A self _log_file log_level N/A str N/A self _log_level N/A N/A N/A N/A self _logger debug N/A N/A watchman cmd is: {} format N/A N/A join cmd N/A N/A N/A self _maybe_init_metadata N/A get_output N/A N/A functools partial N/A self get_subprocess_output cmd N/A output N/A retry_on_exception get_output 3 N/A N/A self ExecutionError N/A N/A N/A n N/A N/A n 0.5 N/A pid N/A N/A self _parse_pid_from_output output N/A N/A N/A self write_pid pid N/A N/A N/A self write_socket N/A self _sock_file N/A watch_project N/A N/A self path N/A N/A N/A Issues the watch-project command to watchman to begin watching the buildroot.

    :param string path: the path to the watchman project root/pants build root.
     N/A N/A N/A N/A self client query watch-project N/A N/A N/A os path realpath path N/A subscribed N/A N/A self build_root handlers N/A N/A N/A Bulk subscribe generator for StreamableWatchmanClient.

    :param str build_root: the build_root for all subscriptions.
    :param iterable handlers: a sequence of Watchman.EventHandler namedtuple objects.
    :yields: a stream of tuples in the form (subscription_name: str, subscription_event: dict).
     N/A command_list N/A N/A subscribe build_root N/A handler name N/A handler metadata N/A handler handlers N/A N/A N/A N/A self _logger debug N/A N/A watchman command_list is: {} format command_list N/A event N/A N/A N/A self client stream_query command_list N/A N/A N/A event None N/A N/A N/A N/A None None N/A N/A N/A subscribe event N/A N/A N/A N/A N/A self _logger info N/A N/A confirmed watchman subscription: {} format event N/A N/A N/A None None N/A N/A N/A subscription event N/A N/A N/A N/A N/A N/A event get subscription event N/A N/A N/A N/A N/A self _logger warning N/A N/A encountered non-subscription event: {} format event N/A N/A