diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d4bb2cb --- /dev/null +++ b/Makefile @@ -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) diff --git a/conf.py b/conf.py new file mode 100644 index 0000000..97401d7 --- /dev/null +++ b/conf.py @@ -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'] \ No newline at end of file diff --git a/index.rst b/index.rst new file mode 100644 index 0000000..92f91f1 --- /dev/null +++ b/index.rst @@ -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 `_ Is a python module to perform automatic updates of distribution binaries in user machines. This module has been forked from the `app_updater module `_ and extended to our needs at `MCV Software `_ 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` diff --git a/make.bat b/make.bat new file mode 100644 index 0000000..8084272 --- /dev/null +++ b/make.bat @@ -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 diff --git a/source/generating_updates.rst b/source/generating_updates.rst new file mode 100644 index 0000000..ea66296 --- /dev/null +++ b/source/generating_updates.rst @@ -0,0 +1,12 @@ +Generating updates +=================== + +The updater package will work with any module used to generate distributable files, such as `Nuitka, `_ `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. \ No newline at end of file diff --git a/source/modules.rst b/source/modules.rst new file mode 100644 index 0000000..6c9f0aa --- /dev/null +++ b/source/modules.rst @@ -0,0 +1,7 @@ +updater +======= + +.. toctree:: + :maxdepth: 4 + + updater diff --git a/source/updater.rst b/source/updater.rst new file mode 100644 index 0000000..bc5d3b1 --- /dev/null +++ b/source/updater.rst @@ -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: