mirror of https://github.com/0intro/wmii
Work around seeming subprocess/threading bug in python 2.6.3.
This commit is contained in:
parent
26db14166b
commit
ea0e1bbe5d
|
@ -1,5 +1,4 @@
|
|||
from pygmi.util import call
|
||||
from threading import Thread
|
||||
|
||||
__all__ = 'Menu', 'ClickMenu'
|
||||
|
||||
|
@ -9,8 +8,8 @@ def inthread(fn, action):
|
|||
if action:
|
||||
return action(res)
|
||||
return res
|
||||
if not action:
|
||||
return run()
|
||||
return run()
|
||||
# Bug.
|
||||
t = Thread(target=run)
|
||||
t.daemon = True
|
||||
t.start()
|
||||
|
|
|
@ -13,7 +13,7 @@ def call(*args, **kwargs):
|
|||
input = kwargs.pop('input', None)
|
||||
p = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE, cwd=os.environ['HOME'],
|
||||
**kwargs)
|
||||
close_fds=True, **kwargs)
|
||||
if not background:
|
||||
return p.communicate(input)[0].rstrip('\n')
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import datetime
|
||||
import operator
|
||||
import os
|
||||
import re
|
||||
|
@ -52,8 +53,7 @@ def load(self):
|
|||
return re.sub(r'^.*: ', '', call('uptime')).replace(', ', ' ')
|
||||
@defmonitor
|
||||
def time(self):
|
||||
from datetime import datetime
|
||||
return datetime.now().strftime('%c')
|
||||
return datetime.datetime.now().strftime('%c')
|
||||
|
||||
wmii.colrules = (
|
||||
('gimp', '17+83+41'),
|
||||
|
|
Loading…
Reference in New Issue