Commit 75b5cc3b authored by Brian Lloyd's avatar Brian Lloyd

updated install_product to recognize .pyo files

parent b058178f
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
############################################################################## ##############################################################################
__doc__='''Application support __doc__='''Application support
$Id: Application.py,v 1.158 2001/10/12 13:39:11 evan Exp $''' $Id: Application.py,v 1.159 2001/10/19 13:37:15 Brian Exp $'''
__version__='$Revision: 1.158 $'[11:-2] __version__='$Revision: 1.159 $'[11:-2]
import Globals,Folder,os,sys,App.Product, App.ProductRegistry, misc_ import Globals,Folder,os,sys,App.Product, App.ProductRegistry, misc_
import time, traceback, os, string, Products import time, traceback, os, string, Products
...@@ -556,6 +556,7 @@ def import_product(product_dir, product_name, raise_exc=0, log_exc=1): ...@@ -556,6 +556,7 @@ def import_product(product_dir, product_name, raise_exc=0, log_exc=1):
if not isdir(package_dir): return if not isdir(package_dir): return
if not exists(path_join(package_dir, '__init__.py')): if not exists(path_join(package_dir, '__init__.py')):
if not exists(path_join(package_dir, '__init__.pyc')): if not exists(path_join(package_dir, '__init__.pyc')):
if not exists(path_join(package_dir, '__init__.pyo')):
return return
pname="Products.%s" % product_name pname="Products.%s" % product_name
...@@ -634,6 +635,7 @@ def install_product(app, product_dir, product_name, meta_types, ...@@ -634,6 +635,7 @@ def install_product(app, product_dir, product_name, meta_types,
if not isdir(package_dir): return if not isdir(package_dir): return
if not exists(path_join(package_dir, '__init__.py')): if not exists(path_join(package_dir, '__init__.py')):
if not exists(path_join(package_dir, '__init__.pyc')): if not exists(path_join(package_dir, '__init__.pyc')):
if not exists(path_join(package_dir, '__init__.pyo')):
return return
try: try:
product=__import__("Products.%s" % product_name, product=__import__("Products.%s" % product_name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment