mirror of
https://github.com/powerline/powerline.git
synced 2025-07-27 15:54:30 +02:00
Use 'with' instead of lock.acquire/release()
This commit is contained in:
parent
253ad02c3c
commit
21319fc8d2
@ -25,12 +25,11 @@ lock = Lock()
|
||||
|
||||
def render( event=None, data=None, sub=None ):
|
||||
global lock
|
||||
lock.acquire()
|
||||
with lock:
|
||||
s = '[\n' + powerline.render(side='right')[:-2] + '\n]\n'
|
||||
s += ',[\n' + powerline.render(side='left' )[:-2] + '\n]'
|
||||
print ',[\n' + s + '\n]'
|
||||
sys.stdout.flush()
|
||||
lock.release()
|
||||
|
||||
sub = i3.Subscription( render, 'workspace' )
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user