diff --git a/MANIFEST.in b/MANIFEST.in index 9a1e307..4594c01 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,5 +2,5 @@ include debian/changelog global-exclude *.py[cod] graft data* graft po* -include src/battery-monitor.in +include src/theme-manager.in graft src/ThemeManager/ui* diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..ed88099 --- /dev/null +++ b/docs/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/docs/ThemeManager.rst b/docs/ThemeManager.rst new file mode 100644 index 0000000..6959be9 --- /dev/null +++ b/docs/ThemeManager.rst @@ -0,0 +1,7 @@ +Description +=========== + +.. argparse:: + :module: ThemeManager.cli_args + :func: command_line_args + :prog: theme-manager diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..e7ffd41 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,47 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, 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('../src')) + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = 'theme-manager' +copyright = 'Copyright (C) 2024 Himadri Sekhar Basu' +author = 'Himadri Sekhar Basu ' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + 'sphinxarg.ext' +] + +templates_path = ['_templates'] +exclude_patterns = [] + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'alabaster' +html_static_path = ['_static'] + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', project, 'Theme Manager', [author], 1) +] diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..c7cb3e4 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,16 @@ +.. Battery Monitor documentation master file, created by + sphinx-quickstart on Sun Mar 3 09:21:34 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Theme Manager documentation! +=========================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + modules + +Indices and tables +================== diff --git a/docs/modules.rst b/docs/modules.rst new file mode 100644 index 0000000..151e92a --- /dev/null +++ b/docs/modules.rst @@ -0,0 +1,7 @@ +Synopsis +======== + +.. toctree:: + :maxdepth: 1 + + ThemeManager diff --git a/src/ThemeManager/cli_args.py b/src/ThemeManager/cli_args.py new file mode 100644 index 0000000..4bd59fa --- /dev/null +++ b/src/ThemeManager/cli_args.py @@ -0,0 +1,49 @@ +# Copyright (C) 2021-2024 Himadri Sekhar Basu +# +# This file is part of theme-manager. +# +# theme-manager is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# theme-manager is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with theme-manager. If not, see +# or write to the Free Software Foundation, Inc., 51 Franklin Street, +# Fifth Floor, Boston, MA 02110-1301, USA.. +# +# Author: Himadri Sekhar Basu +# + +# import the necessary modules! +import argparse +import gettext +import locale + +# imports from current package +from ThemeManager.common import APP, LOCALE_DIR + + +# i18n +locale.bindtextdomain(APP, LOCALE_DIR) +gettext.bindtextdomain(APP, LOCALE_DIR) +gettext.textdomain(APP) +_ = gettext.gettext + +description = _('A Python3-based GUI application to change different colour variants of GTK, Icon, Cursor and other themes.') + +def command_line_args(): + # Parse arguments + parser = argparse.ArgumentParser(prog=APP, description=description, conflict_handler='resolve') + + # parser.add_argument('', action='store_true', dest='start_window', default=True, help=("Start Theme Manager window")) + parser.add_argument('-i', '--indicator', action='store_true', dest='start_indicator', default=False, help=("Start Theme Manager Indicator")) + parser.add_argument('-v', '--verbose', action='store_true', dest='show_debug', default=False, help=("Print debug messages to stdout i.e. terminal")) + parser.add_argument('-V', '--version', action='store_true', dest='show_version', default=False, help=("Show version and exit")) + + return parser diff --git a/src/ThemeManager/main.py b/src/ThemeManager/main.py index ae4ff4b..3592824 100644 --- a/src/ThemeManager/main.py +++ b/src/ThemeManager/main.py @@ -29,6 +29,7 @@ # imports from current package from ThemeManager.common import APP, LOCALE_DIR, LOGFILE, __version__ +from ThemeManager.cli_args import command_line_args from ThemeManager.indicator import TMIndicator from ThemeManager.gui import run_TMwindow @@ -39,17 +40,10 @@ gettext.textdomain(APP) _ = gettext.gettext -description = 'A Python3-based GUI application to change different colour variants of GTK, Icon, Cursor and other themes.' - # Parse arguments -parser = argparse.ArgumentParser(prog=APP, description=description, conflict_handler='resolve') - -# parser.add_argument('', action='store_true', dest='start_window', default=True, help=("Start Theme Manager window")) -parser.add_argument('-i', '--indicator', action='store_true', dest='start_indicator', default=False, help=("Start Theme Manager Indicator")) -parser.add_argument('-v', '--verbose', action='store_true', dest='show_debug', default=False, help=("Print debug messages to stdout i.e. terminal")) -parser.add_argument('-V', '--version', action='store_true', dest='show_version', default=False, help=("Show version and exit")) - +parser = command_line_args() args = parser.parse_args() + args.start_window = True if args.show_version: