-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvbar.py
37 lines (24 loc) · 783 Bytes
/
vbar.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
from __future__ import print_function
class VirtualPowerBar(object):
def __init__(self, name):
self.name = name
self.sockets = {}
def make_socket(self, name, ident):
"""
This function is used to create PowerSocket instances in barconfig
"""
raise NotImplementedException('make_socket')
class VirtualPowerSocket(object):
def __init__(self, bar, name, ident):
self.bar = bar
self.name = name
self.ident = ident
self.state = None
self.refcount = []
def __str__(self):
return self.name
def __repr__(self):
return 'PowerSocket (%s)' % self.name
def set_state(self, state):
raise NotImplementedException('set_state')