From 6b861c046eb7a2302f2b6832a18a544aa25b793f Mon Sep 17 00:00:00 2001 From: Melle Dijkstra Date: Sun, 25 Feb 2018 00:37:12 +0100 Subject: [PATCH] Updated docs --- README.md | 2 +- docs/.gitignore | 3 +- docs/Makefile | 4 +- docs/make.bat | 4 +- docs/{ => source}/_static/modules.rst | 4 +- docs/{ => source}/_static/mpserver.rst | 65 ++++++++++--------- docs/{ => source}/conf.py | 90 +++++++++++++------------- docs/{ => source}/index.rst | 12 ++-- generate-docs.bat | 5 ++ mpserver/__init__.py | 13 +++- mpserver/grpc/__init__.py | 5 +- mpserver/tools.py | 14 ++-- 12 files changed, 123 insertions(+), 98 deletions(-) rename docs/{ => source}/_static/modules.rst (63%) rename docs/{ => source}/_static/mpserver.rst (53%) rename docs/{ => source}/conf.py (73%) rename docs/{ => source}/index.rst (65%) create mode 100644 generate-docs.bat diff --git a/README.md b/README.md index 5bf483c..fb96da5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Python Music Player [![GitHub license](https://img.shields.io/github/license/MelleDijkstra/PythonMusicPlayer.svg)](https://github.com/MelleDijkstra/PythonMusicPlayer/blob/master/LICENSE) [![PyPI version](https://badge.fury.io/py/melon-music-player.svg)](https://badge.fury.io/py/melon-music-player) -[![GitHub issues](https://img.shields.io/github/issues/MelleDijkstra/PythonMusicPlayer.svg)](https://github.com/MelleDijkstra/PythonMusicPlayer/issues) +[![Documentation Status](https://readthedocs.org/projects/pythonmusicplayer/badge/?version=latest)](http://pythonmusicplayer.readthedocs.io/en/latest/?badge=latest) [![Twitter](https://img.shields.io/twitter/url/https/github.com/MelleDijkstra/PythonMusicPlayer.svg?style=social)](https://twitter.com/intent/tweet?text=MelonMusicPlayer:&url=https%3A%2F%2Fgithub.com%2FMelleDijkstra%2FPythonMusicPlayer) diff --git a/docs/.gitignore b/docs/.gitignore index 9526051..3455fb4 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1,3 +1,2 @@ # ignore generated documentation -_build -_templates \ No newline at end of file +build \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile index c0bec43..bc5f0fb 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -5,8 +5,8 @@ SPHINXOPTS = SPHINXBUILD = sphinx-build SPHINXPROJ = MelonMusicPlayer -SOURCEDIR = . -BUILDDIR = _build +SOURCEDIR = source +BUILDDIR = build # Put it first so that "make" without argument is like "make help". help: diff --git a/docs/make.bat b/docs/make.bat index dc76cea..a1d4d48 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -7,8 +7,8 @@ REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) -set SOURCEDIR=. -set BUILDDIR=_build +set SOURCEDIR=source +set BUILDDIR=build set SPHINXPROJ=MelonMusicPlayer if "%1" == "" goto help diff --git a/docs/_static/modules.rst b/docs/source/_static/modules.rst similarity index 63% rename from docs/_static/modules.rst rename to docs/source/_static/modules.rst index 6b7ac61..d71736f 100644 --- a/docs/_static/modules.rst +++ b/docs/source/_static/modules.rst @@ -2,6 +2,6 @@ PythonMusicPlayer ================= .. toctree:: -:maxdepth: 4 + :maxdepth: 4 - mpserver + mpserver diff --git a/docs/_static/mpserver.rst b/docs/source/_static/mpserver.rst similarity index 53% rename from docs/_static/mpserver.rst rename to docs/source/_static/mpserver.rst index dda5a1c..943ecd7 100644 --- a/docs/_static/mpserver.rst +++ b/docs/source/_static/mpserver.rst @@ -4,75 +4,82 @@ mpserver package Submodules ---------- +mpserver\.grpc module +----------------------- +.. automodule:: mpserver.grpc + :members: + :undoc-members: + :show-inheritance: + mpserver\.config module ----------------------- .. automodule:: mpserver.config -:members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: mpserver\.datastructures module ------------------------------- .. automodule:: mpserver.datastructures -:members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: mpserver\.interfaces module --------------------------- .. automodule:: mpserver.interfaces -:members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: mpserver\.musicdownloader module -------------------------------- -.. automodule:: mpserver.musicdownloader -:members: - :undoc-members: - :show-inheritance: +.. automodule:: mpserver.mediadownloader + :members: + :undoc-members: + :show-inheritance: mpserver\.musicmodels module ---------------------------- -.. automodule:: mpserver.musicmodels -:members: - :undoc-members: - :show-inheritance: +.. automodule:: mpserver.models + :members: + :undoc-members: + :show-inheritance: mpserver\.musicplayer module ---------------------------- .. automodule:: mpserver.musicplayer -:members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: mpserver\.musicserver module ---------------------------- .. automodule:: mpserver.musicserver -:members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: mpserver\.tools module ---------------------- .. automodule:: mpserver.tools -:members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: Module contents --------------- .. automodule:: mpserver -:members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/conf.py b/docs/source/conf.py similarity index 73% rename from docs/conf.py rename to docs/source/conf.py index 16d54e3..791d949 100644 --- a/docs/conf.py +++ b/docs/source/conf.py @@ -1,17 +1,12 @@ -#!/usr/bin/env python3 # -*- coding: utf-8 -*- # -# MelonMusicPlayer documentation build configuration file, created by -# sphinx-quickstart on Wed Jan 10 22:10:27 2018. +# Configuration file for the Sphinx documentation builder. # -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. +# This file does only contain a selection of the most common options. For a +# full list see the documentation: +# http://www.sphinx-doc.org/en/stable/config + +# -- 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 @@ -20,9 +15,22 @@ import os import sys -sys.path.insert(0, os.path.abspath('../')) +sys.path.insert(0, os.path.abspath('../../')) + -# -- General configuration ------------------------------------------------ +# -- Project information ----------------------------------------------------- + +project = 'MelonMusicPlayer' +copyright = '2018, Melle Dijkstra' +author = 'Melle Dijkstra' + +# The short X.Y version +version = '3.0' +# The full version, including alpha/beta/rc tags +release = '3.0.0-alpha' + + +# -- General configuration --------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. # @@ -31,7 +39,10 @@ # 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'] +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.coverage', +] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -45,20 +56,6 @@ # The master toctree document. master_doc = 'index' -# General information about the project. -project = 'MelonMusicPlayer' -copyright = '2018, Melle Dijkstra' -author = 'Melle Dijkstra' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = '2.0' -# The full version, including alpha/beta/rc tags. -release = '2.0' - # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # @@ -68,16 +65,14 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -# This patterns also effect to html_static_path and html_extra_path -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +# This pattern also affects html_static_path and html_extra_path . +exclude_patterns = [] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = False -# -- Options for HTML output ---------------------------------------------- +# -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. @@ -98,21 +93,21 @@ # Custom sidebar templates, must be a dictionary that maps document names # to template names. # -# This is required for the alabaster theme -# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars -html_sidebars = { - '**': [ - 'relations.html', # needs 'show_related': True theme option to display - 'searchbox.html', - ] -} +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +# html_sidebars = {} -# -- Options for HTMLHelp output ------------------------------------------ + +# -- Options for HTMLHelp output --------------------------------------------- # Output file base name for HTML help builder. htmlhelp_basename = 'MelonMusicPlayerdoc' -# -- Options for LaTeX output --------------------------------------------- + +# -- Options for LaTeX output ------------------------------------------------ latex_elements = { # The paper size ('letterpaper' or 'a4paper'). @@ -140,7 +135,8 @@ 'Melle Dijkstra', 'manual'), ] -# -- Options for manual page output --------------------------------------- + +# -- Options for manual page output ------------------------------------------ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). @@ -149,7 +145,8 @@ [author], 1) ] -# -- Options for Texinfo output ------------------------------------------- + +# -- Options for Texinfo output ---------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, @@ -159,3 +156,6 @@ author, 'MelonMusicPlayer', 'One line description of project.', 'Miscellaneous'), ] + + +# -- Extension configuration ------------------------------------------------- diff --git a/docs/index.rst b/docs/source/index.rst similarity index 65% rename from docs/index.rst rename to docs/source/index.rst index c4792be..b815c0f 100644 --- a/docs/index.rst +++ b/docs/source/index.rst @@ -1,7 +1,7 @@ .. MelonMusicPlayer documentation master file, created by -sphinx-quickstart on Wed Jan 10 22:10:27 2018. -You can adapt this file completely to your liking, but it should at least -contain the root `toctree` directive. + sphinx-quickstart on Sat Feb 24 23:45:08 2018. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. Welcome to MelonMusicPlayer's documentation! ============================================ @@ -11,10 +11,10 @@ If you really want good documentation, please feel free to contact me! dev.melle@gmail.com** .. toctree:: -:maxdepth: 2 - :caption: Contents: + :maxdepth: 2 + :caption: Contents: - _static/modules + _static/modules Indices and tables ================== diff --git a/generate-docs.bat b/generate-docs.bat new file mode 100644 index 0000000..38a247c --- /dev/null +++ b/generate-docs.bat @@ -0,0 +1,5 @@ +@echo off +set currdir = %cd% +cd docs +make html +cd %currdir% diff --git a/mpserver/__init__.py b/mpserver/__init__.py index b4970b3..94e4624 100644 --- a/mpserver/__init__.py +++ b/mpserver/__init__.py @@ -1 +1,12 @@ -__all__ = ['musicplayer', 'musicserver', 'models.py', 'grpc'] +__all__ = [ + 'config', + 'datamanager', + 'datastructures', + 'interfaces', + 'mediadownloader', + 'models', + 'musicplayer', + 'musicserver', + 'tools', + 'grpc' +] diff --git a/mpserver/grpc/__init__.py b/mpserver/grpc/__init__.py index 9cc7e7e..b6fcd11 100644 --- a/mpserver/grpc/__init__.py +++ b/mpserver/grpc/__init__.py @@ -1 +1,4 @@ -__all__ = ['mmp_pb2', 'mmp_pb2_grpc'] +__all__ = [ + 'mmp_pb2', + 'mmp_pb2_grpc' +] diff --git a/mpserver/tools.py b/mpserver/tools.py index 8b8d64e..e026ca9 100644 --- a/mpserver/tools.py +++ b/mpserver/tools.py @@ -69,13 +69,13 @@ def print_progress_bar(iteration: int, total: int, prefix: str = '', suffix: str """ Call in a loop to create terminal progress bar @params: - iteration - Required : current iteration (Int) - total - Required : total iterations (Int) - prefix - Optional : prefix string (Str) - suffix - Optional : suffix string (Str) - decimals - Optional : positive number of decimals in percent complete (Int) - length - Optional : character length of bar (Int) - fill - Optional : bar fill character (Str) + iteration - Required : current iteration (Int) + total - Required : total iterations (Int) + prefix - Optional : prefix string (Str) + suffix - Optional : suffix string (Str) + decimals - Optional : positive number of decimals in percent complete (Int) + length - Optional : character length of bar (Int) + fill - Optional : bar fill character (Str) """ percent = ("{0:." + str(decimals) + "f}").format(100 * (iteration / float(total))) filled_length = int(length * iteration // total)