Example #1
0
import argparse
import logging
import sys
import multiprocessing
import json
from multiprocessing import Pool
from os.path import expanduser
import textwrap

from itu_p1203 import log
from itu_p1203 import utils
from itu_p1203.p1203_standalone import P1203Standalone
from itu_p1203.extractor import Extractor
from itu_p1203.errors import P1203StandaloneError

logger = log.setup_custom_logger('main')


def has_user_signed_acknowledgment():
    home = expanduser("~")
    return os.path.isfile(os.path.join(home, '.itu_p1203'))


def sign_acknowledgement():
    home = expanduser("~")
    try:
        with open(os.path.join(home, '.itu_p1203'), 'w') as file_name:
            file_name.write('\n')
    except Exception as e:
        logger.error(
            "Coult not create file in home directory. Please use --accept-notice to silence the message."
Example #2
0
Permission is hereby granted, free of charge, to use the software for research
purposes.

Any other use of the software, including commercial use, merging, publishing,
distributing, sublicensing, and/or selling copies of the Software, is
forbidden. For a commercial license, please contact the respective rights
holders of the standards ITU-T Rec. P.1203, ITU-T Rec. P.1203.1, ITU-T Rec.
P.1203.2, and ITU-T Rec. P.1203.3. See https://www.itu.int/en/ITU-T/ipr/Pages/default.aspx
for more information.

NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

from itu_p1203 import log

logger = log.setup_custom_logger('itu_p1203')


class P1203StandaloneError(Exception):
    def __init__(self, message):
        logger.error(message)
        super().__init__(message)