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
6bd14cf2
Commit
6bd14cf2
authored
Dec 17, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial_products is dead!
parent
1d06b682
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
31 deletions
+17
-31
lib/python/OFS/Application.py
lib/python/OFS/Application.py
+17
-31
No files found.
lib/python/OFS/Application.py
View file @
6bd14cf2
...
@@ -11,11 +11,11 @@
...
@@ -11,11 +11,11 @@
__doc__
=
'''Application support
__doc__
=
'''Application support
$Id: Application.py,v 1.2
5 1997/12/12 21:53:05 brian
Exp $'''
$Id: Application.py,v 1.2
6 1997/12/17 16:45:26 jim
Exp $'''
__version__
=
'$Revision: 1.2
5
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
6
$'
[
11
:
-
2
]
import
Globals
,
Folder
,
os
,
regex
import
Globals
,
Folder
,
os
,
regex
,
sys
from
string
import
lower
,
find
from
string
import
lower
,
find
from
DateTime
import
DateTime
from
DateTime
import
DateTime
from
AccessControl.User
import
UserFolder
from
AccessControl.User
import
UserFolder
...
@@ -134,6 +134,9 @@ class Application(Folder.Folder):
...
@@ -134,6 +134,9 @@ class Application(Folder.Folder):
def
open_bobobase
():
def
open_bobobase
():
# Open the application database
# Open the application database
Bobobase
=
Globals
.
Bobobase
=
Globals
.
PickleDictionary
(
Globals
.
BobobaseName
)
Bobobase
=
Globals
.
Bobobase
=
Globals
.
PickleDictionary
(
Globals
.
BobobaseName
)
product_dir
=
os
.
path
.
join
(
SOFTWARE_HOME
,
'Products'
)
sys
.
path
.
append
(
product_dir
)
try
:
app
=
Bobobase
[
'Application'
]
try
:
app
=
Bobobase
[
'Application'
]
except
KeyError
:
except
KeyError
:
...
@@ -141,11 +144,6 @@ def open_bobobase():
...
@@ -141,11 +144,6 @@ def open_bobobase():
app
.
_init
()
app
.
_init
()
Bobobase
[
'Application'
]
=
app
Bobobase
[
'Application'
]
=
app
get_transaction
().
commit
()
get_transaction
().
commit
()
if
not
Bobobase
.
has_key
(
'products'
):
import
initial_products
initial_products
.
install
(
Bobobase
)
get_transaction
().
commit
()
if
not
Bobobase
.
has_key
(
'roles'
):
if
not
Bobobase
.
has_key
(
'roles'
):
Bobobase
[
'roles'
]
=
(
'manage'
,)
Bobobase
[
'roles'
]
=
(
'manage'
,)
...
@@ -157,23 +155,25 @@ def open_bobobase():
...
@@ -157,23 +155,25 @@ def open_bobobase():
cpl
.
_init
()
cpl
.
_init
()
app
.
_setObject
(
'Control_Panel'
,
cpl
)
app
.
_setObject
(
'Control_Panel'
,
cpl
)
get_transaction
().
commit
()
get_transaction
().
commit
()
products
=
Bobobase
[
'products'
]
install_products
(
products
)
install_products
()
return
Bobobase
return
Bobobase
def
install_products
(
products
):
def
install_products
():
# Install a list of products into the basic folder class, so
# Install a list of products into the basic folder class, so
# that all folders know about top-level objects, aka products
# that all folders know about top-level objects, aka products
path_join
=
os
.
path
.
join
product_dir
=
path_join
(
SOFTWARE_HOME
,
'Products'
)
isdir
=
os
.
path
.
isdir
app
=
Globals
.
Bobobase
[
'Application'
]
app
=
Globals
.
Bobobase
[
'Application'
]
meta_types
=
list
(
Folder
.
Folder
.
dynamic_meta_types
)
meta_types
=
list
(
Folder
.
Folder
.
dynamic_meta_types
)
role_names
=
list
(
app
.
__defined_roles__
)
role_names
=
list
(
app
.
__defined_roles__
)
for
product_name
in
products
:
for
product_name
in
os
.
listdir
(
product_dir
):
if
not
isdir
(
path_join
(
product_dir
,
product_name
)):
continue
product
=
__import__
(
product_name
)
product
=
__import__
(
product_name
)
for
meta_type
in
product
.
meta_types
:
for
meta_type
in
product
.
meta_types
:
if
product_name
==
'OFS'
:
meta_types
.
insert
(
0
,
meta_type
)
if
product_name
==
'OFS'
:
meta_types
.
insert
(
0
,
meta_type
)
...
@@ -232,26 +232,12 @@ def install_products(products):
...
@@ -232,26 +232,12 @@ def install_products(products):
if
app
.
__defined_roles__
!=
role_names
:
if
app
.
__defined_roles__
!=
role_names
:
app
.
__defined_roles__
=
tuple
(
role_names
)
app
.
__defined_roles__
=
tuple
(
role_names
)
# if Globals.Bobobase['roles'] != role_names:
# Globals.Bobobase['roles'] = role_names
##############################################################################
# Test functions:
#
def
main
():
# The "main" program for this module
import
sys
print
sys
.
argv
[
0
]
+
" is a pure module and doesn't do anything by itself."
if
__name__
==
"__main__"
:
main
()
##############################################################################
##############################################################################
#
#
# $Log: Application.py,v $
# $Log: Application.py,v $
# Revision 1.26 1997/12/17 16:45:26 jim
# initial_products is dead!
#
# Revision 1.25 1997/12/12 21:53:05 brian
# Revision 1.25 1997/12/12 21:53:05 brian
# ui support
# ui support
#
#
...
...
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