Skip to content

Commit

Permalink
Update document build with correct import (#89)
Browse files Browse the repository at this point in the history
- Import app id, locale dir and description
  from cli_args file.
- pyproject.toml: use meson build
- Fix README
- Inject app id and locale dir to cli_args using
  meson.
- Update copyright year
  • Loading branch information
hsbasu authored Oct 23, 2024
1 parent 52893cf commit f914e90
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 29 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ Very simple Python3-based GUI application to set different theme colour and mode
- [Runtime Dependencies](#runtime-dependencies)
- [Debian/Ubuntu based systems](#debianubuntu-based-distro)
- [Other Linux-based systems](#other-linux-based-distro)
- [Installation](#installation)
- [1. Download and install binary files](#1-download-and-install-binary-files)
- [2. Build and Install from source](#2-build-and-install-from-source)
- [Debian/Ubuntu based systems](#debianubuntu-based-systems)
- [Other Linux-based systems](#other-linux-based-systems)
- [Installation](#installation)
- [1. Download and install binary files](#1-download-and-install-binary-files)
- [2. Build and Install from source](#2-build-and-install-from-source)
- [Debian/Ubuntu based systems](#debianubuntu-based-systems)
- [Other Linux-based systems](#other-linux-based-systems)
- [User Manual](#user-manual)
- [Issue Tracking and Contributing](#issue-tracking-and-contributing)
- [For Developers](#for-developers)
Expand Down Expand Up @@ -167,7 +167,7 @@ cd theme-manager-master
meson compile -C builddir --verbose
sudo meson install -C builddir
```
This step requires **Administrative Privilege**. So, be careful before using this. To **remove** the installed files, run:
The last step requires **Administrative Privilege**. So, be careful before using this. To **remove** the installed files, run:
```
sudo ninja uninstall -C builddir
```
Expand Down
12 changes: 11 additions & 1 deletion src/ThemeManager/DesktopTheme.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2021-2023 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
# Copyright (C) 2021-2024 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
#
# This file is part of theme-manager.
#
Expand All @@ -21,14 +21,24 @@
#

# import the necessary modules!
import gettext
import locale
import logging
import os
import subprocess

# imports from current package
from ThemeManager.cli_args import APP, LOCALE_DIR
from ThemeManager.common import TMBackend


# i18n
locale.bindtextdomain(APP, LOCALE_DIR)
gettext.bindtextdomain(APP, LOCALE_DIR)
gettext.textdomain(APP)
_ = gettext.gettext


# logger
module_logger = logging.getLogger('ThemeManager.DesktopTheme')

Expand Down
3 changes: 2 additions & 1 deletion src/ThemeManager/LoginTheme.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2021-2023 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
# Copyright (C) 2021-2024 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
#
# This file is part of theme-manager.
#
Expand Down Expand Up @@ -26,3 +26,4 @@
import locale

# imports from current package
from ThemeManager.cli_args import APP, LOCALE_DIR
7 changes: 4 additions & 3 deletions src/ThemeManager/about_window.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2021-2023 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
# Copyright (C) 2021-2024 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
#
# This file is part of theme-manager.
#
Expand Down Expand Up @@ -29,7 +29,8 @@
from gi.repository import Gtk

# imports from current package
from ThemeManager.common import APP, LOCALE_DIR, __version__
from ThemeManager.cli_args import APP, LOCALE_DIR, description
from ThemeManager.common import __version__


# i18n
Expand Down Expand Up @@ -64,7 +65,7 @@ def __init__(self, widget):

self.about_dlg.set_website_label(_("Official Website"))
self.about_dlg.set_website("https://hsbasu.github.io/theme-manager")
self.about_dlg.set_comments(_("A Python3-based GUI application to change different colour variants of GTK, Icon, Cursor and other themes."))
self.about_dlg.set_comments(description)
self.about_dlg.set_copyright(copyrights)

self.about_dlg.set_authors(authors)
Expand Down
5 changes: 2 additions & 3 deletions src/ThemeManager/cli_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@
import gettext
import locale

# imports from current package
from ThemeManager.common import APP, LOCALE_DIR


# i18n
APP = '@appname@'
LOCALE_DIR = "@localedir@"
locale.bindtextdomain(APP, LOCALE_DIR)
gettext.bindtextdomain(APP, LOCALE_DIR)
gettext.textdomain(APP)
Expand Down
8 changes: 5 additions & 3 deletions src/ThemeManager/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2021-2023 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
# Copyright (C) 2021-2024 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
#
# This file is part of theme-manager.
#
Expand Down Expand Up @@ -37,9 +37,11 @@
from random import choice
from threading import Thread

# imports from current package
from ThemeManager.cli_args import APP, LOCALE_DIR


# i18n
APP = 'theme-manager'
LOCALE_DIR = "/usr/share/locale"
locale.bindtextdomain(APP, LOCALE_DIR)
gettext.bindtextdomain(APP, LOCALE_DIR)
gettext.textdomain(APP)
Expand Down
5 changes: 3 additions & 2 deletions src/ThemeManager/gui.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2021-2023 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
# Copyright (C) 2021-2024 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
#
# This file is part of theme-manager.
#
Expand Down Expand Up @@ -37,7 +37,8 @@
# imports from current package
from ThemeManager.about_window import AboutWindow
from ThemeManager.logger import LoggerWindow
from ThemeManager.common import APP, CONFIG_FILE, LOCALE_DIR, UI_PATH, __version__, theme_styles, _async, TMBackend
from ThemeManager.cli_args import APP, LOCALE_DIR
from ThemeManager.common import CONFIG_FILE, UI_PATH, __version__, theme_styles, _async, TMBackend
from ThemeManager.indicator import TMIndicator
from ThemeManager.DesktopTheme import desktop_theme
from ThemeManager.time_chooser import TimeChooserButton
Expand Down
5 changes: 3 additions & 2 deletions src/ThemeManager/indicator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2021-2023 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
# Copyright (C) 2021-2024 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
#
# This file is part of theme-manager.
#
Expand Down Expand Up @@ -35,7 +35,8 @@
# imports from current package
from ThemeManager.about_window import AboutWindow
from ThemeManager.logger import LoggerWindow
from ThemeManager.common import APP, LOCALE_DIR, theme_styles
from ThemeManager.cli_args import APP, LOCALE_DIR
from ThemeManager.common import theme_styles
from ThemeManager.tm_daemon import TMState_monitor
from ThemeManager.DesktopTheme import desktop_theme

Expand Down
5 changes: 3 additions & 2 deletions src/ThemeManager/logger.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2021-2023 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
# Copyright (C) 2021-2024 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
#
# This file is part of theme-manager.
#
Expand Down Expand Up @@ -29,7 +29,8 @@
from gi.repository import Gtk

# imports from current package
from ThemeManager.common import APP, LOCALE_DIR, LOGFILE, UI_PATH
from ThemeManager.cli_args import APP, LOCALE_DIR
from ThemeManager.common import LOGFILE, UI_PATH


# i18n
Expand Down
2 changes: 1 addition & 1 deletion src/ThemeManager/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2021-2023 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
# Copyright (C) 2021-2024 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
#
# This file is part of theme-manager.
#
Expand Down
11 changes: 10 additions & 1 deletion src/ThemeManager/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,17 @@ version_file = configure_file(
}
)

args_file = configure_file(
input: 'cli_args.py',
output: 'cli_args.py',
configuration: {
'appname': application_id,
'localedir': join_paths(prefix, get_option('localedir')),
}
)

python.install_sources(
python_sources, version_file,
python_sources, version_file, args_file,
subdir: 'ThemeManager',
preserve_path: true,
)
Expand Down
4 changes: 2 additions & 2 deletions src/ThemeManager/time_chooser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2023 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
# Copyright (C) 2023-2024 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
#
# This file is part of theme-manager and parts of this file is
# copied from cinnamon's ChooserButtonWidgets.py
Expand Down Expand Up @@ -33,7 +33,7 @@
from gi.repository import Gtk, GLib

# imports from current package
from ThemeManager.common import APP, LOCALE_DIR
from ThemeManager.cli_args import APP, LOCALE_DIR

# i18n
locale.bindtextdomain(APP, LOCALE_DIR)
Expand Down
5 changes: 3 additions & 2 deletions src/ThemeManager/tm_daemon.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2021-2023 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
# Copyright (C) 2021-2024 Himadri Sekhar Basu <hsb10@iitbbs.ac.in>
#
# This file is part of theme-manager.
#
Expand Down Expand Up @@ -28,7 +28,8 @@
from time import sleep

# imports from current package
from ThemeManager.common import APP, LOCALE_DIR, theme_styles, _async, TMBackend
from ThemeManager.cli_args import APP, LOCALE_DIR
from ThemeManager.common import theme_styles, _async, TMBackend
from ThemeManager.DesktopTheme import desktop_theme


Expand Down

0 comments on commit f914e90

Please sign in to comment.