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
548eb048
Commit
548eb048
authored
Jul 31, 2000
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged changes from Redistributable-Products branch.
parent
31e9f137
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
18 deletions
+37
-18
lib/python/App/Product.py
lib/python/App/Product.py
+27
-16
lib/python/App/distributionView.dtml
lib/python/App/distributionView.dtml
+10
-2
No files found.
lib/python/App/Product.py
View file @
548eb048
...
...
@@ -152,6 +152,7 @@ class Product(Folder, PermissionManager):
icon
=
'p_/Product_icon'
version
=
''
configurable_objects_
=
()
redistributable
=
0
import_error_
=
None
_isBeingUsedAsAMethod_
=
1
...
...
@@ -221,12 +222,14 @@ class Product(Folder, PermissionManager):
return
self
.
REQUEST
[
'BASE4'
]
DestinationURL__roles__
=
None
def
manage_distribute
(
self
,
version
,
RESPONSE
,
configurable_objects
=
[]):
def
manage_distribute
(
self
,
version
,
RESPONSE
,
configurable_objects
=
[],
redistributable
=
0
):
"Set the product up to create a distribution and give a link"
if
self
.
__dict__
.
has_key
(
'manage_options'
):
raise
TypeError
,
'This product is <b>not</b> redistributable.'
self
.
version
=
version
=
strip
(
version
)
self
.
configurable_objects_
=
configurable_objects
self
.
redistributable
=
redistributable
RESPONSE
.
redirect
(
'Distributions/%s-%s.tar.gz'
%
(
self
.
id
,
version
))
def
_distribution
(
self
):
...
...
@@ -274,11 +277,17 @@ class Product(Folder, PermissionManager):
# product.dat
f
=
CompressedOutputFile
(
rot
)
if
self
.
redistributable
:
# Since it's redistributable, make all objects configurable.
objectList
=
self
.
_objects
else
:
objectList
=
tuple
(
filter
(
lambda
o
,
obs
=
self
.
configurable_objects_
:
o
[
'id'
]
in
obs
,
self
.
_objects
))
meta
=
{
'_objects'
:
tuple
(
filter
(
lambda
o
,
obs
=
self
.
configurable_objects_
:
o
[
'id'
]
in
obs
,
self
.
_objects
))
'_objects'
:
objectList
,
'redistributable'
:
self
.
redistributable
,
}
f
.
write
(
cPickle
.
dumps
(
meta
,
1
))
...
...
@@ -395,9 +404,6 @@ class Distribution:
def
initializeProduct
(
productp
,
name
,
home
,
app
):
# Initialize a levered product
products
=
app
.
Control_Panel
.
Products
if
hasattr
(
productp
,
'__import_error__'
):
ie
=
productp
.
__import_error__
...
...
@@ -409,20 +415,24 @@ def initializeProduct(productp, name, home, app):
try
:
if
ihasattr
(
products
,
name
):
old
=
getattr
(
products
,
name
)
if
(
ihasattr
(
old
,
'version'
)
and
old
.
version
==
fver
and
hasattr
(
old
,
'import_error_'
)
and
old
.
import_error_
==
ie
):
return
old
if
ihasattr
(
old
,
'version'
)
and
old
.
version
==
fver
:
if
hasattr
(
old
,
'import_error_'
)
and
\
old
.
import_error_
==
ie
:
# Version hasn't changed. Don't reinitialize.
return
old
except
:
pass
disable_distribution
=
1
try
:
f
=
CompressedInputFile
(
open
(
home
+
'/product.dat'
,
'rb'
),
name
+
' shshsh'
)
f
=
CompressedInputFile
(
open
(
home
+
'/product.dat'
,
'rb'
),
name
+
' shshsh'
)
except
:
f
=
fver
and
(
" (%s)"
%
fver
)
product
=
Product
(
name
,
'Installed product %s%s'
%
(
name
,
f
))
else
:
meta
=
cPickle
.
Unpickler
(
f
).
load
()
product
=
app
.
_p_jar
.
importFile
(
f
)
if
meta
.
get
(
'redistributable'
,
0
):
disable_distribution
=
0
product
.
_objects
=
meta
[
'_objects'
]
if
old
is
not
None
:
...
...
@@ -434,12 +444,13 @@ def initializeProduct(productp, name, home, app):
products
.
_setObject
(
name
,
product
)
#product.__of__(products)._postCopy(products)
product
.
manage_options
=
Folder
.
manage_options
product
.
icon
=
'p_/InstalledProduct_icon'
product
.
version
=
fver
product
.
home
=
home
product
.
_distribution
=
None
product
.
manage_distribution
=
None
if
disable_distribution
:
product
.
manage_options
=
Folder
.
manage_options
product
.
_distribution
=
None
product
.
manage_distribution
=
None
product
.
thisIsAnInstalledProduct
=
1
if
ie
:
...
...
lib/python/App/distributionView.dtml
View file @
548eb048
...
...
@@ -12,8 +12,16 @@
<input
type=
text
name=
"version"
value=
"<dtml-var new_version html_quote>"
>
</td>
</tr>
<tr><th
align=
"LEFT"
valign=
"TOP"
>
Configurable objects
</th>
<td
align=
"LEFT"
valign=
"TOP"
>
<tr><th
align=
"LEFT"
valign=
"TOP"
colspan=
"2"
><input
type=
"radio"
name=
"redistributable"
value=
"1"
checked
>
Allow redistribution
</th>
</tr>
<tr><th
align=
"LEFT"
valign=
"TOP"
colspan=
"2"
><input
type=
"radio"
name=
"redistributable"
value=
"0"
>
Disallow redistribution and
allow the user to configure only the selected objects:
</th>
</tr>
<tr>
<td
align=
"LEFT"
valign=
"TOP"
colspan=
"2"
>
<select
name=
"configurable_objects:list"
size=
10
multiple
>
<dtml-in
objectItems
>
<option
value=
"<dtml-var sequence-key html_quote>"
<
dtml-
...
...
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