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
38940939
Commit
38940939
authored
Dec 18, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Many changes to expose README files and to deal with broken products
(e.g. DAs with missing or incorrect binaries.)
parent
f701a0a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
4 deletions
+35
-4
lib/python/App/Product.py
lib/python/App/Product.py
+35
-4
No files found.
lib/python/App/Product.py
View file @
38940939
...
...
@@ -304,6 +304,16 @@ class Product(Folder):
Distributions
=
Distributions
()
manage_traceback
=
Globals
.
HTMLFile
(
'traceback'
,
globals
())
manage_readme
=
Globals
.
HTMLFile
(
'readme'
,
globals
())
def
manage_get_product_readme__
(
self
):
try
:
return
open
(
os
.
path
.
join
(
SOFTWARE_HOME
,
'Products'
,
self
.
id
,
'README.txt'
)).
read
()
except
:
return
''
class
CompressedOutputFile
:
def
__init__
(
self
,
rot
):
self
.
_c
=
zlib
.
compressobj
()
...
...
@@ -372,18 +382,23 @@ class Distribution:
RESPONSE
[
'content-type'
]
=
'application/x-gzip'
return
r
def
initializeProduct
(
name
,
home
,
app
):
def
initializeProduct
(
productp
,
name
,
home
,
app
):
# Initialize a levered product
products
=
app
.
Control_Panel
.
Products
if
hasattr
(
productp
,
'__import_error__'
):
ie
=
productp
.
__import_error__
else
:
ie
=
None
try
:
fver
=
strip
(
open
(
home
+
'/version.txt'
).
read
())
except
:
fver
=
'
under development
'
except
:
fver
=
''
old
=
None
try
:
if
ihasattr
(
products
,
name
):
old
=
getattr
(
products
,
name
)
if
ihasattr
(
old
,
'version'
)
and
old
.
version
==
fver
:
if
(
ihasattr
(
old
,
'version'
)
and
old
.
version
==
fver
and
hasattr
(
old
,
'__import_error__'
)
and
old
.
__import_error__
==
ie
):
return
except
:
pass
...
...
@@ -393,7 +408,8 @@ def initializeProduct(name, home, app):
product
=
Globals
.
Bobobase
.
_jar
.
import_file
(
f
)
product
.
_objects
=
meta
[
'_objects'
]
except
:
product
=
Product
(
name
,
'Installed product %s (%s)'
%
(
name
,
fver
))
f
=
fver
and
(
" (%s)"
%
fver
)
product
=
Product
(
name
,
'Installed product %s%s'
%
(
name
,
f
))
if
old
is
not
None
:
products
.
_delObject
(
name
)
products
.
_setObject
(
name
,
product
)
...
...
@@ -405,5 +421,20 @@ def initializeProduct(name, home, app):
product
.
manage_distribution
=
None
product
.
thisIsAnInstalledProduct
=
1
if
ie
:
product
.
import_error_
=
ie
product
.
title
=
'Broken product %s'
%
name
product
.
icon
=
'p_/BrokenProduct_icon'
product
.
manage_options
=
(
{
'label'
:
'README'
,
'action'
:
'manage_readme'
},
{
'label'
:
'Traceback'
,
'action'
:
'manage_traceback'
},
)
if
os
.
path
.
exists
(
os
.
path
.
join
(
home
,
'README.txt'
)):
product
.
manage_options
=
product
.
manage_options
+
(
{
'label'
:
'README'
,
'action'
:
'manage_readme'
},
)
def
ihasattr
(
o
,
name
):
return
hasattr
(
o
,
name
)
and
o
.
__dict__
.
has_key
(
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