7188319 js2ai Traceback error : NameError: global name '_' is not defined
authornirmal27<Nirmal.Agarwal@oracle.com>
Fri, 03 Aug 2012 11:33:16 -0700
changeset 1761 c4dbae7a9d80
parent 1760 820b90ac476b
child 1762 c521dff595bc
7188319 js2ai Traceback error : NameError: global name '_' is not defined
usr/src/cmd/js2ai/modules/conv.py
--- a/usr/src/cmd/js2ai/modules/conv.py	Wed Aug 01 13:34:01 2012 -0700
+++ b/usr/src/cmd/js2ai/modules/conv.py	Fri Aug 03 11:33:16 2012 -0700
@@ -28,14 +28,13 @@
 
 import gettext
 import itertools
-import os.path
+import os
 import re
 import sys
 
 import pkg.client.api as api
 import pkg.client.api_errors as apx
 import pkg.client.progress as progress
-import os
 
 from solaris_install.js2ai import common
 from solaris_install.js2ai.common import _
@@ -959,12 +958,12 @@
 
         """
         orig_pwd = os.getcwd()
+        gettext.install("pkg", "/usr/share/locale")
         prog_tracker = progress.CommandLineProgressTracker()
         api_inst = api.ImageInterface("/", PKG5_API_VERSION,
                                       prog_tracker, False, "js2ai")
         pkg_query = ":legacy:legacy_pkg:" + package
         query = [api.Query(pkg_query, False, True)]
-        gettext.install("pkg", "/usr/share/locale")
         search_remote = api_inst.remote_search(query, servers=None,
                                                prune_versions=True)
         search_local = api_inst.local_search(query)