From 352be63b12c528ea80ea79d61ec6ca21c9ba5bb7 Mon Sep 17 00:00:00 2001 From: airelil Date: Sun, 2 Feb 2020 17:42:17 +1300 Subject: [PATCH] PEP8: fix indentations and spaces in linux/application.py --- pywinauto/linux/application.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pywinauto/linux/application.py b/pywinauto/linux/application.py index b379f573a..5905e6527 100644 --- a/pywinauto/linux/application.py +++ b/pywinauto/linux/application.py @@ -49,8 +49,8 @@ def __init__(self, backend="atspi", allow_magic_lookup=True): Initialize the Application object * **backend** is a name of used back-end (values: "atspi"). - * **allow_magic_lookup** whether attribute access must turn into - child_window(best_match=...) search as fallback + * **allow_magic_lookup** whether attribute access must turn into + child_window(best_match=...) search as fallback """ self.process = None self.xmlpath = '' @@ -58,7 +58,7 @@ def __init__(self, backend="atspi", allow_magic_lookup=True): self._proc_descriptor = None self.match_history = [] self.use_history = False - self.actions = None # TODO Action logger for linux + self.actions = None # TODO Action logger for linux if backend not in registry.backends: raise ValueError('Backend "{0}" is not registered!'.format(backend)) self.backend = registry.backends[backend] @@ -122,6 +122,7 @@ def cpu_usage(self, interval=None): raise AppNotConnected("Please use start or connect before trying " "anything else") proc_pid_stat = "/proc/{}/stat".format(self.process) + def read_cpu_info(): with open(proc_pid_stat, 'r') as s: pid_info = s.read().split() @@ -130,7 +131,7 @@ def read_cpu_info(): # return a tuple as following: # pid utime, pid stime, total utime, total stime return (int(pid_info[13]), int(pid_info[14]), int(info[1]), int(info[3])) - + try: before = read_cpu_info() if not interval: @@ -166,7 +167,7 @@ def kill(self, soft=False): self._proc_descriptor = None if not self.is_process_running(): - return True # already closed + return True # already closed status = subprocess.check_output(["kill", "-9", str(self.process)], universal_newlines=True) if "Operation not permitted" in status: raise Exception("Cannot kill process: {}".format(status))