Commit 95d27aa8 authored by Jim Fulton's avatar Jim Fulton

Added rp switch to open of binary file. Grrrrr.

parent 6ef46d0b
...@@ -86,8 +86,8 @@ __doc__='''Standard routines for handling Principia Extensions ...@@ -86,8 +86,8 @@ __doc__='''Standard routines for handling Principia Extensions
Principia extensions currently include external methods and pluggable brains. Principia extensions currently include external methods and pluggable brains.
$Id: Extensions.py,v 1.6 1999/03/03 19:22:20 jim Exp $''' $Id: Extensions.py,v 1.7 1999/03/09 14:57:15 jim Exp $'''
__version__='$Revision: 1.6 $'[11:-2] __version__='$Revision: 1.7 $'[11:-2]
from string import find from string import find
import os, zlib, rotor import os, zlib, rotor
...@@ -182,7 +182,7 @@ def getObject(module, name, reload=0, modules={}): ...@@ -182,7 +182,7 @@ def getObject(module, name, reload=0, modules={}):
if p[-4:]=='.pyp': if p[-4:]=='.pyp':
data=zlib.decompress( data=zlib.decompress(
rotor.newrotor(d+' shshsh').decrypt(open(p).read()) rotor.newrotor(d+' shshsh').decrypt(open(p,'rb').read())
) )
execsrc=compile(data,module,'exec') execsrc=compile(data,module,'exec')
else: else:
......
...@@ -111,6 +111,7 @@ from OFS.Folder import Folder ...@@ -111,6 +111,7 @@ from OFS.Folder import Folder
import regex, zlib, Globals, cPickle, marshal, Main, rotor import regex, zlib, Globals, cPickle, marshal, Main, rotor
from string import rfind, atoi, find, strip, join from string import rfind, atoi, find, strip, join
from Factory import Factory from Factory import Factory
import ZClasses
class ProductFolder(Folder): class ProductFolder(Folder):
"Manage a collection of Products" "Manage a collection of Products"
...@@ -169,11 +170,19 @@ class Product(Folder): ...@@ -169,11 +170,19 @@ class Product(Folder):
meta_types=( meta_types=(
ZClasses.meta_types+
(
{ {
'name': 'Principia Factory', 'name': 'Principia Factory',
'action': 'manage_addPrincipiaFactoryForm' 'action': 'manage_addPrincipiaFactoryForm'
}, },
) )
)
manage_addZClassForm=ZClasses.methods['manage_addZClassForm']
manage_addZClass =ZClasses.methods['manage_addZClass']
manage_subclassableClassNames=ZClasses.methods[
'manage_subclassableClassNames']
manage_options=( manage_options=(
{'label':'Contents', 'action':'manage_main'}, {'label':'Contents', 'action':'manage_main'},
...@@ -327,7 +336,6 @@ class Product(Folder): ...@@ -327,7 +336,6 @@ class Product(Folder):
)).read() )).read()
except: return '' except: return ''
class CompressedOutputFile: class CompressedOutputFile:
def __init__(self, rot): def __init__(self, rot):
self._c=zlib.compressobj() self._c=zlib.compressobj()
...@@ -417,7 +425,7 @@ def initializeProduct(productp, name, home, app): ...@@ -417,7 +425,7 @@ def initializeProduct(productp, name, home, app):
except: pass except: pass
try: try:
f=CompressedInputFile(open(home+'/product.dat'),name+' shshsh') f=CompressedInputFile(open(home+'/product.dat','rb'),name+' shshsh')
meta=cPickle.Unpickler(f).load() meta=cPickle.Unpickler(f).load()
product=Globals.Bobobase._jar.import_file(f) product=Globals.Bobobase._jar.import_file(f)
product._objects=meta['_objects'] product._objects=meta['_objects']
......
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