[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r28149 - in gnunet-planetlab/gplmt: . gplmt
From: |
gnunet |
Subject: |
[GNUnet-SVN] r28149 - in gnunet-planetlab/gplmt: . gplmt |
Date: |
Thu, 18 Jul 2013 13:49:05 +0200 |
Author: wachs
Date: 2013-07-18 13:49:04 +0200 (Thu, 18 Jul 2013)
New Revision: 28149
Modified:
gnunet-planetlab/gplmt/gplmt.py
gnunet-planetlab/gplmt/gplmt/Targets.py
gnunet-planetlab/gplmt/gplmt/Worker.py
Log:
adding target to worker
Modified: gnunet-planetlab/gplmt/gplmt/Targets.py
===================================================================
--- gnunet-planetlab/gplmt/gplmt/Targets.py 2013-07-18 11:42:38 UTC (rev
28148)
+++ gnunet-planetlab/gplmt/gplmt/Targets.py 2013-07-18 11:49:04 UTC (rev
28149)
@@ -22,7 +22,6 @@
#
# Target
-
class Target ():
undefined = 0
local = 1
@@ -40,13 +39,19 @@
else:
return "undefined"
def __ne__(self,y):
+ if (y == None):
+ return True
if (self.value==y.value):
return False
else:
return True
def __cmp__(self,y):
+ if (y == None):
+ return False
return self.value==y.value
def __eq__(self,y):
+ if (y == None):
+ return False
return self.value==y.value
@staticmethod
def create (source_str):
Modified: gnunet-planetlab/gplmt/gplmt/Worker.py
===================================================================
--- gnunet-planetlab/gplmt/gplmt/Worker.py 2013-07-18 11:42:38 UTC (rev
28148)
+++ gnunet-planetlab/gplmt/gplmt/Worker.py 2013-07-18 11:49:04 UTC (rev
28149)
@@ -409,11 +409,13 @@
self.thread.start()
class Worker:
- def __init__(self, logger, configuration, nodes, tasks, notifications):
+ def __init__(self, logger, configuration, target, nodes, tasks,
notifications):
global g_logger;
global g_configuration;
global g_notifications;
assert (None != logger)
+ assert (None != configuration)
+ assert (None != target)
assert (None != nodes)
assert (None != tasks)
assert (None != notifications)
@@ -423,6 +425,7 @@
assert (hasattr(notifications, 'tasklist_completed'))
assert (hasattr(notifications, 'task_started'))
assert (hasattr(notifications, 'task_completed'))
+ self.target = target
self.nodes = nodes
self.tasks = tasks
g_configuration = configuration
Modified: gnunet-planetlab/gplmt/gplmt.py
===================================================================
--- gnunet-planetlab/gplmt/gplmt.py 2013-07-18 11:42:38 UTC (rev 28148)
+++ gnunet-planetlab/gplmt/gplmt.py 2013-07-18 11:49:04 UTC (rev 28149)
@@ -25,6 +25,7 @@
# Checking dependencies
# ElementTree XML Parser
import sys
+
try:
from elementtree import ElementTree
elementtree_loaded = True
@@ -167,11 +168,9 @@
print "Please enter PlanetLab password:"
configuration.pl_password = getpass.getpass()
configuration.pl_password =
configuration.pl_password.strip()
-
# Load hosts files: single host, nodes files, planetlab
# command line beats configuration
-
if ((None == single_host) and (None == configuration.nodesfile) and
(target != Targets.Target (Targets.Target.planetlab))):
print "No nodes to use given!\n"
@@ -209,10 +208,10 @@
notifications = Notifications.TaskListResultNotification
(main.logger)
except KeyboardInterrupt:
sys.exit(0)
-
+ print str (target)
# Start execution
try:
- worker = Worker.Worker (main.logger, configuration, nodes, tasklist,
notifications)
+ worker = Worker.Worker (main.logger, configuration, target, nodes,
tasklist, notifications)
worker.start()
except KeyboardInterrupt:
print "Interrupt during execution, FIXME!"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r28149 - in gnunet-planetlab/gplmt: . gplmt,
gnunet <=