<commit_before>#
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     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.
#


'''
image definitions
'''
import itertools

from xobj import xobj

from rbuild import errors
from rbuild import pluginapi
from rbuild.productstore.decorators import requiresProduct
from rbuild.pluginapi import command


DESCRIPTOR_PREFIX = 'options.'


class CreateImageDefCommand(command.BaseCommand):
    help = 'Create a image defintion on a SAS App Engine'
    commands = ['imagedef']
    paramHelp = '<TYPE> <ARCH>'
    docs = {'list': 'List available image types',
            'from-file': 'Load config from file',
            'to-file': 'Write config to file',
            }

    def addLocalParameters(self, argDef):
        argDef['message'] = '-m', command.ONE_PARAM
        argDef['list'] = '-l', command.NO_PARAM
        argDef['from-file'] = '-f', command.ONE_PARAM
        argDef['to-file'] = '-o', command.ONE_PARAM

    def runCommand(self, handle, argSet, args):
        ui = handle.ui
        rb = handle.facade.rbuilder

        message = argSet.pop('message', None)
        listTypes = argSet.pop('list', False)
        fromFile = argSet.pop('from-file', None)
        toFile = argSet.pop('to-file', None)
<commit_msg>Remove --list option from `rbuild add imagedef`<commit_after>#
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     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.
#


'''
image definitions
'''
import itertools

from xobj import xobj

from rbuild import errors
from rbuild import pluginapi
from rbuild.productstore.decorators import requiresProduct
from rbuild.pluginapi import command


DESCRIPTOR_PREFIX = 'options.'


class CreateImageDefCommand(command.BaseCommand):
    help = 'Create a image defintion on a SAS App Engine'
    commands = ['imagedef']
    paramHelp = '<TYPE> <ARCH>'
    docs = {'from-file': 'Load config from file',
            'to-file': 'Write config to file',
            }

    def addLocalParameters(self, argDef):
        argDef['message'] = '-m', command.ONE_PARAM
        argDef['from-file'] = '-f', command.ONE_PARAM
        argDef['to-file'] = '-o', command.ONE_PARAM

    def runCommand(self, handle, argSet, args):
        ui = handle.ui
        rb = handle.facade.rbuilder

        message = argSet.pop('message', None)
        fromFile = argSet.pop('from-file', None)
        toFile = argSet.pop('to-file', None)

{'fraction_non_alphanumeric': 0.10534124629080119, 'fraction_numerical': 0.002373887240356083, 'mean_word_length': 3.3496774193548386, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3786422', 'n_tokens_mistral': 960, 'n_tokens_neox': 940, 'n_words': 353}