Browse Source

HUE-3716 [core] Add gen-py paths to hue.pth

Jenny Kim 9 years ago
parent
commit
247788e
1 changed files with 12 additions and 0 deletions
  1. 12 0
      tools/app_reg/pth.py

+ 12 - 0
tools/app_reg/pth.py

@@ -68,6 +68,12 @@ class PthFile(object):
       self._entries.add(module_path)
       LOG.debug('Add to %s: %s' % (self._path, module_path))
 
+      # Add gen-py path if found
+      gen_py_path = os.path.join(app.abs_path, 'gen-py')
+      if os.path.exists(gen_py_path):
+        self._entries.add(gen_py_path)
+        LOG.debug('Add to %s: %s' % (self._path, gen_py_path))
+
       # Eggs could be in ext-py/<pkg>/dist/*.egg
       for py in app.find_ext_pys():
         ext_eggs = glob.glob(os.path.join(py, 'dist', '*.egg'))
@@ -86,6 +92,12 @@ class PthFile(object):
       self._entries.add(module_path)
       LOG.debug('Add to %s: %s' % (self._path, module_path))
 
+      # Add gen-py path if found
+      gen_py_path = self._relpath(os.path.join(app.abs_path, 'gen-py'))
+      if os.path.exists(os.path.join(app.abs_path, 'gen-py')):
+        self._entries.add(gen_py_path)
+        LOG.debug('Add to %s: %s' % (self._path, gen_py_path))
+
       # Eggs could be in ext-py/<pkg>/dist/*.egg
       for py in app.find_ext_pys():
         ext_eggs = [self._relpath(egg) for egg in glob.glob(os.path.join(py, 'dist', '*.egg'))]