From 99b95c547d8b48ab7cd10bcdb866d0e03eacf7fe Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Mon, 8 Feb 2010 17:19:15 +0000 Subject: [PATCH] Make use of new module constfunc. svn: r14282 --- src/gui/dbman.py | 4 +++- src/gui/utils.py | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/dbman.py b/src/gui/dbman.py index 1a941006b..8633779f3 100644 --- a/src/gui/dbman.py +++ b/src/gui/dbman.py @@ -45,7 +45,8 @@ from gen.ggettext import gettext as _ import logging LOG = logging.getLogger(".DbManager") -if os.sys.platform == "win32": +import constfunc +if constfunc.win(): _RCS_FOUND = os.system("rcs -V >nul 2>nul") == 0 if _RCS_FOUND and "TZ" not in os.environ: # RCS requires the "TZ" variable be set. @@ -77,6 +78,7 @@ from glade import Glade from gen.db.backup import restore from gen.db.exceptions import DbException + _RETURN = gtk.gdk.keyval_from_name("Return") _KP_ENTER = gtk.gdk.keyval_from_name("KP_Enter") diff --git a/src/gui/utils.py b/src/gui/utils.py index ea043e759..c932e7cb9 100644 --- a/src/gui/utils.py +++ b/src/gui/utils.py @@ -48,6 +48,7 @@ from gen.ggettext import gettext as _ #------------------------------------------------------------------------- import gen.lib import Errors +import constfunc #------------------------------------------------------------------------- # @@ -255,13 +256,13 @@ def open_file_with_default_application( file_path ): ErrorDialog(_("Error Opening File"), _("File does not exist")) return - if os.sys.platform == 'win32': + if constfunc.win(): try: os.startfile(norm_path) except WindowsError, msg: ErrorDialog(_("Error Opening File"), str(msg)) else: - if os.sys.platform == 'darwin': + if constfunc.mac(): utility = 'open' else: utility = 'xdg-open'