Cleaning
This commit is contained in:
parent
755a5ac611
commit
8968a136d3
@ -11,11 +11,16 @@ bars = "_▂▃▄▅▆▇█"
|
|||||||
batteries = ""
|
batteries = ""
|
||||||
batteries_charging = ""
|
batteries_charging = ""
|
||||||
|
|
||||||
|
|
||||||
class Monitor:
|
class Monitor:
|
||||||
"""
|
"""
|
||||||
A monitor on which many workspaces can appear.
|
A monitor on which many workspaces can appear.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, id: int, name: str):
|
def __init__(self, id: int, name: str):
|
||||||
|
"""
|
||||||
|
Constructs a monitor from its id and its name.
|
||||||
|
"""
|
||||||
self.id = id
|
self.id = id
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
@ -84,7 +89,11 @@ class Workspace:
|
|||||||
|
|
||||||
Workspaces with id from 10 * n + k belongs to the same monitor for k in [1, 10].
|
Workspaces with id from 10 * n + k belongs to the same monitor for k in [1, 10].
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, id: int):
|
def __init__(self, id: int):
|
||||||
|
"""
|
||||||
|
Constructs a workspace from its id.
|
||||||
|
"""
|
||||||
self.id = id
|
self.id = id
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -141,15 +150,16 @@ def to_bar(x):
|
|||||||
|
|
||||||
|
|
||||||
def monitor_stats():
|
def monitor_stats():
|
||||||
try:
|
|
||||||
import psutil
|
|
||||||
except:
|
|
||||||
print('Stats requires psutil (run `pip install psutil`)', file=sys.stderr)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Monitors CPU and MEM usage and prints info in file.
|
Monitors CPU and MEM usage and prints info in file.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
try:
|
||||||
|
import psutil
|
||||||
|
except ModuleNotFoundError:
|
||||||
|
print('Stats requires psutil (run `pip install psutil`)', file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
cpu_values = [0] * 10
|
cpu_values = [0] * 10
|
||||||
mem_values = [0] * 10
|
mem_values = [0] * 10
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user