<commit_before>## $Id$
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## CDS Invenio is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with CDS Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

"""CDS Invenio Submission Web Interface config file."""

__revision__ = "$Id$"

## test:
test = "FALSE"

## CC all action confirmation mails to administrator? (0 == NO; 1 == YES)
CFG_WEBSUBMIT_COPY_MAILS_TO_ADMIN = 0

class InvenioWebSubmitFunctionError(Exception):
    """This exception should only ever be raised by WebSubmit functions.
       It will be caught and handled by the WebSubmit core itself.
       It is used to signal to WebSubmit core that one of the functions
       encountered a FATAL ERROR situation that should all further execution
       of the submission.
       The exception will carry an error message in its "value" string. This
       message will probably be displayed on the user's browser in an Invenio
       "error" box, and may be logged for the admin to examine.

       Again: If this exception is raised by a WebSubmit function, an error
              message will displayed and the submission ends in failure.

       Extends: Exception.
    """
    def __init__(self, value):
        """Set the internal "value" attribute to that of the passed "value"
           parameter.
           @param value: (string) - an error string to display to the user.
        """
        Exception.__init__(self)
        self.value = value
    def __str__(self):
        """Return oneself as a string (actually, return the contents of
           self.value).
           @return: (string)
        """
        return str(self.value)


class InvenioWebSubmitFunctionStop(Exception):
    """This exception should only ever be raised by WebSubmit functions.
       It will be caught and handled by the WebSubmit core itself.
       It is used to signal to WebSubmit core that one of the functions
       encountered a situation that should prevent the functions that follow
       it from being executed, and that WebSubmit core should display some sort
       of message to the user. This message will be stored in the "value"
       attribute of the object.

       ***
       NOTE: In the current WebSubmit, this "value" is ususally a JavaScript
             string that redirects the user's browser back to the Web form
             phase of the submission. The use of JavaScript, however is going
             to be removed in the future, so the mechanism may change.
       ***

       Extends: Exception.
    """
    def __init__(self, value):
        """Set the internal "value" attribute to that of the passed "value"
           parameter.
           @param value: (string) - a string to display to the user.
        """
        Exception.__init__(self)
        self.value = value
    def __str__(self):
        """Return oneself as a string (actually, return the contents of
           self.value).
           @return: (string)
        """
        return str(self.value)


class InvenioWebSubmitFunctionWarning(Exception):
    """This exception should be raised by a WebSubmit function
       when unexpected behaviour is encountered during the execution
       of the function. The unexpected behaviour should not have been
       so serious that execution had to be halted, but since the
       function was unable to perform its task, the event must be
       logged.
       Logging of the exception will be performed by WebSubmit.

       Extends: Exception.
    """
    def __init__(self, value):
        """Set the internal "value" attribute to that of the passed "value"
           parameter.
           @param value: (string) - a string to write to the log.
        """
        Exception.__init__(self)
        self.value = value
    def __str__(self):
        """Return oneself as a string (actually, return the contents of
           self.value).
           @return: (string)
        """
        return str(self.value)


class InvenioWebSubmitFileStamperError(Exception):
    """This exception should be raised by websubmit_file_stamper when an
       error is encoutered that prevents a file from being stamped.
       When caught, this exception should be used to stop processing with a
       failure signal.

       Extends: Exception.
    """
    def __init__(self, value):
        """Set the internal "value" attribute to that of the passed "value"
           parameter.
           @param value: (string) - a string to write to the log.
        """
        Exception.__init__(self)
        self.value = value
    def __str__(self):
        """Return oneself as a string (actually, return the contents of
           self.value).
           @return: (string)
        """
        return str(self.value)<commit_msg>Added a new exception class: "InvenioWebSubmitIconCreatorError". Raised by websubmit_icon_creator.<commit_after>## $Id$
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## CDS Invenio is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with CDS Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

"""CDS Invenio Submission Web Interface config file."""

__revision__ = "$Id$"

## test:
test = "FALSE"

## CC all action confirmation mails to administrator? (0 == NO; 1 == YES)
CFG_WEBSUBMIT_COPY_MAILS_TO_ADMIN = 0

