def keyboard(echomesh): if Config.is_control_program(): processor = lambda x: Processor.process(x, echomesh) return Keyboard(parent=echomesh, sleep=Config.get('opening_sleep'), message=MESSAGE, processor=processor)
"""Typical usage: at the top of your file: LOGGER = Log.logger(__name__) """ import logging import logging.config import sys from echomesh.util import MakeDirs try: from echomesh.config import Config LOG_FORMAT = Config.get("logging", "format") LOG_LEVEL_STR = Config.get("logging", "level").upper() LOG_FILE = Config.get("logging", "file") except ImportError: LOG_FORMAT = "%(asctime)s %(levelname)s: %(name)s: %(message)s" LOG_LEVEL_STR = "INFO" LOG_FILE = "" LOG_LEVEL = getattr(logging, LOG_LEVEL_STR) logging.basicConfig(level=LOG_LEVEL, format=LOG_FORMAT) if LOG_FILE: MakeDirs.parent_makedirs(LOG_FILE) HANDLER = logging.FileHandler(LOG_FILE)
"""Typical usage: at the top of your file: LOGGER = Log.logger(__name__) """ import logging import logging.config import sys from echomesh.util.file import MakeDirs try: from echomesh.config import Config LOG_FORMAT = Config.get('logging', 'format') LOG_LEVEL_STR = Config.get('logging','level').upper() LOG_FILE = Config.get('logging', 'file') except ImportError: LOG_FORMAT = '%(asctime)s %(levelname)s: %(name)s: %(message)s' LOG_LEVEL_STR = 'INFO' LOG_FILE = '' LOG_LEVEL = getattr(logging, LOG_LEVEL_STR) logging.basicConfig(level=LOG_LEVEL, format=LOG_FORMAT) if LOG_FILE: MakeDirs.parent_makedirs(LOG_FILE) HANDLER = logging.FileHandler(LOG_FILE)
"""Typical usage: at the top of your file: LOGGER = Log.logger(__name__) """ import logging import logging.config import sys from echomesh.util import MakeDirs try: from echomesh.config import Config LOG_FORMAT = Config.get('logging', 'format') LOG_LEVEL_STR = Config.get('logging','level').upper() LOG_FILE = Config.get('logging', 'file') except ImportError: LOG_FORMAT = '%(asctime)s %(levelname)s: %(name)s: %(message)s' LOG_LEVEL_STR = 'INFO' LOG_FILE = '' LOG_LEVEL = getattr(logging, LOG_LEVEL_STR) logging.basicConfig(level=LOG_LEVEL, format=LOG_FORMAT) if LOG_FILE: MakeDirs.parent_makedirs(LOG_FILE) HANDLER = logging.FileHandler(LOG_FILE)