From 96b9ce3e332c040af007e6d509e8878630f57d5f Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 8 Jun 2017 00:01:21 +0200 Subject: [PATCH 1/2] Catch up with hamster-lib 0.13 config helper changes ``hamster-lib 0.13.0`` changes the interface of the configuration helpers in a backwards incompatible way. The now unnecessary helper was also removed. Closes: #182 --- hamster_gtk/hamster_gtk.py | 15 ++++++++------- setup.py | 3 ++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/hamster_gtk/hamster_gtk.py b/hamster_gtk/hamster_gtk.py index 0aa9d6f3..76d784da 100755 --- a/hamster_gtk/hamster_gtk.py +++ b/hamster_gtk/hamster_gtk.py @@ -40,9 +40,6 @@ from hamster_gtk.helpers import get_parent_window, get_resource_path from six import text_type -# [FIXME] -# Remove once hamster-lib has been patched -from hamster_gtk.helpers import get_config_instance from hamster_gtk.misc import HamsterAboutDialog as AboutDialog from hamster_gtk.overview import OverviewDialog from hamster_gtk.preferences import PreferencesDialog @@ -174,6 +171,9 @@ def __init__(self): """Setup instance and make sure default signals are connected to methods.""" super(HamsterGTK, self).__init__() self.window = None + + self._appdirs = config_helpers.HamsterAppDirs('hamster-gtk') + # Which config backend to use. self.config_store = 'file' # Yes this is redundent, but more transparent. And we can worry about @@ -195,7 +195,7 @@ def save_config(self, config): dict: Dictionary of config keys and values. """ cp_instance = self._config_to_configparser(config) - config_helpers.write_config_file(cp_instance, 'hamster-gtk', 'hamster-gtk.conf') + config_helpers.write_config_file(cp_instance, self._appdirs, 'hamster-gtk.conf') self.controler.signal_handler.emit('config-changed') def _startup(self, app): @@ -249,7 +249,7 @@ def _get_default_config(self): Note: Those defaults are independend of the particular config store. """ - appdirs = config_helpers.HamsterAppDirs('hamster-gtk') + appdirs = self._appdirs return { # Backend 'store': 'sqlalchemy', @@ -362,7 +362,7 @@ def _write_config_to_file(self, configparser_instance): Args: cp_instance (SafeConfigParser): Instance to be written to file. """ - config_helpers.write_config_file(configparser_instance, 'hamster-gtk', 'hamster-gtk.conf') + config_helpers.write_config_file(configparser_instance, self._appdirs, 'hamster-gtk.conf') def _get_config_from_file(self): """ @@ -380,7 +380,8 @@ def get_fallback(): config = self._get_default_config() return self._config_to_configparser(config) - cp_instance = get_config_instance(get_fallback(), 'hamster-gtk', 'hamster-gtk.conf') + cp_instance = config_helpers.load_config_file(self._appdirs, 'hamster-gtk.conf', + get_fallback()) return self._configparser_to_config(cp_instance) diff --git a/setup.py b/setup.py index fef03f5b..26f88361 100755 --- a/setup.py +++ b/setup.py @@ -16,7 +16,8 @@ history = history_file.read().replace('.. :changelog:', '') requirements = [ - 'hamster-lib', + 'orderedset', + 'hamster-lib >=0.13.0,<0.14.0', ] setup( From 5eb0db262f54d865d5e8f4a518db8757f9fc2c92 Mon Sep 17 00:00:00 2001 From: Roman Kovtyukh Date: Sun, 13 Jan 2019 02:33:14 +0300 Subject: [PATCH 2/2] =?UTF-8?q?Bump=20version:=200.11.0=20=E2=86=92=200.11?= =?UTF-8?q?.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hamster_gtk/__init__.py | 2 +- setup.cfg | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hamster_gtk/__init__.py b/hamster_gtk/__init__.py index eae4731b..f17e628e 100755 --- a/hamster_gtk/__init__.py +++ b/hamster_gtk/__init__.py @@ -4,4 +4,4 @@ __author__ = 'Eric Goller' __email__ = 'eric.goller@ninjaduck.solutions' -__version__ = '0.11.0' +__version__ = '0.11.1' diff --git a/setup.cfg b/setup.cfg index 7bb17382..c3a2b0d2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.11.0 +current_version = 0.11.1 commit = True tag = False diff --git a/setup.py b/setup.py index 26f88361..e30fc7c5 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ setup( name='hamster-gtk', - version='0.11.0', + version='0.11.1', description="A GTK interface to the hamster time tracker.", long_description=readme + '\n\n' + history, author="Eric Goller",