demos/base.py
changeset 117 8680c2333546
parent 96 68c562e0eb1f
equal deleted inserted replaced
116:165b5d65e1cb 117:8680c2333546
       
     1 # Set system locale (needed for ncurses)
       
     2 import locale
       
     3 locale.setlocale(locale.LC_ALL, '')
       
     4 
       
     5 # Setup logging
       
     6 import logging
       
     7 logger = logging.getLogger('tuikit')
       
     8 logger.setLevel(logging.DEBUG)
       
     9 handler = logging.FileHandler(filename='tuikit.log')
       
    10 handler.setLevel(logging.DEBUG)
       
    11 formatter = logging.Formatter('%(asctime)s %(name)s %(levelname)s %(message)s')
       
    12 handler.setFormatter(formatter)
       
    13 logger.addHandler(handler)
       
    14 
       
    15 # Escape key code is also used for escape sequences. After escape code,
       
    16 # terminal waits for rest of sequence. This delay is 1 second by default.
       
    17 # Let's hope that our terminal is fast enough to handle the sequences in 200ms.
       
    18 import os
       
    19 os.environ['ESCDELAY'] = '200'
       
    20 
       
    21 def setup():
       
    22     pass