<commit_before>#
#   Copyright 2012 Red Hat, 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.

from zope.interface import Interface

class OSDelegate(Interface):
    """ Delegate interface for OS installation and customization. OS plugins
    use provide the builder with a delegate. Not all methods defined in this
    interface need to be implemented by the delegate, just the ones that
    the plugin cares about. Delegation provides a way for the plugin to
    customize the behavior of the builder. """

    def builder_should_create_image(self, builder):
        """
        Allow or prohibit a JEOS image to be created and customized with additional packages.

        @param builder The builder object.

        @return bool
        """

    def builder_will_create_image(self, builder):
        """
        Invoked just before the installation of a JEOS image.

        @param builder The builder object.
        """

    def builder_did_create_image(self, builder):
        """
        Invoked after the builder has completed the custom package installation.

        @param builder The builder object.
        """

    def builder_should_install_packages(self, builder):
        """
        Allow or prohibit installation of extra packages.

        @param builder The builder object.

        @return bool
        """

    def builder_will_install_packages(self, builder):
        """
        Invoked just before installing packages on the image.

        @param builder The builder object.
        """

    def builder_did_install_packages(self, builder):
        """
        Invoked after installing packages on the image.

        @param builder The builder object.
        """

    def builder_should_customize_image(self, builder):
        """
        Allow or prohibit cloud agnostic image customization.

        @param builder The builder object.

        @return bool
        """

    def builder_will_customize_image(self, builder):
        """
        Invoked just before cloud agnostic image customization.

        @param builder The builder object.
        """

    def builder_did_customize_image(self, builder):
        """
        Invoked after cloud agnostic image customization.

        @param builder The builder object.
        """<commit_msg>Switched to delegate actions. Will move the event messages to the CloudDelegate.<commit_after>#
#   Copyright 2012 Red Hat, 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.

from zope.interface import Interface

class OSDelegate(Interface):
    """ Delegate interface for OS installation and customization. OS plugins
    use provide the builder with a delegate. Not all methods defined in this
    interface need to be implemented by the delegate, just the ones that
    the plugin cares about. Delegation provides a way for the plugin to
    customize the behavior of the builder. """

    def create_image(self, builder):
        """
        Create a JEOS image to be used as the basis for customization.

        @param builder The builder object.
        """

    def install_packages(self, builder):
        """
        Installs any packages specified beyond the JEOS and generates an ICICLE
        document for the image.

        @param builder The builder object.
        """

    def customize_image_for_builder(self, builder):
        """
        Performs cloud agnostic customizaion of the image.

        @param builder The builder object.
        """
{'fraction_non_alphanumeric': 0.06180276662204373, 'fraction_numerical': 0.0035698348951361, 'mean_word_length': 2.723421926910299, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2600706', 'n_tokens_mistral': 1114, 'n_tokens_neox': 1063, 'n_words': 506}