From 87993001a7627f6ba4a04ff02724c80dbed58409 Mon Sep 17 00:00:00 2001 From: Julien Tribino Date: Wed, 12 Jun 2013 10:47:29 +0200 Subject: [PATCH] upgrade documentation --- src/nepi/execution/ec.py | 17 ++++++++--------- src/nepi/execution/resource.py | 9 ++++----- src/nepi/execution/scheduler.py | 8 +++++--- src/nepi/resources/ns3/ns3wrapper_server.py | 4 ++-- src/nepi/resources/omf/channel.py | 2 +- src/nepi/resources/omf/node.py | 2 +- src/nepi/util/sfa_api.py | 6 +++--- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/nepi/execution/ec.py b/src/nepi/execution/ec.py index ba573c49..c4917c0e 100644 --- a/src/nepi/execution/ec.py +++ b/src/nepi/execution/ec.py @@ -54,10 +54,9 @@ class ExperimentController(object): :type root_dir: str .. note:: - - This class is the only one used by the User. Indeed, the user "talks" - only with the Experiment Controller and this latter forward to - the different Resources Manager the order provided by the user. + This class is the only one used by the User. Indeed, the user "talks" + only with the Experiment Controller and this latter forward to + the different Resources Manager the order provided by the user. """ @@ -165,7 +164,8 @@ class ExperimentController(object): def resources(self): """ Returns the list of all the Resource Manager Id - :rtype: set + :rtype: set + """ return self._resources.keys() @@ -175,8 +175,8 @@ class ExperimentController(object): :param rtype: Type of the RM :type rtype: str - :return : Id of the RM - :rtype: int + :return: Id of the RM + :rtype: int """ # Get next available guid guid = self._guid_generator.next(guid) @@ -194,7 +194,7 @@ class ExperimentController(object): :param guid: Guid of the RM :type guid: int - :return : List of attributes + :return: List of attributes :rtype: list """ rm = self.get_resource(guid) @@ -209,7 +209,6 @@ class ExperimentController(object): :param guid2: Second guid to connect :type guid: ResourceManager - """ rm1 = self.get_resource(guid1) rm2 = self.get_resource(guid2) diff --git a/src/nepi/execution/resource.py b/src/nepi/execution/resource.py index 078b07d1..9f1cfa4f 100644 --- a/src/nepi/execution/resource.py +++ b/src/nepi/execution/resource.py @@ -405,11 +405,11 @@ class ResourceManager(Logger): conditions.append((group, state, time)) def get_connected(self, rtype): - """ Return the list of RM with the type 'rtype' + """ Return the list of RM with the type 'rtype' :param rtype: Type of the RM we look for :type rtype: str - :return : list of guid + :return: list of guid """ connected = [] for guid in self.connections: @@ -473,8 +473,8 @@ class ResourceManager(Logger): def set_with_conditions(self, name, value, group, state, time): """ Set value 'value' on attribute with name 'name' when 'time' - has elapsed since all elements in 'group' have reached state - 'state' + has elapsed since all elements in 'group' have reached state + 'state' :param name: Name of the attribute to set :type name: str @@ -486,7 +486,6 @@ class ResourceManager(Logger): :type state: str :param time: Time to wait after 'state' is reached on all RMs in group. (e.g. '2s') :type time: str - """ reschedule = False diff --git a/src/nepi/execution/scheduler.py b/src/nepi/execution/scheduler.py index 1b353627..8d70fbb7 100644 --- a/src/nepi/execution/scheduler.py +++ b/src/nepi/execution/scheduler.py @@ -42,9 +42,11 @@ class HeapScheduler(object): .. note:: - This class is thread safe. - All calls to C Extensions are made atomic by the GIL in the CPython implementation. - heapq.heappush, heapq.heappop, and list access are therefore thread-safe """ + This class is thread safe. + All calls to C Extensions are made atomic by the GIL in the CPython implementation. + heapq.heappush, heapq.heappop, and list access are therefore thread-safe. + + """ def __init__(self): super(HeapScheduler, self).__init__() diff --git a/src/nepi/resources/ns3/ns3wrapper_server.py b/src/nepi/resources/ns3/ns3wrapper_server.py index 982d82ed..27739481 100644 --- a/src/nepi/resources/ns3/ns3wrapper_server.py +++ b/src/nepi/resources/ns3/ns3wrapper_server.py @@ -16,7 +16,7 @@ # along with this program. If not, see . # -""" + class Server(object): def __init__(self, root_dir = ".", log_level = "ERROR", @@ -361,4 +361,4 @@ class Forwarder(object): self._ctrl_sock.close() except: pass -""" + diff --git a/src/nepi/resources/omf/channel.py b/src/nepi/resources/omf/channel.py index 1eaef050..02974a88 100644 --- a/src/nepi/resources/omf/channel.py +++ b/src/nepi/resources/omf/channel.py @@ -11,7 +11,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -c + You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/src/nepi/resources/omf/node.py b/src/nepi/resources/omf/node.py index 156ba86d..95f630b5 100644 --- a/src/nepi/resources/omf/node.py +++ b/src/nepi/resources/omf/node.py @@ -150,7 +150,7 @@ class OMFNode(ResourceManager): """ pass - def start(self): + def start(self): """Start the RM. It means nothing special for an interface for now It becomes STARTED as soon as this method starts. diff --git a/src/nepi/util/sfa_api.py b/src/nepi/util/sfa_api.py index 7356be5c..f3df754c 100644 --- a/src/nepi/util/sfa_api.py +++ b/src/nepi/util/sfa_api.py @@ -22,7 +22,7 @@ import logging import hashlib -from parser import sfa_sfav1 +from sfa_sfav1 import SFAResourcesParser import subprocess import warnings @@ -262,8 +262,8 @@ class SFAApiFactory(object): def get_api(slice_id = None, sfi_auth = None, sfi_user = None, sfi_registry = None, sfi_sm = None, timeout = None, private_key = None): - key = cls.make_key(aggregate = 'ple', slice_id, sfi_auth, sfi_user, sfi_registry, sfi_sm, - timeout, private_key) + key = cls.make_key(slice_id, sfi_auth, sfi_user, sfi_registry, + sfi_sm, timeout, private_key, aggregate = 'ple') api = cls._apis.get(key) cls.lock.acquire() api._fetch_resources_info(resources = False) -- 2.43.0