From 6d236e9671a1824e796f04200fb88073e9fed5d0 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 8 Jul 2012 21:27:43 +0200 Subject: [PATCH] Fixed two issues in FreeBSD. Firstly, the translation files were never being picked up, and secondly, OpenLP is installed into /usr/local, so we need to make provision for that. --- openlp/core/utils/__init__.py | 5 +++++ resources/__init__.py | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 resources/__init__.py diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 7f2ef08e2..224ab4344 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -172,6 +172,11 @@ def _get_os_dir_path(dir_type): u'Library', u'Application Support', u'openlp') else: if dir_type == AppLocation.LanguageDir: + prefixes = [u'/usr/local', u'/usr'] + for prefix in prefixes: + directory = os.path.join(prefix, u'share', u'openlp') + if os.path.exists(directory): + return directory return os.path.join(u'/usr', u'share', u'openlp') if XDG_BASE_AVAILABLE: if dir_type == AppLocation.ConfigDir: diff --git a/resources/__init__.py b/resources/__init__.py new file mode 100644 index 000000000..377413191 --- /dev/null +++ b/resources/__init__.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2012 Raoul Snyman # +# Portions copyright (c) 2008-2012 Tim Bentley, Gerald Britton, Jonathan # +# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, # +# Meinert Jordan, Armin Köhler, Edwin Lunando, Joshua Miller, Stevan Pettit, # +# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, # +# Simon Scudder, Jeffrey Smith, Maikel Stuivenberg, Martin Thompson, Jon # +# Tibble, Dave Warnock, Frode Woldsund # +# --------------------------------------------------------------------------- # +# 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; version 2 of the License. # +# # +# 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., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### +""" +The :mod:`resources` module contains a bunch of resources for OpenLP. + +DO NOT REMOVE THIS FILE, IT IS REQUIRED FOR INCLUDING THE RESOURCES ON SOME +PLATFORMS! +""" +