예제 #1
0
    from misc import setup
    setup.setup()
except ImportError:
    print "Not importing misc.setup"
    pass

# we import docutils before installing the packager to prevent
# messing with the datadir which causes epydoc to crash
try:
    import docutils
except ImportError:
    print "Not importing docutils"
    pass

from flumotion.common import boot
boot.init_gobject()
boot.init_gst()
from twisted.internet import gtk2reactor
gtk2reactor.install(useGtk=False)

# reinstall our import hooks that could have been overridden by
# pygtk/pygst ltihooks
from flumotion.common import package
package.getPackager().install()

# monkey patching twisted doc errors
from twisted.spread import pb


def login(self, credentials, client=None):
    """Login and get perspective from remote PB server.
예제 #2
0
else:
    log.info('check', 'using default reactor')

# have to choose the reactor before calling this method
log.logTwisted()

# FIXME: boot.py does this, but enabling this borks
# test_common_package.py. I have no idea what that code does, either.
#
# # installing the reactor could override our packager's import hooks ...
# from twisted.internet import reactor
# # ... so we install them again here to be safe
# from flumotion.common import package
# package.getPackager().install()

# make sure we have the right gst-python version
from flumotion.common import boot
boot.init_gobject()
boot.init_gst()

# fdpass is a built module,  so it lives in builddir, while the package
# __init__ is in srcdir.  Append to its __path__ to make the tests work
i = os.getcwd().find('_build')
if i > -1:
    top_builddir = os.path.join(os.getcwd()[:i], '_build')
    from flumotion.extern import fdpass
    fdpass.__path__.append(os.path.join(top_builddir, 'flumotion', 'extern',
        'fdpass'))

del boot, flumotion, i, log, useGtk3Reactor