Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
f6396b03
Commit
f6396b03
authored
Sep 16, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved error reporting.
parent
cd22345a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
10 deletions
+24
-10
lib/python/App/Extensions.py
lib/python/App/Extensions.py
+24
-10
No files found.
lib/python/App/Extensions.py
View file @
f6396b03
...
...
@@ -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.
1 1998/08/03 13:43:26
jim Exp $'''
__version__
=
'$Revision: 1.
1
$'
[
11
:
-
2
]
$Id: Extensions.py,v 1.
2 1998/09/16 16:52:42
jim Exp $'''
__version__
=
'$Revision: 1.
2
$'
[
11
:
-
2
]
from
string
import
find
import
os
,
zlib
,
rotor
...
...
@@ -42,7 +42,9 @@ def getObject(module, name, reload=0, modules={}):
d
,
n
=
path_split
(
module
)
if
d
:
raise
ValueError
,
(
'The file name, %s, should be a simple file name'
%
module
)
m
=
{}
execsrc
=
None
d
=
find
(
n
,
'.'
)
if
d
>
0
:
d
,
n
=
n
[:
d
],
n
[
d
+
1
:]
...
...
@@ -53,14 +55,23 @@ def getObject(module, name, reload=0, modules={}):
data
=
zlib
.
decompress
(
rotor
.
newrotor
(
d
+
' shshsh'
).
decrypt
(
open
(
n
).
read
())
)
exec
compile
(
data
,
module
,
'exec'
)
in
m
else
:
exec
open
(
"%s/Extensions/%s.py"
%
(
SOFTWARE_HOME
,
module
))
in
m
else
:
exec
open
(
"%s/Extensions/%s.py"
%
(
SOFTWARE_HOME
,
module
))
in
m
execsrc
=
compile
(
data
,
module
,
'exec'
)
if
execsrc
is
None
:
try
:
execsrc
=
open
(
"%s/Extensions/%s.py"
%
(
SOFTWARE_HOME
,
module
))
except
:
raise
"Module Error"
,
(
"The specified module, <em>%s</em>, couldn't be opened."
%
module
)
m
=
{}
exec
execsrc
in
m
try
:
r
=
m
[
name
]
except
KeyError
:
raise
'Invalid Object Name'
,
(
"The specified object, <em>%s</em>, was not found in module, "
"<em>%s</em>."
%
(
name
,
module
))
r
=
m
[
name
]
if
old
:
for
k
,
v
in
m
.
items
():
old
[
k
]
=
v
else
:
modules
[
module
]
=
m
...
...
@@ -88,6 +99,9 @@ def getBrain(module, class_name, reload=0):
##############################################################################
#
# $Log: Extensions.py,v $
# Revision 1.2 1998/09/16 16:52:42 jim
# Improved error reporting.
#
# Revision 1.1 1998/08/03 13:43:26 jim
# new folderish control panel and product management
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment