gajim-plural/src/osx/__init__.py
js 8605cd3f38 For historical reasons, we have a tab width of 3. This is strange, but
we have that in all files. To at least lesser the confusion a bit, add
vim tags for that.
Additionally, fix wrong #! in a few files.
2008-07-29 19:49:31 +00:00

45 lines
No EOL
793 B
Python

import sys, commands
from network_manager_listener import device_now_active, device_no_longer_active
if sys.platform != 'darwin':
raise ImportError('System platform is not OS X')
net_device_active = True
###
### Utility functions
###
def checkPID(pid, procname):
out = commands.getstatusoutput("ps -wwp %d" % pid)
arr = out[1].split("\n")
if ((len(arr) == 2) and (arr[1].find(procname) >= 0)):
return True
return False
import nsapp
def init():
nsapp.init()
nsapp.setNetworkCB(netDeviceChanged)
return
def shutdown():
import dbus
dbus.shutdown()
return
def netDeviceChanged():
global net_device_active
if net_device_active:
net_device_active = False
device_no_longer_active(None)
else:
net_device_active = True
device_now_active(None)
return
# vim: se ts=3: