Skip to content

Commit 19be8f9

Browse files
committed
First complete version
ref #1 Signed-off-by: David Ducatel <dducatel@trace-software.com>
1 parent 5240225 commit 19be8f9

17 files changed

+733
-2
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
indent_style = space
7+
indent_size = 4
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
11+
[*.yml]
12+
indent_size = 2
13+
indent_style = space

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.idea
2+
13
# Byte-compiled / optimized / DLL files
24
__pycache__/
35
*.py[cod]
@@ -63,6 +65,7 @@ instance/
6365

6466
# Sphinx documentation
6567
docs/_build/
68+
docs/output/
6669

6770
# PyBuilder
6871
target/

.travis.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
sudo: required
2+
language: python
3+
python:
4+
- "3.5"
5+
- "3.5-dev"
6+
- "3.6"
7+
- "3.6-dev"
8+
- "3.7-dev"
9+
- "pypy3.5"
10+
11+
services:
12+
- docker
13+
14+
before_install:
15+
- sudo apt-get -qq update
16+
- sudo apt-get install -y zip curl
17+
- wget https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz
18+
- sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.6.1.tar.gz
19+
- sudo chmod +x /usr/local/bin/dockerize
20+
- docker pull tracesoftware/hostmydocs
21+
- docker run -d -e CREDENTIALS=login:password -e SHOULD_SECURE=FALSE -p 127.0.0.1:8080:80 tracesoftware/hostmydocs
22+
- dockerize -wait http://127.0.0.1:8080
23+
24+
install:
25+
- pip install -r requirements.txt
26+
27+
script:
28+
- python -m unittest discover -s tests
29+
- if [ -n "${TRAVIS_TAG}" ] && [ "${TRAVIS_PYTHON_VERSION}" == "3.6" ]; then
30+
pip install Sphinx ;
31+
sphinx-build -b html docs docs/output ;
32+
cd docs ;
33+
zip -r docs.zip output/ ;
34+
curl -w "Status %{http_code}\n" --user ${HMD_USER_PASSWORD} -F "name=HostMyDocs-python-client" -F "version=${TRAVIS_TAG}" -F language=Python -F archive=@docs.zip $HMD_POST_URL ;
35+
cd .. ;
36+
fi
37+
38+
deploy:
39+
provider: pypi
40+
user: "TraceSoftwareInternational"
41+
password: $PYPI_PWD
42+
on:
43+
tags: true
44+
python: '3.6'

README.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

README.rst

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
HostMyDocs-python-client
2+
=========================
3+
4+
|travis| |PythonVersion| |PyPILastVersion| |License| |Docs|
5+
6+
This library provide a python client for `HostMyDocs`_ documentation hosting system
7+
8+
Example
9+
-------
10+
11+
.. code:: python
12+
13+
import hostmydocs
14+
15+
# 1. Create client object connect to your HostMyDocs instance
16+
hmd_client = hostmydocs.Client(hostmydocs.ServerConfig(
17+
address="my-hostmydocs-instance.com",
18+
api_login="my_login",
19+
api_password="my_password"
20+
))
21+
22+
# 2. Upload your documentation
23+
my_documentation = hostmydocs.Documentation(
24+
name="myDocName",
25+
version="1.2.3.4",
26+
language="myLanguage",
27+
zip_archive_path="path/to/my/doc/archive.zip"
28+
)
29+
30+
hmd_client.upload_documentation(my_documentation)
31+
32+
# 3. List all documentations on your server
33+
for doc in hmd_client.get_all_documentations():
34+
print(doc.name)
35+
36+
37+
.. _HostMyDocs: https://github.com/TraceSoftwareInternational/HostMyDocs
38+
39+
.. |License| image:: https://img.shields.io/badge/License-GPL%20v3-blue.svg
40+
:target: http://www.gnu.org/licenses/gpl-3.0
41+
42+
.. |travis| image:: https://travis-ci.org/TraceSoftwareInternational/HostMyDocs-python-client.svg?branch=master
43+
:target: https://travis-ci.org/TraceSoftwareInternational/HostMyDocs-python-client
44+
45+
.. |PyPILastVersion| image:: https://img.shields.io/pypi/v/hostmydocs-client.svg
46+
:target: https://pypi.org/project/hostmydocs-client
47+
48+
.. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/hostmydocs-client.svg
49+
:alt: PyPI - Python Version
50+
:target: https://pypi.org/project/hostmydocs-client
51+
52+
.. |Docs| image:: https://img.shields.io/badge/Docs-HostMyDocs-green.svg
53+
:target: https://docs.trace-software.com

