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
cda59849
Commit
cda59849
authored
Jul 02, 2001
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collector #2251.
parent
6e1a3b8d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
lib/python/App/Product.py
lib/python/App/Product.py
+18
-6
No files found.
lib/python/App/Product.py
View file @
cda59849
...
...
@@ -109,9 +109,10 @@
import
Globals
,
OFS
.
Folder
,
OFS
.
SimpleItem
,
os
,
string
,
Acquisition
,
Products
import
re
,
zlib
,
Globals
,
cPickle
,
marshal
,
rotor
import
ZClasses
,
ZClasses
.
ZClass
,
AccessControl
.
Owned
from
urllib
import
quote
from
OFS.Folder
import
Folder
from
string
import
rfind
,
atoi
,
find
,
strip
,
join
from
string
import
atoi
,
find
,
strip
,
join
from
Factory
import
Factory
from
Permission
import
PermissionManager
import
ZClasses
,
ZClasses
.
ZClass
...
...
@@ -158,14 +159,24 @@ class Product(Folder, PermissionManager):
_isBeingUsedAsAMethod_
=
1
def
new_version
(
self
,
_intending
=
re
.
compile
(
r"[
.]?[0-9]+$
"
).
search
,
#TS
_intending
=
re
.
compile
(
r"[
0-9]+
"
).
search
,
#TS
):
# Return a new version number based on the existing version.
v
=
str
(
self
.
version
)
if
not
v
:
return
'1.0'
if
_intending
(
v
)
is
None
:
return
v
l
=
rfind
(
v
,
'.'
)
return
v
[:
l
+
1
]
+
str
(
1
+
atoi
(
v
[
l
+
1
:]))
match
=
_intending
(
v
)
if
match
is
None
:
return
v
while
1
:
# Find the last set of digits.
m
=
_intending
(
v
,
match
.
end
())
if
m
is
None
:
break
else
:
match
=
m
start
=
match
.
start
()
end
=
match
.
end
()
return
v
[:
start
]
+
str
(
1
+
int
(
v
[
start
:
end
]))
+
v
[
end
:]
meta_types
=
(
...
...
@@ -243,7 +254,8 @@ class Product(Folder, PermissionManager):
self
.
version
=
version
=
strip
(
version
)
self
.
configurable_objects_
=
configurable_objects
self
.
redistributable
=
redistributable
RESPONSE
.
redirect
(
'Distributions/%s-%s.tar.gz'
%
(
self
.
id
,
version
))
RESPONSE
.
redirect
(
'Distributions/%s-%s.tar.gz'
%
(
quote
(
self
.
id
),
quote
(
version
)))
def
_distribution
(
self
):
# Return a distribution
...
...
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