def remove(self, pkg): should_remove = self.remove_default if 'removable' in pkg: should_remove = type_utils.make_bool(pkg['removable']) if not should_remove: return False self._remove(pkg) return True
def __init__(self, *args, **kargs): comp.Component.__init__(self, *args, **kargs) trace_fn = tr.trace_filename(self.get_option('trace_dir'), 'created') self.tracewriter = tr.TraceWriter(trace_fn, break_if_there=False) self.package_dir = sh.joinpths(self.get_option('component_dir'), 'package') self.match_installed = tu.make_bool(kargs.get('match_installed')) self._build_paths = None self._details = None
def __init__(self, *args, **kwargs): comp.Component.__init__(self, *args, **kwargs) self.tracewriter = tr.TraceWriter(tr.trace_filename(self.get_option('trace_dir'), 'created'), break_if_there=False) self.package_dir = sh.joinpths(self.get_option('component_dir'), 'package') self.match_installed = tu.make_bool(kwargs.get('match_installed')) self._build_paths = None self._details = None self._helper = yum_helper.Helper()
def __init__(self, *args, **kwargs): comp.Component.__init__(self, *args, **kwargs) self.tracewriter = tr.TraceWriter( tr.trace_filename(self.get_option("trace_dir"), "created"), break_if_there=False ) self.package_dir = sh.joinpths(self.get_option("component_dir"), "package") self.match_installed = tu.make_bool(kwargs.get("match_installed")) self._build_paths = None self._details = None self._helper = yum_helper.Helper()
def get_bool_option(self, option, *options, **kwargs): if 'default_value' not in kwargs: kwargs['default_value'] = False return tu.make_bool(self.get_option(option, *options, **kwargs))
def is_dry_run(): dry_v = env.get_key('ANVIL_DRYRUN') if not dry_v: return False return tu.make_bool(dry_v)
# 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 sys import termcolor from anvil import env from anvil import type_utils as tu COLORS = termcolor.COLORS.keys() LOG_COLOR = True if 'LOG_COLOR' in env.get(): LOG_COLOR = tu.make_bool(env.get_key('LOG_COLOR')) if not sys.stdout.isatty(): LOG_COLOR = False def color_enabled(): return LOG_COLOR def quote(data, quote_color='green', **kargs): if not color_enabled(): return "'%s'" % (data) else: text = str(data) if len(text) == 0: text = "''"
def is_dry_run(): # Not stashed locally since the main entrypoint # actually adjusts this value depending on a command # line option... return tu.make_bool(env.get_key('ANVIL_DRYRUN'))
def color_enabled(): if 'LOG_COLOR' in env.get() and not tu.make_bool(env.get_key('LOG_COLOR')): return False if not sys.stdout.isatty(): return False return True