docs/conf.py

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Configuration file for the Sphinx documentation builder.
4+
#
5+
# This file does only contain a selection of the most common options. For a
6+
# full list see the documentation:
7+
# http://www.sphinx-doc.org/en/master/config
8+
9+
# -- Path setup --------------------------------------------------------------
10+
11+
# If extensions (or modules to document with autodoc) are in another directory,
12+
# add these directories to sys.path here. If the directory is relative to the
13+
# documentation root, use os.path.abspath to make it absolute, like shown here.
14+
#
15+
import os
16+
import sys
17+
sys.path.insert(0, os.path.abspath('..'))
18+
19+
20+
# -- Project information -----------------------------------------------------
21+
22+
project = 'hostmydocs-python-client'
23+
copyright = '2018, Trace Software International'
24+
author = 'Trace Software International'
25+
26+
# The short X.Y version
27+
version = os.environ.get("TRAVIS_TAG", "0.0.0")
28+
29+
# The full version, including alpha/beta/rc tags
30+
release = ''
31+
32+
33+
# -- General configuration ---------------------------------------------------
34+
35+
# If your documentation needs a minimal Sphinx version, state it here.
36+
#
37+
# needs_sphinx = '1.0'
38+
39+
# Add any Sphinx extension module names here, as strings. They can be
40+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
41+
# ones.
42+
extensions = [
43+
'sphinx.ext.autodoc',
44+
'sphinx.ext.doctest',
45+
'sphinx.ext.viewcode',
46+
]
47+
48+
# Add any paths that contain templates here, relative to this directory.
49+
templates_path = ['_templates']
50+
51+
# The suffix(es) of source filenames.
52+
# You can specify multiple suffix as a list of string:
53+
#
54+
# source_suffix = ['.rst', '.md']
55+
source_suffix = '.rst'
56+
57+
# The master toctree document.
58+
master_doc = 'index'
59+
60+
# The language for content autogenerated by Sphinx. Refer to documentation
61+
# for a list of supported languages.
62+
#
63+
# This is also used if you do content translation via gettext catalogs.
64+
# Usually you set "language" from the command line for these cases.
65+
language = None
66+
67+
# List of patterns, relative to source directory, that match files and
68+
# directories to ignore when looking for source files.
69+
# This pattern also affects html_static_path and html_extra_path .
70+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
71+
72+
# The name of the Pygments (syntax highlighting) style to use.
73+
pygments_style = 'sphinx'
74+
75+
76+
# -- Options for HTML output -------------------------------------------------
77+
78+
# The theme to use for HTML and HTML Help pages. See the documentation for
79+
# a list of builtin themes.
80+
#
81+
html_theme = 'alabaster'
82+
83+
# Theme options are theme-specific and customize the look and feel of a theme
84+
# further. For a list of options available for each theme, see the
85+
# documentation.
86+
#
87+
# html_theme_options = {}
88+
89+
# Add any paths that contain custom static files (such as style sheets) here,
90+
# relative to this directory. They are copied after the builtin static files,
91+
# so a file named "default.css" will overwrite the builtin "default.css".
92+
html_static_path = ['_static']
93+
94+
# Custom sidebar templates, must be a dictionary that maps document names
95+
# to template names.
96+
#
97+
# The default sidebars (for documents that don't match any pattern) are
98+
# defined by theme itself. Builtin themes are using these templates by
99+
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
100+
# 'searchbox.html']``.
101+
#
102+
# html_sidebars = {}
103+
104+
105+
# -- Options for HTMLHelp output ---------------------------------------------
106+
107+
# Output file base name for HTML help builder.
108+
htmlhelp_basename = 'hostmydocs-python-clientdoc'
109+
110+
111+
# -- Options for LaTeX output ------------------------------------------------
112+
113+
latex_elements = {
114+
# The paper size ('letterpaper' or 'a4paper').
115+
#
116+
# 'papersize': 'letterpaper',
117+
118+
# The font size ('10pt', '11pt' or '12pt').
119+
#
120+
# 'pointsize': '10pt',
121+
122+
# Additional stuff for the LaTeX preamble.
123+
#
124+
# 'preamble': '',
125+
126+
# Latex figure (float) alignment
127+
#
128+
# 'figure_align': 'htbp',
129+
}
130+
131+
# Grouping the document tree into LaTeX files. List of tuples
132+
# (source start file, target name, title,
133+
# author, documentclass [howto, manual, or own class]).
134+
latex_documents = [
135+
(master_doc, 'hostmydocs-python-client.tex', 'hostmydocs-python-client Documentation',
136+
'Trace Software International', 'manual'),
137+
]
138+
139+
140+
# -- Options for manual page output ------------------------------------------
141+
142+
# One entry per manual page. List of tuples
143+
# (source start file, name, description, authors, manual section).
144+
man_pages = [
145+
(master_doc, 'hostmydocs-python-client', 'hostmydocs-python-client Documentation',
146+
[author], 1)
147+
]
148+
149+
150+
# -- Options for Texinfo output ----------------------------------------------
151+
152+
# Grouping the document tree into Texinfo files. List of tuples
153+
# (source start file, target name, title, author,
154+
# dir menu entry, description, category)
155+
texinfo_documents = [
156+
(master_doc, 'hostmydocs-python-client', 'hostmydocs-python-client Documentation',
157+
author, 'hostmydocs-python-client', 'One line description of project.',
158+
'Miscellaneous'),
159+
]
160+
161+
162+
# -- Extension configuration -------------------------------------------------

docs/index.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
.. toctree::
3+
:maxdepth: 2
4+
:caption: Contents:
5+
6+
.. include:: ../README.rst
7+
8+
Class documentations
9+
---------------------
10+
11+
.. autoclass:: hostmydocs.Client
12+
:special-members:
13+
:members:
14+
15+
.. autoclass:: hostmydocs.ServerConfig
16+
:special-members:
17+
:members:
18+
19+
.. autoclass:: hostmydocs.Documentation
20+
:special-members:
21+
:members:

hostmydocs/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from hostmydocs.serverConfig import ServerConfig
2+
from hostmydocs.documentation import Documentation
3+
from hostmydocs.client import Client

0 commit comments

Comments
 (0)