Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…impler bash script.
  • Loading branch information...
commit 10077025e8c29438ce013da532d1dd46d766566e 1 parent 715069c
@philikon philikon authored
Showing with 2 additions and 35 deletions.
  1. +0 −35 display-procrank.py
  2. +2 −0  watch-procrank.sh
View
35 display-procrank.py
@@ -1,35 +0,0 @@
-#!/usr/bin/env python
-"""
-Continuously display b2g-procrank.
-"""
-
-from __future__ import print_function
-
-import sys
-import time
-import subprocess
-
-def shell(cmd, cwd=None):
- proc = subprocess.Popen(cmd, shell=True, cwd=cwd,
- stdout=sys.stdout, stderr=subprocess.PIPE)
- (out, err) = proc.communicate()
- if proc.returncode:
- print("Command %s failed with error code %d" % (cmd, proc.returncode), file=sys.stderr)
- if err:
- print(err, file=sys.stderr)
- raise subprocess.CalledProcessError(proc.returncode, cmd, err)
- return out
-
-
-def main():
- try:
- while True:
- print(chr(27) + "[0;0H") # move cursor to top left
- shell("adb shell b2g-procrank")
- print(chr(27) + "[J") # erase screen from current line down
- time.sleep(1)
- except KeyboardInterrupt:
- pass
-
-if __name__ == "__main__":
- main()
View
2  watch-procrank.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+watch -n 1 'adb shell b2g-procrank'
Please sign in to comment.
Something went wrong with that request. Please try again.