diff --git a/Mailnag/common/config.py b/Mailnag/common/config.py index 8e39521..20a6b6e 100644 --- a/Mailnag/common/config.py +++ b/Mailnag/common/config.py @@ -3,7 +3,7 @@ # # config.py # -# Copyright 2011 Patrick Ulbrich +# Copyright 2011, 2012 Patrick Ulbrich # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,8 +26,6 @@ import xdg.BaseDirectory as bd from ConfigParser import RawConfigParser from common.i18n import _ -APP_VERSION = "0.4.2" - mailnag_defaults = { 'general': { diff --git a/Mailnag/common/dist_cfg.py b/Mailnag/common/dist_cfg.py new file mode 100644 index 0000000..09e0141 --- /dev/null +++ b/Mailnag/common/dist_cfg.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# dist_cfg.py +# +# Copyright 2012 Patrick Ulbrich +# +# This program 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 2 of the License, or +# (at your option) any later version. +# +# This program 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 this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. +# + +# This file contains variables that need to be adjusted for propper distro integration. +# Additionally to those variables, packagers have to adjust the following paths: +# * LOCALE_DIR in file gen_locales +# * LIB_DIR in bash scripts mailnag and mailnag_cfg +# * Exec and Icon paths in data/mailnag_config.desktop + +# Application version displayed in the +# about dialog of the config window. +APP_VERSION = "0.4.2" + +# The PACKAGE_NAME variable is used to configure +# 1) the path where all app data (glade files, images) is loaded from +# (usually /usr/share/) via get_data_file() (see utils.py). +# 2) paths for localization files generated with gen_locales +# (usually /usr/share/locale//LC_MESSAGES/.mo). +# Typically, there's no need to touch this variable. +PACKAGE_NAME = "mailnag" + +# The LOCALE_DIR variable specifies the root path for localization files +# (usually you have to make it point to '/usr/share/locale'). +LOCALE_DIR = './locale' diff --git a/Mailnag/common/i18n.py b/Mailnag/common/i18n.py index d9da250..5e86bd2 100644 --- a/Mailnag/common/i18n.py +++ b/Mailnag/common/i18n.py @@ -3,7 +3,7 @@ # # i18n.py # -# Copyright 2011 Patrick Ulbrich +# Copyright 2011, 2012 Patrick Ulbrich # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,11 +21,9 @@ # MA 02110-1301, USA. # -LOCALE_DIR = './locale' - import locale import gettext -from common.utils import PACKAGE_NAME +from common.dist_cfg import PACKAGE_NAME, LOCALE_DIR # bind textdomain for GTK Builder locale.bindtextdomain(PACKAGE_NAME, LOCALE_DIR) diff --git a/Mailnag/common/keyring.py b/Mailnag/common/keyring.py index a5ea04b..ca30c7c 100644 --- a/Mailnag/common/keyring.py +++ b/Mailnag/common/keyring.py @@ -25,7 +25,8 @@ from gi.repository import GObject, GLib, GdkPixbuf, Gtk import gnomekeyring -from common.i18n import PACKAGE_NAME, _ +from common.dist_cfg import PACKAGE_NAME +from common.i18n import _ from common.utils import get_data_file from common.account import Account diff --git a/Mailnag/common/utils.py b/Mailnag/common/utils.py index f827089..09b9719 100644 --- a/Mailnag/common/utils.py +++ b/Mailnag/common/utils.py @@ -29,7 +29,7 @@ import os import time import urllib2 -PACKAGE_NAME = "mailnag" +from common.dist_cfg import PACKAGE_NAME def get_data_file(filename): """ diff --git a/Mailnag/configuration/accountdialog.py b/Mailnag/configuration/accountdialog.py index dac1c01..dccccb6 100644 --- a/Mailnag/configuration/accountdialog.py +++ b/Mailnag/configuration/accountdialog.py @@ -22,9 +22,10 @@ # from gi.repository import GLib, GdkPixbuf, Gtk +from common.dist_cfg import PACKAGE_NAME +from common.i18n import _ from common.utils import get_data_file from common.account import Account -from common.i18n import PACKAGE_NAME, _ class AccountDialog: def __init__(self, parent, acc): diff --git a/Mailnag/configuration/configwindow.py b/Mailnag/configuration/configwindow.py index be22aa0..7ccb52b 100644 --- a/Mailnag/configuration/configwindow.py +++ b/Mailnag/configuration/configwindow.py @@ -25,9 +25,10 @@ import os from gi.repository import GLib, GdkPixbuf, Gtk, GObject -from common.i18n import PACKAGE_NAME, _ +from common.dist_cfg import PACKAGE_NAME, APP_VERSION +from common.i18n import _ from common.utils import get_data_file -from common.config import read_cfg, write_cfg, APP_VERSION +from common.config import read_cfg, write_cfg from common.accountlist import AccountList from common.account import Account from configuration.accountdialog import AccountDialog