Make use of new module constfunc.

svn: r14282
This commit is contained in:
Peter Landgren 2010-02-08 17:19:15 +00:00
parent ee18fd7c69
commit 99b95c547d
2 changed files with 6 additions and 3 deletions

View File

@ -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")

View File

@ -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'