~laney/autopilot/legacy-psutil-children

« back to all changes in this revision

Viewing changes to autopilot/input/_common.py

  • Committer: CI bot
  • Author(s): Thomi Richards, Max Brustkern
  • Date: 2014-04-08 00:29:44 UTC
  • mfrom: (459.6.5 logger-privatization)
  • Revision ID: ps-jenkins@lists.canonical.com-20140408002944-hkq216cwlrrbg3k7
Make logger objects within autopilot private. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
import logging
24
24
 
25
 
logger = logging.getLogger(__name__)
 
25
_logger = logging.getLogger(__name__)
26
26
 
27
27
 
28
28
def get_center_point(object_proxy):
42
42
    """
43
43
    try:
44
44
        x, y, w, h = object_proxy.globalRect
45
 
        logger.debug("Moving to object's globalRect coordinates.")
 
45
        _logger.debug("Moving to object's globalRect coordinates.")
46
46
        return x+w/2, y+h/2
47
47
    except AttributeError:
48
48
        pass
53
53
 
54
54
    try:
55
55
        x, y = object_proxy.center_x, object_proxy.center_y
56
 
        logger.debug("Moving to object's center_x, center_y coordinates.")
 
56
        _logger.debug("Moving to object's center_x, center_y coordinates.")
57
57
        return x, y
58
58
    except AttributeError:
59
59
        pass
61
61
    try:
62
62
        x, y, w, h = (
63
63
            object_proxy.x, object_proxy.y, object_proxy.w, object_proxy.h)
64
 
        logger.debug(
 
64
        _logger.debug(
65
65
            "Moving to object's center point calculated from x,y,w,h "
66
66
            "attributes.")
67
67
        return x+w/2, y+h/2