~barry/autopilot/lp1488175

« back to all changes in this revision

Viewing changes to autopilot/keybindings.py

  • Committer: CI bot
  • Author(s): Martin Pitt, Corey Goldberg, Max Brustkern, Christopher Lee, Thomi Richards
  • Date: 2014-08-06 01:20:25 UTC
  • mfrom: (493.1.17 trunk)
  • Revision ID: ps-jenkins@lists.canonical.com-20140806012025-2r7bw4rdc7q8e1md
Autopilot release.

Includes.

Adding screenshot support.
Removing python2 dependencies and code.
Internal refactoring (for logging) Fixes: 1078732
Approved by: Martin Pitt, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 2) Elsewhere. Right now we're hard-coding these in a separate dictionary.
34
34
"""
35
35
 
36
 
from __future__ import absolute_import
37
 
 
38
36
import logging
39
37
import re
40
 
import six
41
38
 
42
39
from autopilot.input import Keyboard
43
40
from autopilot.utilities import Silence
143
140
    :returns: string for keybinding
144
141
 
145
142
    """
146
 
    if not isinstance(binding_name, six.string_types):
 
143
    if not isinstance(binding_name, str):
147
144
        raise TypeError("binding_name must be a string.")
148
145
    if binding_name not in _keys:
149
146
        raise ValueError("Unknown binding name '%s'." % (binding_name))
150
147
    v = _keys[binding_name]
151
 
    if isinstance(v, six.string_types):
 
148
    if isinstance(v, str):
152
149
        return v
153
150
    else:
154
151
        return _get_compiz_keybinding(v)
231
228
    :param string keystroke_string: A compizconfig-style keystroke string.
232
229
 
233
230
    """
234
 
    if not isinstance(keystroke_string, six.string_types):
 
231
    if not isinstance(keystroke_string, str):
235
232
        raise TypeError("keystroke string must be a string.")
236
233
 
237
234
    translations = {