From 8147edce88278e0f7cb4f69bbb8b7a4aa6ac222d Mon Sep 17 00:00:00 2001
From: Aditya Dange <adityadange.ska@gmail.com>
Date: Mon, 4 Feb 2019 22:01:23 +0530
Subject: [PATCH] Fix documentation issue. Documents gets generated locally.

---
 docs/source/SKAAlarmHandler.rst        | 14 +++++++++++++
 docs/source/SKABaseDevice.rst          | 14 +++++++++++++
 docs/source/SKACapability.rst          | 14 +++++++++++++
 docs/source/SKALogger.rst              | 14 +++++++++++++
 docs/source/SKAMaster.rst              | 14 +++++++++++++
 docs/source/SKAObsDevice.rst           | 14 +++++++++++++
 docs/source/SKASubarray.rst            | 14 +++++++++++++
 docs/source/SKATelState.rst            | 14 +++++++++++++
 docs/source/conf.py                    | 29 +++++++++++++++-----------
 docs/source/index.rst                  | 12 +++++++----
 skabase/SKABaseDevice/SKABaseDevice.py |  7 ++++++-
 skabase/SKABaseDevice/__init__.py      | 19 ++++++++---------
 skabase/__init__.py                    | 23 +++++++++-----------
 skabase/release.py                     |  2 +-
 14 files changed, 163 insertions(+), 41 deletions(-)
 create mode 100644 docs/source/SKAAlarmHandler.rst
 create mode 100644 docs/source/SKABaseDevice.rst
 create mode 100644 docs/source/SKACapability.rst
 create mode 100644 docs/source/SKALogger.rst
 create mode 100644 docs/source/SKAMaster.rst
 create mode 100644 docs/source/SKAObsDevice.rst
 create mode 100644 docs/source/SKASubarray.rst
 create mode 100644 docs/source/SKATelState.rst

diff --git a/docs/source/SKAAlarmHandler.rst b/docs/source/SKAAlarmHandler.rst
new file mode 100644
index 00000000..adbd902e
--- /dev/null
+++ b/docs/source/SKAAlarmHandler.rst
@@ -0,0 +1,14 @@
+.. LMC Base Classes documentation master file, created by
+   sphinx-quickstart on Fri Jan 11 10:03:42 2019.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+SKA AlarmHandler
+============================================
+
+.. toctree::
+   :maxdepth: 2
+
+
+.. automodule:: SKAAlarmHandler.SKAAlarmHandler
+   :members:
diff --git a/docs/source/SKABaseDevice.rst b/docs/source/SKABaseDevice.rst
new file mode 100644
index 00000000..24258b9d
--- /dev/null
+++ b/docs/source/SKABaseDevice.rst
@@ -0,0 +1,14 @@
+.. LMC Base Classes documentation master file, created by
+   sphinx-quickstart on Fri Jan 11 10:03:42 2019.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+SKA BaseDevice
+============================================
+
+.. toctree::
+   :maxdepth: 2
+
+
+.. automodule:: SKABaseDevice.SKABaseDevice
+   :members:
diff --git a/docs/source/SKACapability.rst b/docs/source/SKACapability.rst
new file mode 100644
index 00000000..664fbb72
--- /dev/null
+++ b/docs/source/SKACapability.rst
@@ -0,0 +1,14 @@
+.. LMC Base Classes documentation master file, created by
+   sphinx-quickstart on Fri Jan 11 10:03:42 2019.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+SKA Capability
+============================================
+
+.. toctree::
+   :maxdepth: 2
+
+.. automodule:: SKACapability.SKACapability
+   :members: SKACapability
+
diff --git a/docs/source/SKALogger.rst b/docs/source/SKALogger.rst
new file mode 100644
index 00000000..0a403da0
--- /dev/null
+++ b/docs/source/SKALogger.rst
@@ -0,0 +1,14 @@
+.. LMC Base Classes documentation master file, created by
+   sphinx-quickstart on Fri Jan 11 10:03:42 2019.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+SKA Logger
+============================================
+
+.. toctree::
+   :maxdepth: 2
+
+.. automodule:: SKALogger.SKALogger
+   :members: SKALogger
+
diff --git a/docs/source/SKAMaster.rst b/docs/source/SKAMaster.rst
new file mode 100644
index 00000000..23c1951f
--- /dev/null
+++ b/docs/source/SKAMaster.rst
@@ -0,0 +1,14 @@
+.. LMC Base Classes documentation master file, created by
+   sphinx-quickstart on Fri Jan 11 10:03:42 2019.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+SKA Master
+============================================
+
+.. toctree::
+   :maxdepth: 2
+
+.. automodule:: SKAMaster.SKAMaster
+   :members: SKAMaster
+
diff --git a/docs/source/SKAObsDevice.rst b/docs/source/SKAObsDevice.rst
new file mode 100644
index 00000000..f679938c
--- /dev/null
+++ b/docs/source/SKAObsDevice.rst
@@ -0,0 +1,14 @@
+.. LMC Base Classes documentation master file, created by
+   sphinx-quickstart on Fri Jan 11 10:03:42 2019.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+SKA ObsDevice
+============================================
+
+.. toctree::
+   :maxdepth: 2
+
+.. automodule:: SKAObsDevice.SKAObsDevice
+   :members:
+
diff --git a/docs/source/SKASubarray.rst b/docs/source/SKASubarray.rst
new file mode 100644
index 00000000..ada9fef9
--- /dev/null
+++ b/docs/source/SKASubarray.rst
@@ -0,0 +1,14 @@
+.. LMC Base Classes documentation master file, created by
+   sphinx-quickstart on Fri Jan 11 10:03:42 2019.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+SKA Subarray
+============================================
+
+.. toctree::
+   :maxdepth: 2
+
+.. automodule:: SKASubarray.SKASubarray
+   :members: SKASubarray
+
diff --git a/docs/source/SKATelState.rst b/docs/source/SKATelState.rst
new file mode 100644
index 00000000..7843a841
--- /dev/null
+++ b/docs/source/SKATelState.rst
@@ -0,0 +1,14 @@
+.. LMC Base Classes documentation master file, created by
+   sphinx-quickstart on Fri Jan 11 10:03:42 2019.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+SKA TelState
+============================================
+
+.. toctree::
+   :maxdepth: 2
+
+.. automodule:: SKATelState.SKATelState
+   :members: SKATelState
+
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 947fcd2e..c8731acb 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -12,20 +12,25 @@
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 
-import sys
-import os
-from mock import Mock as MagicMock
-
-class Mock(MagicMock):
-    @classmethod
-    def __getattr__(cls, name):
-        return MagicMock()
+# import sys
+# import os
+# from mock import Mock as MagicMock
+#
+# class Mock(MagicMock):
+#     @classmethod
+#     def __getattr__(cls, name):
+#         return MagicMock()
+#
+# # Mock tango modules
+# MOCK_MODULES = ['PyTango', 'tango', 'tango.server', 'run', 'DeviceMeta', 'command',
+#                 'future', 'future.utils', 'logging', 'logging.handlers']
+# sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
 
-# Mock tango modules
-MOCK_MODULES = ['PyTango', 'tango', 'tango.server', 'run', 'DeviceMeta', 'command',
-                'future', 'future.utils', 'logging', 'logging.handlers']
-sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
+autodoc_mock_imports = ['PyTango', 'tango', 'tango.server', 'run', 'DeviceMeta', 'command',
+                        'future', 'future.utils', 'logging', 'logging.handlers']
 
+import sys
+import os
 # 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
 # documentation root, use os.path.abspath to make it absolute, like shown here.
diff --git a/docs/source/index.rst b/docs/source/index.rst
index bbdc4ab8..6f78ae67 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -10,10 +10,14 @@ Welcome to LMC Base Classes documentation!
   :caption: Table of Contents
   :maxdepth: 2
 
