diff --git a/daemon/core/conf.py b/daemon/core/conf.py index 97337b82..0e8f82bd 100644 --- a/daemon/core/conf.py +++ b/daemon/core/conf.py @@ -25,9 +25,6 @@ class ConfigurableManager(object): def __init__(self): """ Creates a ConfigurableManager instance. - - :param core.session.Session session: session this manager is tied to - :return: nothing """ # configurable key=values, indexed by node number self.configs = {} @@ -41,10 +38,7 @@ class ConfigurableManager(object): ConfigurableManager usually is used to: 1. Request a list of Configurables (request flag) 2. Reset manager and clear configs (reset flag) - 3. Send values that configure the manager or one of its - Configurables - - Returns any reply messages. + 3. Send values that configure the manager or one of its Configurables :param core.session.Session session: CORE session object :param ConfigData config_data: configuration data for carrying out a configuration diff --git a/daemon/core/corehandlers.py b/daemon/core/corehandlers.py index 96af2f82..5b475fdf 100644 --- a/daemon/core/corehandlers.py +++ b/daemon/core/corehandlers.py @@ -465,7 +465,7 @@ class CoreRequestHandler(SocketServer.BaseRequestHandler): """ Dispatch replies by CORE to message msg previously received from the client. - :param replies: reply messages to dispatch + :param list replies: reply messages to dispatch :param message: message for replies :return: nothing """ @@ -1763,12 +1763,6 @@ class BaseAuxRequestHandler(CoreRequestHandler): self.session.shutdown() return SocketServer.BaseRequestHandler.finish(self) - """ - ======================================================================= - Concrete AuxRequestHandler classes must redefine the following methods - ======================================================================= - """ - def receive_message(self): """ Receive data from the client in the supported format. Parse, transform to CORE API format and @@ -1783,24 +1777,13 @@ class BaseAuxRequestHandler(CoreRequestHandler): def dispatch_replies(self, replies, message): """ - Dispatch CORE "replies" to a previously received message "msg" from a client. + Dispatch CORE replies to a previously received message msg from a client. Replies passed to this method follow the CORE API. This method allows transformation to the form supported by the auxiliary handler and within the context of "msg". Add transformation and transmission code here. - EXAMPLE: - transformed_replies = stateful_transform (replies, msg) # stateful_transform method needs to be defined - if transformed_replies: - for reply in transformed_replies: - try: - self.request.sendall(reply) - except Exception, e: - if self.debug: - logger.info("-"*60) - traceback.print_exc(file=sys.stdout) - logger.info("-"*60) - raise e - + :param list replies: replies to dispatch + :param message: message being replied to :return: nothing """ raise NotImplemented @@ -1811,19 +1794,7 @@ class BaseAuxRequestHandler(CoreRequestHandler): in CORE API format. This method allows transformation to the required format supported by this handler prior to transmission. - EXAMPLE: - msgs = self.transform(data) # transform method needs to be defined - if msgs: - for msg in msgs: - try: - self.request.sendall(reply) - except Exception, e: - if self.debug: - logger.info("-"*60) - traceback.print_exc(file=sys.stdout) - logger.info("-"*60) - raise e - + :param data: data to send :return: nothing """ raise NotImplemented diff --git a/daemon/core/coreobj.py b/daemon/core/coreobj.py index 05a99219..76fb59e0 100644 --- a/daemon/core/coreobj.py +++ b/daemon/core/coreobj.py @@ -250,7 +250,7 @@ class PyCoreObj(object): :param flags: message flags :return: list of link data - :rtype: link + :rtype: core.data.LinkData """ return [] @@ -598,7 +598,7 @@ class PyCoreNetIf(object): """ Attach network. - :param PyCoreNet net: network to attach to + :param core.coreobj.PyCoreNet net: network to attach to :return:nothing """ if self.net: diff --git a/daemon/core/emane/emanemanager.py b/daemon/core/emane/emanemanager.py index 729815b9..69722796 100644 --- a/daemon/core/emane/emanemanager.py +++ b/daemon/core/emane/emanemanager.py @@ -112,12 +112,11 @@ class EmaneManager(ConfigurableManager): def initeventservice(self, filename=None, shutdown=False): """ - (Re-)initialize the EMANE Event service. + Re-initialize the EMANE Event service. The multicast group and/or port may be configured. - - For versions < 0.9.1 this can be changed via XML config file - and an environment variable pointing to that file. - - For version >= 0.9.1 this is passed into the EventService - constructor. + - For versions < 0.9.1 this can be changed via XML config file and an environment variable + pointing to that file. + - For version >= 0.9.1 this is passed into the EventService constructor. """ logger.info("initializing emane event service: %s", emane.VERSIONSTR) diff --git a/daemon/core/emane/emanemodel.py b/daemon/core/emane/emanemodel.py index ae8fac81..642dd4f9 100644 --- a/daemon/core/emane/emanemodel.py +++ b/daemon/core/emane/emanemodel.py @@ -73,10 +73,12 @@ class EmaneModel(WirelessModel): def buildplatformxmlnementry(self, doc, n, ifc): """ Build the NEM definition that goes into the platform.xml file. + This returns an XML element that will be added to the element. - This default method supports per-interface config - (e.g. or per-EmaneNode - config (e.g. . + + This default method supports per-interface config (e.g. + or per-EmaneNode config (e.g. . + This can be overriden by a model for NEM flexibility; n is the EmaneNode. """ nem = doc.createElement("nem") diff --git a/daemon/doc/conf.py.in b/daemon/doc/conf.py.in index 849cedeb..7b44569f 100644 --- a/daemon/doc/conf.py.in +++ b/daemon/doc/conf.py.in @@ -12,6 +12,7 @@ # serve to show the default. import sys, os +import sphinx_rtd_theme # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -25,7 +26,7 @@ import sys, os # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.pngmath', 'sphinx.ext.ifconfig'] +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.imgmath', 'sphinx.ext.ifconfig'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -41,7 +42,7 @@ master_doc = 'index' # General information about the project. project = u'CORE Python modules' -copyright = u'2012, core-dev' +copyright = u'2017, core-dev' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -91,7 +92,7 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +html_theme = 'sphinx_rtd_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -99,7 +100,7 @@ html_theme = 'default' #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] +html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". @@ -222,7 +223,7 @@ man_pages = [ epub_title = u'CORE Python' epub_author = u'core-dev' epub_publisher = u'core-dev' -epub_copyright = u'2012, core-dev' +epub_copyright = u'2017, core-dev' # The language of the text. It defaults to the language option # or en if the language is not set.