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
8d61d0d4
Commit
8d61d0d4
authored
Nov 13, 2001
by
matt@zope.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Temporary Folder, Transience, and Sessions in application init
parent
6316e3c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
2 deletions
+56
-2
lib/python/OFS/Application.py
lib/python/OFS/Application.py
+56
-2
No files found.
lib/python/OFS/Application.py
View file @
8d61d0d4
...
...
@@ -84,8 +84,8 @@
##############################################################################
__doc__
=
'''Application support
$Id: Application.py,v 1.16
0 2001/10/19 13:40:14 Brian
Exp $'''
__version__
=
'$Revision: 1.16
0
$'
[
11
:
-
2
]
$Id: Application.py,v 1.16
1 2001/11/13 22:02:47 matt
Exp $'''
__version__
=
'$Revision: 1.16
1
$'
[
11
:
-
2
]
import
Globals
,
Folder
,
os
,
sys
,
App
.
Product
,
App
.
ProductRegistry
,
misc_
import
time
,
traceback
,
os
,
string
,
Products
...
...
@@ -419,6 +419,60 @@ def initialize(app):
get_transaction
().
note
(
'Added standard_error_message'
)
get_transaction
().
commit
()
# b/c: Ensure that a temp folder exists
if
not
hasattr
(
app
,
'temp_folder'
):
from
Products.TemporaryFolder.TemporaryFolder
import
MountedTemporaryFolder
tf
=
MountedTemporaryFolder
(
'temp_folder'
,
'Temporary Folder'
)
app
.
_setObject
(
'temp_folder'
,
tf
)
get_transaction
().
note
(
'Added temp_folder'
)
get_transaction
().
commit
()
del
tf
# b/c: Ensure that there is a transient container in the temp folder
tf
=
app
.
temp_folder
if
not
hasattr
(
tf
,
'transient_container'
):
from
Products.Transience.Transience
import
TransientObjectContainer
addnotify
=
os
.
environ
.
get
(
'ZSESSION_ADD_NOTIFY'
,
'/session_add'
)
delnotify
=
os
.
environ
.
get
(
'ZSESSION_DEL_NOTIFY'
,
'/session_del'
)
if
app
.
unrestrictedTraverse
(
addnotify
,
None
)
is
None
:
addnotify
=
None
if
app
.
unrestrictedTraverse
(
delnotify
,
None
)
is
None
:
delnotify
=
None
toc
=
TransientObjectContainer
(
'transient_container'
,
'Transient Object Container'
,
addNotification
=
addnotify
,
delNotification
=
delnotify
)
tf
.
_setObject
(
'transient_container'
,
toc
)
get_transaction
().
note
(
'Added transient_container to '
'temp_folder'
)
get_transaction
().
commit
()
del
toc
del
addnotify
del
delnotify
del
tf
# b/c: Ensure that a browser ID manager exists
if
not
hasattr
(
app
,
'browser_id_manager'
):
from
Products.Sessions.BrowserIdManager
import
BrowserIdManager
bid
=
BrowserIdManager
(
'browser_id_manager'
,
'Browser Id Manager'
)
app
.
_setObject
(
'browser_id_manager'
,
bid
)
get_transaction
().
note
(
'Added browser_id_manager'
)
get_transaction
().
commit
()
del
bid
# b/c: Ensure that a session data manager exists
if
not
hasattr
(
app
,
'session_data_manager'
):
from
Products.Sessions.SessionDataManager
import
SessionDataManager
sdm
=
SessionDataManager
(
'session_data_manager'
,
title
=
'Session Data Manager'
,
path
=
'/temp_folder/transient_container'
,
requestName
=
'SESSION'
)
app
.
_setObject
(
'session_data_manager'
,
sdm
)
get_transaction
().
note
(
'Added session_data_manager'
)
get_transaction
().
commit
()
del
sdm
# b/c: Ensure that Owner role exists.
if
hasattr
(
app
,
'__ac_roles__'
)
and
not
(
'Owner'
in
app
.
__ac_roles__
):
app
.
__ac_roles__
=
app
.
__ac_roles__
+
(
'Owner'
,)
...
...
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