changeset 1450:d611209ceeaa

boost: Simplify installation.
author Marcel Keller <mkeller@cs.au.dk>
date Mon, 19 Jul 2010 18:30:11 +0200
parents d6bd88318fc6
children 422bb9776aee
files apps/aes.py viff/boost.py
diffstat 2 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/apps/aes.py	Mon Jul 19 18:23:13 2010 +0200
+++ b/apps/aes.py	Mon Jul 19 18:30:11 2010 +0200
@@ -26,14 +26,10 @@
 import sys
 
 import viff.boost
-viff.boost.installDeferred()
+viff.boost.install()
 
-import viff.reactor
-viff.reactor.install()
 from twisted.internet import reactor
 
-viff.boost.installShare()
-
 from viff.field import GF256
 from viff.runtime import Runtime, create_runtime, gather_shares
 from viff.config import load_config
--- a/viff/boost.py	Mon Jul 19 18:23:13 2010 +0200
+++ b/viff/boost.py	Mon Jul 19 18:30:11 2010 +0200
@@ -105,12 +105,15 @@
 FAILURE = False
 
 
-def installDeferred():
+def install(with_viff_reactor=True):
     global viff
     twisted.internet.defer.Deferred = viff.cdefer.Deferred
     twisted.internet.defer.DeferredList = DeferredList
 
-def installShare():
+    if with_viff_reactor:
+        import viff.reactor
+        viff.reactor.install()
+
     import viff.runtime
     viff.runtime.Share = Share
     viff.runtime.ShareList = ShareList