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