Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Replace Python hack to continuously display procrank info with much s…

…impler bash script.
  • Loading branch information...
commit 10077025e8c29438ce013da532d1dd46d766566e 1 parent 715069c
Philipp von Weitershausen authored
35  display-procrank.py
... ...
@@ -1,35 +0,0 @@
1  
-#!/usr/bin/env python
2  
-"""
3  
-Continuously display b2g-procrank.
4  
-"""
5  
-
6  
-from __future__ import print_function
7  
-
8  
-import sys
9  
-import time
10  
-import subprocess
11  
-
12  
-def shell(cmd, cwd=None):
13  
-    proc = subprocess.Popen(cmd, shell=True, cwd=cwd,
14  
-                            stdout=sys.stdout, stderr=subprocess.PIPE)
15  
-    (out, err) = proc.communicate()
16  
-    if proc.returncode:
17  
-        print("Command %s failed with error code %d" % (cmd, proc.returncode), file=sys.stderr)
18  
-        if err:
19  
-            print(err, file=sys.stderr)
20  
-        raise subprocess.CalledProcessError(proc.returncode, cmd, err)
21  
-    return out
22  
-
23  
-
24  
-def main():
25  
-    try:
26  
-        while True:
27  
-            print(chr(27) + "[0;0H") # move cursor to top left
28  
-            shell("adb shell b2g-procrank")
29  
-            print(chr(27) + "[J") # erase screen from current line down
30  
-            time.sleep(1)
31  
-    except KeyboardInterrupt:
32  
-        pass
33  
-
34  
-if __name__ == "__main__":
35  
-    main()
2  watch-procrank.sh
... ...
@@ -0,0 +1,2 @@
  1
+#!/bin/bash
  2
+watch -n 1 'adb shell b2g-procrank'

0 notes on commit 1007702

Please sign in to comment.
Something went wrong with that request. Please try again.