@@ -11,7 +11,6 @@ POSITIONAL_ARGS=()
1111FORCE=false
1212UNSTABLE=false
1313PYTHON=" /usr/bin/python3"
14- PYDOC=" /usr/bin/pydoc3"
1514
1615
1716user_check () {
@@ -95,6 +94,10 @@ function apt_pkg_install {
9594 fi
9695}
9796
97+ function pip_pkg_install {
98+ PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring $PYTHON -m pip install --upgrade " $@ "
99+ }
100+
98101while [[ $# -gt 0 ]]; do
99102 K=" $1 "
100103 case $K in
@@ -135,7 +138,7 @@ printf "$LIBRARY_NAME Python Library: Installer\n\n"
135138
136139inform " Checking Dependencies. Please wait..."
137140
138- PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring $PYTHON -m pip install --upgrade toml
141+ pip_pkg_install toml
139142
140143CONFIG_VARS=` $PYTHON - << EOF
141144import toml
187190inform " Installing for $PYTHON_VER ...\n"
188191apt_pkg_install " ${APT_PACKAGES[@]} "
189192if $UNSTABLE ; then
190- PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring $PYTHON -m pip install .
193+ pip_pkg_install .
191194else
192- PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring $PYTHON -m pip install --upgrade $LIBRARY_NAME
195+ pip_pkg_install $LIBRARY_NAME
193196fi
194197if [ $? -eq 0 ]; then
195198 success " Done!\n"
230233
231234printf " \n"
232235
233- if [ -f " $PYDOC " ]; then
236+ if confirm " Would you like to generate documentation?" ; then
237+ pip_pkg_install pdoc
234238 printf " Generating documentation.\n"
235- $PYDOC -w $LIBRARY_NAME > /dev/null
236- if [ -f " $LIBRARY_NAME .html" ]; then
237- cp $LIBRARY_NAME .html $RESOURCES_DIR /docs.html
238- rm -f $LIBRARY_NAME .html
239- inform " Documentation saved to $RESOURCES_DIR /docs.html"
239+ $PYTHON -m pdoc $LIBRARY_NAME -o $RESOURCES_DIR /docs > /dev/null
240+ if [ $? -eq 0 ]; then
241+ inform " Documentation saved to $RESOURCES_DIR /docs"
240242 success " Done!"
241243 else
242244 warning " Error: Failed to generate documentation."
0 commit comments