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
eb3e2a06
Commit
eb3e2a06
authored
Jun 10, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added comments wrt the management of the module cache.
parent
96cb3faa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
lib/python/App/Extensions.py
lib/python/App/Extensions.py
+13
-4
No files found.
lib/python/App/Extensions.py
View file @
eb3e2a06
...
...
@@ -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.
9 1999/04/01 15:57:13
jim Exp $'''
__version__
=
'$Revision: 1.
9
$'
[
11
:
-
2
]
$Id: Extensions.py,v 1.
10 1999/06/10 18:56:25
jim Exp $'''
__version__
=
'$Revision: 1.
10
$'
[
11
:
-
2
]
from
string
import
find
import
os
,
zlib
,
rotor
...
...
@@ -162,8 +162,17 @@ def getPath(prefix, name, checkProduct=1, suffixes=('',)):
r
=
_getPath
(
home
,
prefix
,
name
,
suffixes
)
if
r
is
not
None
:
return
r
def
getObject
(
module
,
name
,
reload
=
0
,
modules
=
{}):
def
getObject
(
module
,
name
,
reload
=
0
,
# The use of a mutable default is intentional here,
# because modules is a module cache.
modules
=
{}
):
# The use of modules here is not thread safe, however, there is
# no real harm in a rece condition here. If two threads
# update the cache, then one will have simply worked a little
# harder than need be. So, in this case, we won't incur
# the expense of a lock.
if
modules
.
has_key
(
module
):
old
=
modules
[
module
]
if
old
.
has_key
(
name
)
and
not
reload
:
return
old
[
name
]
...
...
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