From 27a639f42779963a4a42be8efe07c7011349e159 Mon Sep 17 00:00:00 2001 From: Marcos Coelho Date: Mon, 6 Jun 2011 14:22:12 -0700 Subject: [PATCH] does search for all system extensions - needed to work fine with Windows environ --- static_gettext.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) mode change 100755 => 100644 static_gettext.py diff --git a/static_gettext.py b/static_gettext.py old mode 100755 new mode 100644 index 69d1e7e..8d6579e --- a/static_gettext.py +++ b/static_gettext.py @@ -56,11 +56,14 @@ def __init__( self, domain, inputbase, localebase, outputbase, languages, extens @staticmethod def gettextIsAvailable(): requirements = { 'xgettext': False, 'msguniq': False , 'msgmerge': False } + extensions = os.environ.get("PATHEXT", "").split(os.pathsep) for path in os.environ["PATH"].split( os.pathsep ): for name in requirements: - file = os.path.join( path, name ) - if not(requirements[name]) and os.path.exists(file) and os.access(file, os.X_OK): - requirements[name] = True; + base = os.path.join( path, name ) + options = [base] + [(base + ext) for ext in extensions] + for file in options: + if not(requirements[name]) and os.path.exists(file) and os.access(file, os.X_OK): + requirements[name] = True; for name in requirements: if not requirements[name]: