class VimeoException(Exception): error_text = None def __init__(self, write_log=True): self.logger = LoggerSingleton() if write_log: self.write_log(self.error_text) def __str__(self): return repr(self.error_text) def __repr__(self): return repr(self.error_text) def write_log(self, msg): self.logger.error(msg)
# coding: utf-8 import getopt import logging import sys import unittest from vimeo.logger import LoggerSingleton LOGGER_SINGLETON = LoggerSingleton() LOG_LEVEL_DICT = { 'CRITICAL': 50, 'ERROR': 40, 'WARNING': 30, 'INFO': 20, 'DEBUG': 10, 'NOTSET': 0, } # STATIC VAR LOG_LEVEL = None LOGGER_ENABLED = False TOKEN = None class TestVimeopyBase(unittest.TestCase): def __init__(self, methodName='runTest'): # CLIENT from vimeo.clients import VimeoClientSingleton self.client = VimeoClientSingleton( token=TOKEN,
def __init__(self, write_log=True): self.logger = LoggerSingleton() if write_log: self.write_log(self.error_text)