import sys
from PyQt4.QtCore import QTimer
from PyQt4.QtGui import QApplication
app = QApplication(sys.argv)
app.setQuitOnLastWindowClosed(False)
def tick():
print 'tick'
timer = QTimer()
timer.timeout.connect(tick)
timer.start(1000)
# run event loop so python doesn't exit
app.exec_()
class objdict(dict):
def __getattr__(self, name):
if name in self:
return self[name]
else:
raise AttributeError("No such attribute: " + name)
def __setattr__(self, name, value):
self[name] = value
def __delattr__(self, name):
if name in self:
del self[name]
else:
raise AttributeError("No such attribute: " + name)
good_fileds = set(["actors", "composers", "counties", "directors", "genres", "id", "producers", "profit_russia",
"profit_usa", "profit_world", "rating", "scenarios", "title", "title_original", "trailers", "year"])
keys = good_fileds.intersection(movie.__dict__)
result = objdict({k: movie.__dict__.get(k) for k in keys})
result.rating
result.actors
status /var/run/openvpn-server.status
root@xxx:~# cat /var/run/openvpn-server.status
OpenVPN CLIENT LIST
Updated,Sat Jul 30 11:31:40 2016
Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since
user3,10.124.228.105:42972,2117077,2327219,Tue Jul 26 13:50:13 2016
user4,10.124.105.1:49420,6284997,6730873,Tue Jul 19 04:14:12 2016
ROUTING TABLE
Virtual Address,Common Name,Real Address,Last Ref
192.168.99.10,user3,10.124.228.105:42972,Tue Jul 26 13:50:16 2016
192.168.99.6,user4,10.124.105.1:49420,Tue Jul 19 04:14:14 2016
GLOBAL STATS
Max bcast/mcast queue length,16
END
root@xxxx