#!/usr/bin/env python

import getopt, sys
from os.path import *

try:
	import ltihooks
except:
	pass

# Allow to use uninstalled
def _check(path):
	return exists(path) and isdir(path) and isfile(path+"/AUTHORS")

name = join(dirname(__file__), '..')
if _check(name):
	print 'Running uninstalled tpblue, modifying PYTHONPATH'
	sys.path.insert(0, abspath(name))
else:
	sys.path.insert(0, abspath("@PYTHONDIR@"))
	print "Running installed tpblue, using [@PYTHONDIR@:$PYTHONPATH]"
	
import dbus, dbus.glib, gobject, tpblue.ConnectionManager

loop = gobject.MainLoop()

cmgr = tpblue.ConnectionManager.ConnectionManager()

print 'In Mainloop'
loop.run()
