Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
Archivo: Log.py Proyecto: Arexxk/pi3d
"""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)
Ejemplo n.º 3
0
Archivo: Log.py Proyecto: rec/git-twit
"""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)
Ejemplo n.º 4
0
Archivo: Log.py Proyecto: akissu/pi3d
"""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)