DEFAULT_NG_PORT = 2113 # For backwards compatibility with nails expecting the ng c client special env vars. ENV_DEFAULTS = dict( NAILGUN_FILESEPARATOR = os.sep, NAILGUN_PATHSEPARATOR = os.pathsep ) # See: http://www.martiansoftware.com/nailgun/protocol.html HEADER_FMT = '>Ic' HEADER_LENGTH = 5 BUFF_SIZE = 8096 log = logger(name = 'ng') def _send_chunk(sock, command, payload=''): header = struct.pack(HEADER_FMT, len(payload), command) sock.sendall(header + payload) class ProtocolError(Exception): """ Thrown if there is an error in the underlying nailgun protocol. """ class NailgunSession(object): """
from twitter.common.log import logger DEFAULT_NG_HOST = 'localhost' DEFAULT_NG_PORT = 2113 # For backwards compatibility with nails expecting the ng c client special env vars. ENV_DEFAULTS = dict(NAILGUN_FILESEPARATOR=os.sep, NAILGUN_PATHSEPARATOR=os.pathsep) # See: http://www.martiansoftware.com/nailgun/protocol.html HEADER_FMT = '>Ic' HEADER_LENGTH = 5 BUFF_SIZE = 8096 log = logger(name='ng') def _send_chunk(sock, command, payload=''): header = struct.pack(HEADER_FMT, len(payload), command) sock.sendall(header + payload) class ProtocolError(Exception): """ Thrown if there is an error in the underlying nailgun protocol. """ class NailgunSession(object): """
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) import os from twitter.common.lang import Compatibility from twitter.common.log import logger from pants.base.config import Config log = logger(name='rcfile') class RcFile(object): """Handles rcfile-style configuration files. Precedence is given to rcfiles that come last in the given sequence of paths. The effect is as if each rcfile in paths overlays the next in a walk from left to right. """ # TODO(John Sirois): localize handling of this flag value back into pants_exe.py once the new old # split is healed. _DISABLE_PANTS_RC_OPTION = '--no-pantsrc' @staticmethod def install_disable_rc_option(parser):
# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ================================================================================================== import os from twitter.common.lang import Compatibility from twitter.common.log import logger from twitter.pants.base.config import Config log = logger(name='rcfile') class RcFile(object): """Encapsulates pants rcfile handling.""" # TODO(John Sirois): localize handling of this flag value back into pants_exe.py once the new old # split is healed. _DISABLE_PANTS_RC_OPTION = '--no-pantsrc' @staticmethod def install_disable_rc_option(parser): parser.add_option( RcFile._DISABLE_PANTS_RC_OPTION, action='store_true', dest='nopantsrc',
division, absolute_import, with_statement, print_function, unicode_literals, ) import os from twitter.common.lang import Compatibility from twitter.common.log import logger from pants.base.config import Config log = logger(name="rcfile") class RcFile(object): """Handles rcfile-style configuration files. Precedence is given to rcfiles that come last in the given sequence of paths. The effect is as if each rcfile in paths overlays the next in a walk from left to right. """ # TODO(John Sirois): localize handling of this flag value back into pants_exe.py once the new old # split is healed. _DISABLE_PANTS_RC_OPTION = "--no-pantsrc" @staticmethod def install_disable_rc_option(parser):