"Fossies" - the Fresh Open Source Software Archive

Member "screenkey-1.1/Screenkey/__init__.py" (28 May 2020, 1714 Bytes) of package /linux/privat/screenkey-1.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "__init__.py" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.0_vs_1.1.

    1 try:
    2     from collections.abc import MutableMapping
    3 except ImportError:
    4     # for python<3.3
    5     from collections import MutableMapping
    6 
    7 import gettext
    8 gettext.install('screenkey')
    9 
   10 # Screenkey version
   11 APP_NAME = "Screenkey"
   12 APP_DESC = _("Screencast your keys")
   13 APP_URL = 'https://www.thregr.org/~wavexx/software/screenkey/'
   14 VERSION = '1.1'
   15 
   16 SLOP_URL = 'https://github.com/naelstrof/slop'
   17 ERROR_URL = 'https://www.thregr.org/~wavexx/software/screenkey/#troubleshooting'
   18 
   19 
   20 # CLI/Interface options
   21 POSITIONS = {
   22     'top': _('Top'),
   23     'center': _('Center'),
   24     'bottom': _('Bottom'),
   25     'fixed': _('Fixed'),
   26 }
   27 
   28 FONT_SIZES = {
   29     'large': _('Large'),
   30     'medium': _('Medium'),
   31     'small': _('Small'),
   32 }
   33 
   34 KEY_MODES = {
   35     'composed': _('Composed'),
   36     'translated': _('Translated'),
   37     'keysyms': _('Keysyms'),
   38     'raw': _('Raw'),
   39 }
   40 
   41 BAK_MODES = {
   42     'normal': _('Normal'),
   43     'baked': _('Baked'),
   44     'full': _('Full'),
   45 }
   46 
   47 MODS_MODES = {
   48     'normal': _('Normal'),
   49     'emacs': _('Emacs'),
   50     'mac': _('Mac'),
   51     'win': _('Windows'),
   52     'tux': _('Linux'),
   53 }
   54 
   55 class Options(MutableMapping):
   56     def __init__(self, *args, **kw):
   57         self.__dict__['_store'] = dict(*args, **kw)
   58 
   59     def __getitem__(self, key):
   60         return self._store[key]
   61     
   62     def __setitem__(self, key, value):
   63         self._store[key] = value
   64     
   65     def __delitem__(self, key):
   66         del self._store[key]
   67 
   68     def __iter__(self):
   69         return iter(self._store)
   70 
   71     def __len__(self):
   72         return len(self._store)
   73 
   74     def __getattr__(self, key):
   75         return self._store[key]
   76 
   77     def __setattr__(self, key, value):
   78         self._store[key] = value
   79 
   80     def __delattr__(self, key):
   81         del self._store[key]