File: const.py

package info (click to toggle)
python-urwid-utils 0.1.3.dev0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 132 kB
  • sloc: python: 516; makefile: 3
file content (23 lines) | stat: -rw-r--r-- 664 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# -*- coding: utf-8 -*-

import re
from urwid_utils.util import is_valid_identifier, get_const_identifiers
from urwid import widget, command_map

MISC_CONST_VAL = [
    'cursor left',
    'cursor max left',
    'fixed bottom',
    'fixed left',
    'fixed right',
    'fixed top',
]
MISC_CONST_NAMES = [v.replace(' ', '_').upper() for v in MISC_CONST_VAL]
MISC_CONST = list(zip(MISC_CONST_NAMES, MISC_CONST_VAL))
MISC_CONST.append(('FOCUS_HEADER', 'header'))
MISC_CONST.append(('FOCUS_BODY', 'body'))
MISC_CONST.append(('FOCUS_FOOTER', 'footer'))

const = get_const_identifiers(widget, command_map, MISC_CONST)
globals().update(const)
__all__ = list(const.keys())