class InvenioWebSubmitFunctionError(Exception):
    """This exception should only ever be raised by WebSubmit functions.
       It will be caught and handled by the WebSubmit core itself.
       It is used to signal to WebSubmit core that one of the functions
       encountered a FATAL ERROR situation that should all further execution
       of the submission.
       The exception will carry an error message in its "value" string. This
       message will probably be displayed on the user's browser in an Invenio
       "error" box, and may be logged for the admin to examine.

       Again: If this exception is raised by a WebSubmit function, an error
              message will displayed and the submission ends in failure.

       Extends: Exception.
    """
    def __init__(self, value):
        """Set the internal "value" attribute to that of the passed "value"
           parameter.
           @param value: (string) - an error string to display to the user.
        """
        Exception.__init__(self)
        self.value = value
    def __str__(self):
        """Return oneself as a string (actually, return the contents of
           self.value).
           @return: (string)
        """
        return str(self.value)


class InvenioWebSubmitFunctionStop(Exception):
    """This exception should only ever be raised by WebSubmit functions.
       It will be caught and handled by the WebSubmit core itself.
       It is used to signal to WebSubmit core that one of the functions
       encountered a situation that should prevent the functions that follow
       it from being executed, and that WebSubmit core should display some sort
       of message to the user. This message will be stored in the "value"
       attribute of the object.

       ***
       NOTE: In the current WebSubmit, this "value" is ususally a JavaScript
             string that redirects the user's browser back to the Web form
             phase of the submission. The use of JavaScript, however is going
             to be removed in the future, so the mechanism may change.
       ***

       Extends: Exception.
    """
    def __init__(self, value):
        """Set the internal "value" attribute to that of the passed "value"
           parameter.
           @param value: (string) - a string to display to the user.
        """
        Exception.__init__(self)
        self.value = value
    def __str__(self):
        """Return oneself as a string (actually, return the contents of
           self.value).
           @return: (string)
        """
        return str(self.value)


class InvenioWebSubmitFunctionWarning(Exception):
    """This exception should be raised by a WebSubmit function
       when unexpected behaviour is encountered during the execution
       of the function. The unexpected behaviour should not have been
       so serious that execution had to be halted, but since the
       function was unable to perform its task, the event must be
       logged.
       Logging of the exception will be performed by WebSubmit.

       Extends: Exception.
    """
    def __init__(self, value):
        """Set the internal "value" attribute to that of the passed "value"
           parameter.
           @param value: (string) - a string to write to the log.
        """
        Exception.__init__(self)
        self.value = value
    def __str__(self):
        """Return oneself as a string (actually, return the contents of
           self.value).
           @return: (string)
        """
        return str(self.value)


class InvenioWebSubmitFileStamperError(Exception):
    """This exception should be raised by websubmit_file_stamper when an
       error is encoutered that prevents a file from being stamped.
       When caught, this exception should be used to stop processing with a
       failure signal.

       Extends: Exception.
    """
    def __init__(self, value):
        """Set the internal "value" attribute to that of the passed "value"
           parameter.
           @param value: (string) - a string to write to the log.
        """
        Exception.__init__(self)
        self.value = value
    def __str__(self):
        """Return oneself as a string (actually, return the contents of
           self.value).
           @return: (string)
        """
        return str(self.value)


class InvenioWebSubmitIconCreatorError(Exception):
    """This exception should be raised by websubmit_icon_creator when an
       error is encoutered that prevents an icon from being created.
       When caught, this exception should be used to stop processing with a
       failure signal.

       Extends: Exception.
    """
    def __init__(self, value):
        """Set the internal "value" attribute to that of the passed "value"
           parameter.
           @param value: (string) - a string to write to the log.
        """
        Exception.__init__(self)
        self.value = value
    def __str__(self):
        """Return oneself as a string (actually, return the contents of
           self.value).
           @return: (string)
        """
        return str(self.value)
{'fraction_non_alphanumeric': 0.07046720960137162, 'fraction_numerical': 0.00788684097728247, 'mean_word_length': 2.541590771098968, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2222193', 'n_tokens_mistral': 2999, 'n_tokens_neox': 2872, 'n_words': 1421}