Commit 101e6264 authored by Jim Fulton's avatar Jim Fulton

rearranged SOFTWARE_HOME and INSTANCE_HOME

parent 23c4048a
"""Access control package"""
__version__='$Revision: 1.60 $'[11:-2]
__version__='$Revision: 1.61 $'[11:-2]
import Globals, App.Undo, socket, regex
from Globals import HTMLFile, MessageDialog, Persistent, PersistentMapping
......@@ -173,7 +173,7 @@ class User(BasicUser, Persistent):
_remote_user_mode=0
try:
f=open('%s/access' % SOFTWARE_HOME, 'r')
f=open('%s/access' % INSTANCE_HOME, 'r')
data=split(strip(f.readline()),':')
f.close()
_remote_user_mode=not data[1]
......
__doc__="""System management components"""
__version__='$Revision: 1.34 $'[11:-2]
__version__='$Revision: 1.35 $'[11:-2]
import sys,os,time,string,Globals, Acquisition
......@@ -172,7 +172,7 @@ class ApplicationManager(Folder,CacheManager):
exists=os.path.exists
strip=string.strip
product_dir=path_join(SOFTWARE_HOME,'lib/python/Products')
product_dir=path_join(SOFTWARE_HOME,'Products')
product_names=os.listdir(product_dir)
product_names.sort()
info=[]
......
......@@ -12,8 +12,8 @@ __doc__='''Standard routines for handling Principia Extensions
Principia extensions currently include external methods and pluggable brains.
$Id: Extensions.py,v 1.2 1998/09/16 16:52:42 jim Exp $'''
__version__='$Revision: 1.2 $'[11:-2]
$Id: Extensions.py,v 1.3 1998/12/03 15:29:20 jim Exp $'''
__version__='$Revision: 1.3 $'[11:-2]
from string import find
import os, zlib, rotor
......@@ -48,8 +48,7 @@ def getObject(module, name, reload=0, modules={}):
d=find(n,'.')
if d > 0:
d,n=n[:d],n[d+1:]
n=("%s/lib/python/Products/%s/Extensions/%s.pyp"
% (SOFTWARE_HOME,d,n))
n=("%s/Products/%s/Extensions/%s.pyp" % (SOFTWARE_HOME,d,n))
__traceback_info__=n, module
if exists(n):
data=zlib.decompress(
......@@ -58,7 +57,7 @@ def getObject(module, name, reload=0, modules={}):
execsrc=compile(data,module,'exec')
if execsrc is None:
try: execsrc=open("%s/Extensions/%s.py" % (SOFTWARE_HOME, module))
try: execsrc=open("%s/Extensions/%s.py" % (INSTANCE_HOME, module))
except: raise "Module Error", (
"The specified module, <em>%s</em>, couldn't be opened."
% module)
......@@ -99,6 +98,9 @@ def getBrain(module, class_name, reload=0):
##############################################################################
#
# $Log: Extensions.py,v $
# Revision 1.3 1998/12/03 15:29:20 jim
# rearranged SOFTWARE_HOME and INSTANCE_HOME
#
# Revision 1.2 1998/09/16 16:52:42 jim
# Improved error reporting.
#
......
......@@ -168,7 +168,7 @@ class Product(Folder):
# Extensions
pp=id+'.'
lpp=len(pp)
ed=os.path.join(SOFTWARE_HOME,'Extensions')
ed=os.path.join(INSTANCE_HOME,'Extensions')
if os.path.exists(ed):
for name in os.listdir(ed):
suffix=''
......
"""Global definitions"""
__version__='$Revision: 1.25 $'[11:-2]
__version__='$Revision: 1.26 $'[11:-2]
import sys, os
from DateTime import DateTime
......@@ -15,20 +15,24 @@ def package_home(globals_dict):
if hasattr(m,'__path__'): return m.__path__[0]
return sys.modules[__name__[:rfind(__name__,'.')]].__path__[0]
try:
home=CUSTOMER_HOME,SOFTWARE_HOME
CUSTOMER_HOME,SOFTWARE_HOME=home
try: home=os.environ['SOFTWARE_HOME']
except:
try: home=os.environ['SOFTWARE_HOME']
except:
import Products
home=package_home(Products.__dict__)
home=(os.path.split(os.path.split(os.path.split(home)[0])[0])[0]
or os.getcwd())
try: chome=os.environ['CUSTOMER_HOME']
except: chome=home
CUSTOMER_HOME=sys.modules['__builtin__'].CUSTOMER_HOME=chome
SOFTWARE_HOME=sys.modules['__builtin__'].SOFTWARE_HOME=home
import Products
home=package_home(Products.__dict__)
d,e=os.path.split(chome)
if d: home=d
SOFTWARE_HOME=sys.modules['__builtin__'].SOFTWARE_HOME=home
try: chome=os.environ['INSTANCE_HOME']
except:
chome=home
d,e=os.path.split(chome)
if e=='python':
d,e=os.path.split(d)
if e=='lib': chome=d
INSTANCE_HOME=sys.modules['__builtin__'].INSTANCE_HOME=chome
from BoboPOS import Persistent, PickleDictionary
......@@ -119,7 +123,7 @@ class HTMLFile(DocumentTemplate.HTMLFile,MethodObject.Method,):
_v_last_read=0
def __init__(self,name,_prefix=None, **kw):
if _prefix is None: _prefix=SOFTWARE_HOME+'/lib/python'
if _prefix is None: _prefix=SOFTWARE_HOME
elif type(_prefix) is not type(''): _prefix=package_home(_prefix)
args=(self, '%s/%s.dtml' % (_prefix,name))
......@@ -134,7 +138,7 @@ class HTMLFile(DocumentTemplate.HTMLFile,MethodObject.Method,):
return apply(HTMLFile.inheritedAttribute('__call__'),
(self,)+args[1:],kw)
data_dir = CUSTOMER_HOME+'/var'
data_dir = INSTANCE_HOME+'/var'
BobobaseName = '%s/Data.bbb' % data_dir
from App.Dialogs import MessageDialog
......
"""Image object that is stored in a file"""
__version__='$Revision: 1.5 $'[11:-2]
__version__='$Revision: 1.6 $'[11:-2]
from string import rfind
from Globals import package_home
......@@ -11,7 +11,7 @@ class ImageFile(Acquisition.Explicit):
"""Image object stored in an external file"""
def __init__(self,path,_prefix=None):
if _prefix is None: _prefix=SOFTWARE_HOME+'/lib/python'
if _prefix is None: _prefix=SOFTWARE_HOME
elif type(_prefix) is not type(''): _prefix=package_home(_prefix)
path='%s/%s' % (_prefix, path)
......
......@@ -11,8 +11,8 @@
__doc__='''Application support
$Id: Application.py,v 1.75 1998/12/01 17:28:24 brian Exp $'''
__version__='$Revision: 1.75 $'[11:-2]
$Id: Application.py,v 1.76 1998/12/03 15:29:20 jim Exp $'''
__version__='$Revision: 1.76 $'[11:-2]
import Globals,Folder,os,regex,sys,App.Product, App.ProductRegistry
......@@ -221,7 +221,7 @@ def open_bobobase():
Bobobase=Globals.Bobobase=Globals.PickleDictionary(Globals.BobobaseName)
product_dir=os.path.join(SOFTWARE_HOME,'lib/python/Products')
product_dir=os.path.join(SOFTWARE_HOME,'Products')
__traceback_info__=sys.path
......@@ -270,7 +270,7 @@ def install_products(app):
# that all folders know about top-level objects, aka products
path_join=os.path.join
product_dir=path_join(SOFTWARE_HOME,'lib/python/Products')
product_dir=path_join(SOFTWARE_HOME,'Products')
isdir=os.path.isdir
exists=os.path.exists
DictType=type({})
......@@ -389,6 +389,9 @@ class Misc_:
##############################################################################
#
# $Log: Application.py,v $
# Revision 1.76 1998/12/03 15:29:20 jim
# rearranged SOFTWARE_HOME and INSTANCE_HOME
#
# Revision 1.75 1998/12/01 17:28:24 brian
# Added Help support
#
......
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