-.. automodule:: SKABaseDevice.SKABaseDeviceModule
-
-.. autoclass:: SKABaseDevice
-   :members:
+   SKA Alarm Handler<SKAAlarmHandler>
+   SKA Base Device<SKABaseDevice>
+   SKA Capability<SKACapability>
+   SKA Logger<SKALogger>
+   SKA Master<SKAMaster>
+   SKA ObsDevice<SKAObsDevice>
+   SKA Subarray<SKASubarray>
+   SKA TelState<SKATelState>
 
 Indices and tables
 ==================
diff --git a/skabase/SKABaseDevice/SKABaseDevice.py b/skabase/SKABaseDevice/SKABaseDevice.py
index afcc6113..bc969518 100644
--- a/skabase/SKABaseDevice/SKABaseDevice.py
+++ b/skabase/SKABaseDevice/SKABaseDevice.py
@@ -5,7 +5,7 @@
 #
 #
 
-"""skabasedevice.py: A generic base device for SKA. It exposes the generic attributes,
+"""A generic base device for SKA. It exposes the generic attributes,
 properties and commands of an SKA device.
 """
 from __future__ import print_function
@@ -642,6 +642,11 @@ class SKABaseDevice(with_metaclass(DeviceMeta, Device)):
     @DebugIt()
     def ToJson(self, argin):
         # PROTECTED REGION ID(SKABaseDevice.ToJson) ENABLED START #
+        """
+        ToJson method. Not used. To be deleted.
+        :param argin:
+        :return:
+        """
 
         # TBD - see how to use fandango's export_device_to_dict
         with exception_manager(self):
diff --git a/skabase/SKABaseDevice/__init__.py b/skabase/SKABaseDevice/__init__.py
index 7c57fad3..863849e2 100644
--- a/skabase/SKABaseDevice/__init__.py
+++ b/skabase/SKABaseDevice/__init__.py
@@ -6,14 +6,13 @@
 #
 
 """SKABASE
-
-__init__.py: A generic base device for SKA. It exposes the generic attributes, properties and commands of an SKA device.
+A generic base device for SKA. It exposes the generic attributes, properties and commands of an SKA device.
 """
-# __all__ = ["SKABaseDevice", "main"]
-#
-# from skabase import release
-# from .SKABaseDevice import SKABaseDevice, main
-#
-# __version__ = release.version
-# __version_info__ = release.version_info
-# __author__ = release.author
\ No newline at end of file
+__all__ = ["SKABaseDevice", "main"]
+
+from skabase import release
+from .SKABaseDevice import SKABaseDevice, main
+
+__version__ = release.version
+__version_info__ = release.version_info
+__author__ = release.author
diff --git a/skabase/__init__.py b/skabase/__init__.py
index f97c38d4..0876b388 100644
--- a/skabase/__init__.py
+++ b/skabase/__init__.py
@@ -1,13 +1,10 @@
-# __all__ = ["auxiliary",
-#            "SKAAlarmHandler",
-#            "SKABaseDevice",
-#            "SKACapability",
-#            "SKALogger",
-#            "SKAMaster",
-#            "SKAObsDevice",
-#            "SKASubarray",
-#            "SKATelState"
-#            ]
-
-# from pkgutil import extend_path
-# __path__ = extend_path(__path__, __name__)
\ No newline at end of file
+__all__ = ["auxiliary",
+           "SKAAlarmHandler",
+           "SKABaseDevice",
+           "SKACapability",
+           "SKALogger",
+           "SKAMaster",
+           "SKAObsDevice",
+           "SKASubarray",
+           "SKATelState"
+            ]
diff --git a/skabase/release.py b/skabase/release.py
index 970272e8..36f5b7b6 100644
--- a/skabase/release.py
+++ b/skabase/release.py
@@ -7,7 +7,7 @@
 
 """Release information for lmc-base-classes Python Package"""
 
-name = """lmc-base-classes"""
+name = """lmcbaseclasses"""
 version = "1.0.0"
 version_info = version.split(".")
 description = """A set of generic base devices for SKA Telescope."""
-- 
GitLab