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
dc4d7d1a
Commit
dc4d7d1a
authored
Jan 12, 2005
by
Tino Wildenhain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add virtual_hosting on application initialization - like in 2.7 head
parent
1297a56f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
11 deletions
+33
-11
lib/python/OFS/Application.py
lib/python/OFS/Application.py
+19
-6
lib/python/OFS/tests/testAppInitializer.py
lib/python/OFS/tests/testAppInitializer.py
+11
-3
lib/python/Products/SiteAccess/tests/testVirtualHostMonster.py
...ython/Products/SiteAccess/tests/testVirtualHostMonster.py
+3
-2
No files found.
lib/python/OFS/Application.py
View file @
dc4d7d1a
...
@@ -305,6 +305,7 @@ class AppInitializer:
...
@@ -305,6 +305,7 @@ class AppInitializer:
self
.
install_errorlog
()
self
.
install_errorlog
()
self
.
install_products
()
self
.
install_products
()
self
.
install_standards
()
self
.
install_standards
()
self
.
install_virtual_hosting
()
self
.
check_zglobals
()
self
.
check_zglobals
()
def
install_cp_and_products
(
self
):
def
install_cp_and_products
(
self
):
...
@@ -498,6 +499,18 @@ class AppInitializer:
...
@@ -498,6 +499,18 @@ class AppInitializer:
app
.
_setInitializerFlag
(
'error_log'
)
app
.
_setInitializerFlag
(
'error_log'
)
self
.
commit
(
'Added site error_log at /error_log'
)
self
.
commit
(
'Added site error_log at /error_log'
)
def
install_virtual_hosting
(
self
):
app
=
self
.
getApp
()
if
app
.
_getInitializerFlag
(
'virtual_hosting'
):
return
if
not
app
.
objectIds
(
'Virtual Host Monster'
)
and
not
hasattr
(
app
,
'virtual_hosting'
):
from
Products.SiteAccess.VirtualHostMonster
import
VirtualHostMonster
vhm
=
VirtualHostMonster
()
vhm
.
id
=
'virtual_hosting'
vhm
.
addToContainer
(
app
)
app
.
_setInitializerFlag
(
'virtual_hosting'
)
self
.
commit
(
'Added virtual_hosting'
)
def
check_zglobals
(
self
):
def
check_zglobals
(
self
):
if
not
doInstall
():
if
not
doInstall
():
return
return
...
...
lib/python/OFS/tests/testAppInitializer.py
View file @
dc4d7d1a
...
@@ -129,6 +129,14 @@ class TestInitialization( unittest.TestCase ):
...
@@ -129,6 +129,14 @@ class TestInitialization( unittest.TestCase ):
self
.
assertEqual
(
app
.
browser_id_manager
.
meta_type
,
'Browser Id Manager'
)
self
.
assertEqual
(
app
.
browser_id_manager
.
meta_type
,
'Browser Id Manager'
)
self
.
failUnless
(
app
.
_getInitializerFlag
(
'browser_id_manager'
))
self
.
failUnless
(
app
.
_getInitializerFlag
(
'browser_id_manager'
))
def
test_install_virtual_hosting
(
self
):
self
.
configure
(
good_cfg
)
i
=
self
.
getOne
()
app
=
i
.
getApp
()
i
.
install_virtual_hosting
()
self
.
assertEqual
(
app
.
virtual_hosting
.
meta_type
,
'Virtual Host Monster'
)
self
.
failUnless
(
app
.
_getInitializerFlag
(
'virtual_hosting'
))
def
test_install_session_data_manager
(
self
):
def
test_install_session_data_manager
(
self
):
self
.
configure
(
good_cfg
)
self
.
configure
(
good_cfg
)
i
=
self
.
getOne
()
i
=
self
.
getOne
()
...
...
lib/python/Products/SiteAccess/tests/testVirtualHostMonster.py
View file @
dc4d7d1a
...
@@ -26,7 +26,8 @@ class VHMRegressions(unittest.TestCase):
...
@@ -26,7 +26,8 @@ class VHMRegressions(unittest.TestCase):
transaction
.
begin
()
transaction
.
begin
()
self
.
app
=
makerequest
(
Zope
.
app
())
self
.
app
=
makerequest
(
Zope
.
app
())
try
:
try
:
self
.
app
.
manage_addProduct
[
'SiteAccess'
].
manage_addVirtualHostMonster
(
'VHM'
)
#self.app.manage_addProduct['SiteAccess'].manage_addVirtualHostMonster('VHM')
# now we have a VHM as virtual_hosting per default
self
.
app
.
manage_addFolder
(
'folder'
)
self
.
app
.
manage_addFolder
(
'folder'
)
self
.
app
.
folder
.
manage_addDTMLMethod
(
'doc'
,
''
)
self
.
app
.
folder
.
manage_addDTMLMethod
(
'doc'
,
''
)
self
.
app
.
REQUEST
.
set
(
'PARENTS'
,
[
self
.
app
])
self
.
app
.
REQUEST
.
set
(
'PARENTS'
,
[
self
.
app
])
...
...
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