author | Radek Brich <radek.brich@devl.cz> |
Sat, 21 Feb 2015 12:01:57 +0100 | |
changeset 118 | 8c7970520632 |
parent 117 | 8680c2333546 |
permissions | -rw-r--r-- |
96
68c562e0eb1f
Add TextBox, text editor demo. Update demobase.
Radek Brich <radek.brich@devl.cz>
parents:
92
diff
changeset
|
1 |
# Set system locale (needed for ncurses) |
68c562e0eb1f
Add TextBox, text editor demo. Update demobase.
Radek Brich <radek.brich@devl.cz>
parents:
92
diff
changeset
|
2 |
import locale |
68c562e0eb1f
Add TextBox, text editor demo. Update demobase.
Radek Brich <radek.brich@devl.cz>
parents:
92
diff
changeset
|
3 |
locale.setlocale(locale.LC_ALL, '') |
92 | 4 |
|
5 |
# Setup logging |
|
96
68c562e0eb1f
Add TextBox, text editor demo. Update demobase.
Radek Brich <radek.brich@devl.cz>
parents:
92
diff
changeset
|
6 |
import logging |
92 | 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) |
|
96
68c562e0eb1f
Add TextBox, text editor demo. Update demobase.
Radek Brich <radek.brich@devl.cz>
parents:
92
diff
changeset
|
14 |
|
68c562e0eb1f
Add TextBox, text editor demo. Update demobase.
Radek Brich <radek.brich@devl.cz>
parents:
92
diff
changeset
|
15 |
# Escape key code is also used for escape sequences. After escape code, |
68c562e0eb1f
Add TextBox, text editor demo. Update demobase.
Radek Brich <radek.brich@devl.cz>
parents:
92
diff
changeset
|
16 |
# terminal waits for rest of sequence. This delay is 1 second by default. |
68c562e0eb1f
Add TextBox, text editor demo. Update demobase.
Radek Brich <radek.brich@devl.cz>
parents:
92
diff
changeset
|
17 |
# Let's hope that our terminal is fast enough to handle the sequences in 200ms. |
68c562e0eb1f
Add TextBox, text editor demo. Update demobase.
Radek Brich <radek.brich@devl.cz>
parents:
92
diff
changeset
|
18 |
import os |
68c562e0eb1f
Add TextBox, text editor demo. Update demobase.
Radek Brich <radek.brich@devl.cz>
parents:
92
diff
changeset
|
19 |
os.environ['ESCDELAY'] = '200' |
117
8680c2333546
Update FixedLayout. Add demo launcher.
Radek Brich <radek.brich@devl.cz>
parents:
96
diff
changeset
|
20 |
|
8680c2333546
Update FixedLayout. Add demo launcher.
Radek Brich <radek.brich@devl.cz>
parents:
96
diff
changeset
|
21 |
def setup(): |
8680c2333546
Update FixedLayout. Add demo launcher.
Radek Brich <radek.brich@devl.cz>
parents:
96
diff
changeset
|
22 |
pass |