<commit_before>#!/usr/bin/python
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""Chromite."""

# Python imports
import ConfigParser
import cPickle
import optparse
import os
import sys
import tempfile


# Local library imports
from lib import text_menu
from lib.cros_build_lib import Die
from lib.cros_build_lib import Info
from lib.cros_build_lib import IsInsideChroot
from lib.cros_build_lib import RunCommand
from lib.cros_build_lib import Warning as Warn


# Find the Chromium OS root and Chromite root...
_CHROMITE_PATH = os.path.dirname(os.path.realpath(__file__))
_SRCROOT_PATH = os.path.realpath(os.path.join(_CHROMITE_PATH, '..'))


# Commands can take one of these two types of specs.  Note that if a command
# takes a build spec, we will find the associated chroot spec.  This should be
# a human-readable string.  It is printed and also is the name of the spec
# directory.
_BUILD_SPEC_TYPE = 'build'
_CHROOT_SPEC_TYPE = 'chroot'


# This is a special target that indicates that you want to do something just
# to the host.  This means different things to different commands.
# TODO(dianders): Good idea or bad idea?
_HOST_TARGET = 'HOST'


# Define command handlers and command strings.  We define them in this way
# so that someone searching for what calls _CmdXyz can find it easy with a grep.
#
# ORDER MATTERS here when we show the menu.
#
# TODO(dianders): Make a command superclass, then make these subclasses.
_COMMAND_HANDLERS = [
    '_CmdBuild',
    '_CmdClean',
    '_CmdEbuild',
    '_CmdEmerge',
    '_CmdEquery',
    '_CmdPortageq',
    '_CmdShell',
    '_CmdWorkon',<commit_msg>Allow chromite to be copied to other locations inside the chroot.<commit_after>#!/usr/bin/python
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""Chromite."""

# Python imports
import ConfigParser
import cPickle
import optparse
import os
import sys
import tempfile


# Local library imports
from lib import text_menu
from lib.cros_build_lib import Die
from lib.cros_build_lib import Info
from lib.cros_build_lib import IsInsideChroot
from lib.cros_build_lib import RunCommand
from lib.cros_build_lib import Warning as Warn


# Find the Chromite root and Chromium OS root...  Note: in the chroot we may
# choose to install Chromite somewhere (/usr/lib/chromite?), so we use the
# environment variable to get the right place if it exists.
_CHROMITE_PATH = os.path.dirname(os.path.realpath(__file__))
_SRCROOT_PATH = os.environ.get('CROS_WORKON_SRCROOT',
                               os.path.realpath(os.path.join(_CHROMITE_PATH,
                                                             '..')))


# Commands can take one of these two types of specs.  Note that if a command
# takes a build spec, we will find the associated chroot spec.  This should be
# a human-readable string.  It is printed and also is the name of the spec
# directory.
_BUILD_SPEC_TYPE = 'build'
_CHROOT_SPEC_TYPE = 'chroot'


# This is a special target that indicates that you want to do something just
# to the host.  This means different things to different commands.
# TODO(dianders): Good idea or bad idea?
_HOST_TARGET = 'HOST'


# Define command handlers and command strings.  We define them in this way
# so that someone searching for what calls _CmdXyz can find it easy with a grep.
#
# ORDER MATTERS here when we show the menu.
#
# TODO(dianders): Make a command superclass, then make these subclasses.
_COMMAND_HANDLERS = [
    '_CmdBuild',
    '_CmdClean',
    '_CmdEbuild',
    '_CmdEmerge',
    '_CmdEquery',
    '_CmdPortageq',
    '_CmdShell',
    '_CmdWorkon',
{'fraction_non_alphanumeric': 0.07120336311087756, 'fraction_numerical': 0.0021019442984760903, 'mean_word_length': 3.7468827930174564, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2911460', 'n_tokens_mistral': 1174, 'n_tokens_neox': 1125, 'n_words': 474}