Added initial work to generate sphinx documentation

This commit is contained in:
Manuel Cortez 2022-02-18 16:58:19 -06:00
parent 42b60d19a1
commit e912925c52
No known key found for this signature in database
GPG Key ID: 9E0735CA15EFE790
7 changed files with 195 additions and 0 deletions

20
Makefile Normal file
View File

@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

59
conf.py Normal file
View File

@ -0,0 +1,59 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# 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.
#
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
# -- Project information -----------------------------------------------------
project = 'Updater'
copyright = '2022, MCV Software'
author = 'Manuel Cortez'
# The full version, including alpha/beta/rc tags
release = '0.1'
# -- General configuration ---------------------------------------------------
autoclass_content="both"
intersphinx_mapping = {"python": ("https://docs.python.org/3", None),
"requests": ("https://docs.python-requests.org/en/master", None),
"pubsub": ("https://pypubsub.readthedocs.io/en/v4.0.3/", None),
}
# 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.intersphinx"
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

25
index.rst Normal file
View File

@ -0,0 +1,25 @@
.. Updater documentation master file, created by
sphinx-quickstart on Thu Feb 17 08:58:37 2022.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Updater 0.1 documentation
------------------------------------
`Updater <https://github.com/mcv-software/updater>`_ Is a python module to perform automatic updates of distribution binaries in user machines. This module has been forked from the `app_updater module <https://github.com/accessibleapps/app_updater>`_ and extended to our needs at `MCV Software <https://mcvsoftware.com>`_ by providing a new mechanism to communicate update progress and decoupling the Graphical User Interface from the module logic.
Note: This module is under active development. Currently we are in the process of adding implementations (or updater classes) that will provide support to a variety of user interfaces, but this is not complete yet.
.. toctree::
:maxdepth: 2
:caption: Contents:
source/generating_updates.rst
source/modules
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

35
make.bat Normal file
View File

@ -0,0 +1,35 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 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.https://www.sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd

View File

@ -0,0 +1,12 @@
Generating updates
===================
The updater package will work with any module used to generate distributable files, such as `Nuitka, <https://www.nuitka.net>`_ `CX-Freeze <https://pypi.org/project/cx-Freeze/>`_ and others, as long as a valid update file is provided. A valid update file is basically a zip file containing a binary distributable version of an application, plus the bootstrap binary for the operating system. The botstrap binary, as well as any other application file, must be in the root of the zipfile.
Here is what you need to do, in order to generate an update for any operating system.
1. Create the distributable version of the application. You can use any package to do so. You should end with a folder where an executable file, as well as all of its dependencies (including package data and other application files) are included.
2. Copy the bootstrapper binary file. (more instructions here).
3. Zip the whole folder of distributable files. Take into account that you need to create a zip file where your application files must be the root folder of the zip. The updater package includes a small utility command in order to create a zip file from any created folder.
4. Upload the zip file to any known site that could give you a direct URL to the file.
5. When asked, users should be able to download and install the update.

7
source/modules.rst Normal file
View File

@ -0,0 +1,7 @@
updater
=======
.. toctree::
:maxdepth: 4
updater

37
source/updater.rst Normal file
View File

@ -0,0 +1,37 @@
updater package
===============
Submodules
----------
updater.core module
-------------------
.. automodule:: updater.core
:members:
:undoc-members:
:show-inheritance:
updater.utils module
--------------------
.. automodule:: updater.utils
:members:
:undoc-members:
:show-inheritance:
updater.wxupdater module
------------------------
.. automodule:: updater.wxupdater
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: updater
:members:
:undoc-members:
:show-inheritance: