Dear Stephen
Being a very happy user of Meld since long ago and the lack of useful
tutorials for PyGtk and Glade lead me to have a look at your code in
order to teach myself GUI programming with Python.
I just had a look at some of your code written for Meld 1.1.4, and I
already have a few questions regarding paths.py.
First of all, I wonder why you have the application name hardcoded in
both _help_dir and _share_dir? Is there a specific reason to do so?
And then I was not sure what "if not _locale_dir:" and the other two are
doing, since this always returns true? Did I misunderstand some basics
about Python?
Below I copied the code after my modifications. Please have a look at it
and let me know if my modifications make any sense at all.
Thank you in advance for your help.
Kind regards
Andreas
paths.py
<snip>
# Determine application name
appdir = os.path.dirname(__file__)
appname = os.path.split(appdir)[1]
# Find typical shared folders as default locations
_locale_dir = ("/usr/share/locale")
_help_dir = os.path.join("/usr/share/gnome/help/", appname)
_share_dir = os.path.join("/usr/lib/", appname)
# Fallback
if not os.path.isdir(_locale_dir):
_locale_dir = os.path.join(appdir, "po")
if not os.path.isdir(_help_dir):
_help_dir = os.path.join(appdir, "help")
if not os.path.isdir(_share_dir):
_share_dir = appdir
</snip>