diff --git a/.gitignore b/.gitignore index 36b619d3..56c9ed8f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,11 @@ .cache .eggs .coverage* -.DS_Store +*.idea +*.DS_Store* build dist +docs/_build splunksolutionlib.egg-info coverage-reports test-reports diff --git a/Makefile b/Makefile deleted file mode 100644 index b3d6b421..00000000 --- a/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -.PHONY: all -all: init - -.PHONY: init -init: - pip install -r requirements.txt - -.PHONY: test -test: - py.test tests - -.PHONY: coverage -coverage: - py.test --verbose --cov-report term --cov=splunksolutionlib tests - -.PHONY: install -install: - python setup.py install --record install_record.txt - -.PHONY: uninstall -uninstall: - cat install_record.txt|xargs rm -rfv - rm -rf install_record.txt - -.PHONY: docs -docs: - make -C docs - -.PHONY: clean -clean: - rm -rfv .cache - rm -rfv .eggs - rm -rfv .coverage* - rm -rfv build - rm -rfv dist - rm -rfv splunksolutionlib.egg-info - rm -rfv tests/__pycache__ - find . -name "*.pyc"|xargs rm -rfv - make -C docs clean diff --git a/docs/Makefile b/docs/Makefile index 451b667d..c6377f9c 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,10 +1,216 @@ -.PHONY: all -all: - rm -rf build - sphinx-apidoc -F -o build ../splunksolutionlib/ - cp templates/conf.py build/ - make -C build html +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# User-friendly check for sphinx-build +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +endif + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " applehelp to make an Apple Help Book" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @echo " coverage to run coverage check of the documentation (if enabled)" .PHONY: clean clean: - rm -rfv build + rm -rf $(BUILDDIR)/* + +.PHONY: html +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +.PHONY: dirhtml +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +.PHONY: singlehtml +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +.PHONY: pickle +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +.PHONY: json +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +.PHONY: htmlhelp +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +.PHONY: qthelp +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/splunksolutionlib.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/splunksolutionlib.qhc" + +.PHONY: applehelp +applehelp: + $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp + @echo + @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." + @echo "N.B. You won't be able to view it unless you put it in" \ + "~/Library/Documentation/Help or install it in your application" \ + "bundle." + +.PHONY: devhelp +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/splunksolutionlib" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/splunksolutionlib" + @echo "# devhelp" + +.PHONY: epub +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +.PHONY: latex +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +.PHONY: latexpdf +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +.PHONY: latexpdfja +latexpdfja: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +.PHONY: text +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +.PHONY: man +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +.PHONY: texinfo +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +.PHONY: info +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +.PHONY: gettext +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +.PHONY: changes +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +.PHONY: linkcheck +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +.PHONY: doctest +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +.PHONY: coverage +coverage: + $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage + @echo "Testing of coverage in the sources finished, look at the " \ + "results in $(BUILDDIR)/coverage/python.txt." + +.PHONY: xml +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +.PHONY: pseudoxml +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/docs/templates/conf.py b/docs/conf.py similarity index 90% rename from docs/templates/conf.py rename to docs/conf.py index 6b1126e1..976d6997 100644 --- a/docs/templates/conf.py +++ b/docs/conf.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # -# Splunksolutionlib documentation build configuration file, created by -# sphinx-quickstart on Wed Feb 24 14:14:00 2016. +# splunksolutionlib documentation build configuration file, created by +# sphinx-quickstart on Sat Feb 27 15:17:42 2016. # # This file is execfile()d with the current directory set to its # containing dir. @@ -18,8 +18,7 @@ # 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. -#sys.path.insert(0, os.path.abspath('.')) -sys.path.insert(0, op.dirname(op.dirname(op.dirname(__file__)))) +sys.path.insert(0, op.dirname(op.dirname(op.abspath(__file__)))) import splunksolutionlib @@ -34,7 +33,7 @@ extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.todo', - 'sphinx.ext.viewcode' + 'sphinx.ext.viewcode', ] # Add any paths that contain templates here, relative to this directory. @@ -52,9 +51,9 @@ master_doc = 'index' # General information about the project. -project = splunksolutionlib.__title__ -copyright = splunksolutionlib.__copyright__ -author = splunksolutionlib.__author__ +project = u'Splunk Solution SDK for Python' +copyright = u'2016, Splunk Inc' +author = u'Splunk Inc' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -63,14 +62,14 @@ # The short X.Y version. version = splunksolutionlib.__version__ # The full version, including alpha/beta/rc tags. -release = splunksolutionlib.__release__ +release = splunksolutionlib.__version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +#language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: @@ -87,15 +86,15 @@ #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. -add_function_parentheses = False +#add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). -add_module_names = False +#add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. -show_authors = True +#show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' @@ -114,24 +113,22 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'classic' +html_theme = 'default' # 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 # documentation. -html_theme_options = { - "stickysidebar": "true", -} +html_theme_options = {"stickysidebar": True} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". -html_title = 'Splunksolutionlib Documentation' +html_title = "Splunk Solution SDK for Python API Reference" # A shorter title for the navigation bar. Default is the same as html_title. -html_short_title = 'Splunksolutionlib' +html_short_title = "Splunk Solution SDK for Python API Reference" # The name of an image file (relative to this directory) to place at the top # of the sidebar. @@ -174,7 +171,7 @@ #html_use_index = True # If true, the index is split into individual pages for each letter. -html_split_index = True +#html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True @@ -183,7 +180,7 @@ html_show_sphinx = False # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -html_show_copyright = True +#html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the @@ -208,7 +205,7 @@ #html_search_scorer = 'scorer.js' # Output file base name for HTML help builder. -htmlhelp_basename = 'Splunksolutionlibdoc' +htmlhelp_basename = 'SplunkSolutionPythonSDKdoc' # -- Options for LaTeX output --------------------------------------------- @@ -230,8 +227,8 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'splunksolutionlib.tex', u'Splunksolutionlib Documentation', - u'Author', 'manual'), + (master_doc, 'SplunkSolutionPythonSDKdoc.tex', u'Splunk Solution SDK for Python Documentation', + u'SPlunk Inc', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -260,8 +257,8 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, 'splunksolutionlib', u'Splunksolutionlib Documentation', - [author], 1) + ('index', 'splunksolutionlib', u'Splunk Solution SDK for Python API Documentation', + [u'Splunk Inc'], 1) ] # If true, show URL addresses after external links. @@ -274,8 +271,8 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'splunksolutionlib', u'Splunksolutionlib Documentation', - author, 'splunksolutionlib', 'One line description of project.', + ('index', 'splunksolutionlib', u'Splunk Solution SDK for Python API Documentation', + u'Splunk Inc', 'splunksolutionlib', 'API reference for Splunk Solution SDK for Python.', 'Miscellaneous'), ] diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 00000000..0aeadd41 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,20 @@ +.. splunksolutionlib documentation master file, created by + sphinx-quickstart on Sat Feb 27 15:17:42 2016. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Splunk Solution Library API reference. +========================================================= + +.. toctree:: + :maxdepth: 2 + + splunksolutionlib/init + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 00000000..691de146 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,263 @@ +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=_build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . +set I18NSPHINXOPTS=%SPHINXOPTS% . +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% + set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. texinfo to make Texinfo files + echo. gettext to make PO message catalogs + echo. changes to make an overview over all changed/added/deprecated items + echo. xml to make Docutils-native XML files + echo. pseudoxml to make pseudoxml-XML files for display purposes + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + echo. coverage to run coverage check of the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + + +REM Check if sphinx-build is available and fallback to Python version if any +%SPHINXBUILD% 1>NUL 2>NUL +if errorlevel 9009 goto sphinx_python +goto sphinx_ok + +:sphinx_python + +set SPHINXBUILD=python -m sphinx.__init__ +%SPHINXBUILD% 2> nul +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +:sphinx_ok + + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\splunksolutionlib.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\splunksolutionlib.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdf" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf + cd %~dp0 + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdfja" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf-ja + cd %~dp0 + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "texinfo" ( + %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. + goto end +) + +if "%1" == "gettext" ( + %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The message catalogs are in %BUILDDIR%/locale. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + if errorlevel 1 exit /b 1 + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + if errorlevel 1 exit /b 1 + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + if errorlevel 1 exit /b 1 + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +if "%1" == "coverage" ( + %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage + if errorlevel 1 exit /b 1 + echo. + echo.Testing of coverage in the sources finished, look at the ^ +results in %BUILDDIR%/coverage/python.txt. + goto end +) + +if "%1" == "xml" ( + %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The XML files are in %BUILDDIR%/xml. + goto end +) + +if "%1" == "pseudoxml" ( + %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. + goto end +) + +:end diff --git a/docs/splunksolutionlib/common/file_monitor.rst b/docs/splunksolutionlib/common/file_monitor.rst new file mode 100644 index 00000000..b671c88a --- /dev/null +++ b/docs/splunksolutionlib/common/file_monitor.rst @@ -0,0 +1,10 @@ +splunksolutionlib.common.file_monitor +------------------------------------- + +.. automodule:: splunksolutionlib.common.file_monitor + +.. autoclass:: FileChangesChecker + :members: + +.. autoclass:: FileMonitor + :members: diff --git a/docs/splunksolutionlib/common/init.rst b/docs/splunksolutionlib/common/init.rst new file mode 100644 index 00000000..29c271c7 --- /dev/null +++ b/docs/splunksolutionlib/common/init.rst @@ -0,0 +1,58 @@ +splunksolutionlib.common +------------------------ + +.. toctree:: + :maxdepth: 2 + + file_monitor + log + orphan_process_monitor + pattern + utils + +Module Contents: +~~~~~~~~~~~~~~~~ + + .. automodule:: splunksolutionlib.common + :members: + +Submodules: +~~~~~~~~~~~ + +:doc:`file_monitor` + + :class:`~splunksolutionlib.common.file_monitor.FileChangesChecker` class + + :class:`~splunksolutionlib.common.file_monitor.FileMonitor` class + +:doc:`log` + + :func:`~splunksolutionlib.common.log.log_enter_exit` function + + :class:`~splunksolutionlib.common.log.Logs` class + +:doc:`orphan_process_monitor` + + :class:`~splunksolutionlib.common.orphan_process_monitor.OrphanProcessChecker` class + + :class:`~splunksolutionlib.common.orphan_process_monitor.OrphanProcessMonitor` class + +:doc:`pattern` + + :class:`~splunksolutionlib.common.pattern.Singleton` class + +:doc:`utils` + + :func:`~splunksolutionlib.common.utils.handle_tear_down_signals` function + + :func:`~splunksolutionlib.common.utils.datetime_to_seconds` function + + :func:`~splunksolutionlib.common.utils.is_true` function + + :func:`~splunksolutionlib.common.utils.is_false` function + + :func:`~splunksolutionlib.common.utils.remove_http_proxy_env_vars` function + + :func:`~splunksolutionlib.common.utils.get_appname_from_path` function + + :func:`~splunksolutionlib.common.utils.escape_json_control_chars` function diff --git a/docs/splunksolutionlib/common/log.rst b/docs/splunksolutionlib/common/log.rst new file mode 100644 index 00000000..6de00ae9 --- /dev/null +++ b/docs/splunksolutionlib/common/log.rst @@ -0,0 +1,9 @@ +splunksolutionlib.common.log +---------------------------- + +.. automodule:: splunksolutionlib.common.log + +.. autofunction:: log_enter_exit + +.. autoclass:: Logs + :members: diff --git a/docs/splunksolutionlib/common/orphan_process_monitor.rst b/docs/splunksolutionlib/common/orphan_process_monitor.rst new file mode 100644 index 00000000..f238c368 --- /dev/null +++ b/docs/splunksolutionlib/common/orphan_process_monitor.rst @@ -0,0 +1,10 @@ +splunksolutionlib.common.orphan_process_monitor +----------------------------------------------- + +.. automodule:: splunksolutionlib.common.orphan_process_monitor + +.. autoclass:: OrphanProcessChecker + :members: + +.. autoclass:: OrphanProcessMonitor + :members: diff --git a/docs/splunksolutionlib/common/pattern.rst b/docs/splunksolutionlib/common/pattern.rst new file mode 100644 index 00000000..430b0d3d --- /dev/null +++ b/docs/splunksolutionlib/common/pattern.rst @@ -0,0 +1,7 @@ +splunksolutionlib.common.pattern +-------------------------------- + +.. automodule:: splunksolutionlib.common.pattern + +.. autoclass:: Singleton + :members: diff --git a/docs/splunksolutionlib/common/utils.rst b/docs/splunksolutionlib/common/utils.rst new file mode 100644 index 00000000..9ef3cf7f --- /dev/null +++ b/docs/splunksolutionlib/common/utils.rst @@ -0,0 +1,18 @@ +splunksolutionlib.common.utils +------------------------------ + +.. automodule:: splunksolutionlib.common.utils + +.. autofunction:: handle_tear_down_signals + +.. autofunction:: datetime_to_seconds + +.. autofunction:: is_true + +.. autofunction:: is_false + +.. autofunction:: remove_http_proxy_env_vars + +.. autofunction:: get_appname_from_path + +.. autofunction:: escape_json_control_chars diff --git a/docs/splunksolutionlib/init.rst b/docs/splunksolutionlib/init.rst new file mode 100644 index 00000000..8589b478 --- /dev/null +++ b/docs/splunksolutionlib/init.rst @@ -0,0 +1,14 @@ +splunksolutionlib +----------------- + +.. toctree:: + :maxdepth: 2 + + common/init + platform/init + +Module Contents: +~~~~~~~~~~~~~~~~ + +.. automodule:: splunksolutionlib + :members: diff --git a/docs/splunksolutionlib/platform/init.rst b/docs/splunksolutionlib/platform/init.rst new file mode 100644 index 00000000..b52ab354 --- /dev/null +++ b/docs/splunksolutionlib/platform/init.rst @@ -0,0 +1,24 @@ +splunksolutionlib.platform +-------------------------- + +.. toctree:: + :maxdepth: 2 + + platform + +Module Contents: +~~~~~~~~~~~~~~~~ + + .. automodule:: splunksolutionlib.platform + :members: + +Submodules: +~~~~~~~~~~~ + +:doc:`platform` + + :func:`~splunksolutionlib.platform.platform.make_splunkhome_path` function + + :func:`~splunksolutionlib.platform.platform.get_splunk_bin` function + + :func:`~splunksolutionlib.platform.platform.get_splunkd_uri` function diff --git a/docs/splunksolutionlib/platform/platform.rst b/docs/splunksolutionlib/platform/platform.rst new file mode 100644 index 00000000..b2e696e5 --- /dev/null +++ b/docs/splunksolutionlib/platform/platform.rst @@ -0,0 +1,10 @@ +splunksolutionlib.common.platform +--------------------------------- + +.. automodule:: splunksolutionlib.platform.platform + +.. autofunction:: make_splunkhome_path + +.. autofunction:: get_splunk_bin + +.. autofunction:: get_splunkd_uri diff --git a/setup.py b/setup.py index a149ad58..3158a3d7 100755 --- a/setup.py +++ b/setup.py @@ -109,7 +109,7 @@ def run(self): setup( name='splunksolutionlib', - description='The Splunk Software Development Kit for Solutions', + description='The Splunk Software Development Kit for Splunk Solutions', version=splunksolutionlib.__version__,