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
1f97e260
Commit
1f97e260
authored
Feb 13, 2003
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More cleanup, make this actually pass the (new) tests.
parent
88ac137a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
lib/python/App/version_txt.py
lib/python/App/version_txt.py
+15
-16
No files found.
lib/python/App/version_txt.py
View file @
1f97e260
...
@@ -18,13 +18,11 @@ from App.config import getConfiguration
...
@@ -18,13 +18,11 @@ from App.config import getConfiguration
_version_string
=
None
_version_string
=
None
_zope_version
=
None
_zope_version
=
None
def
_test_reset
():
def
intval
(
dict
,
key
):
# Needed for testing.
return
int
(
dict
.
get
(
key
,
0
))
global
_version_string
,
_zope_version
_version_string
=
None
def
strval
(
dict
,
key
):
_zope_version
=
None
return
str
(
dict
.
get
(
key
,
''
))
def
_prep_version_data
():
def
_prep_version_data
():
global
_version_string
,
_zope_version
global
_version_string
,
_zope_version
...
@@ -39,18 +37,19 @@ def _prep_version_data():
...
@@ -39,18 +37,19 @@ def _prep_version_data():
'(?P<status>[A-Za-z]+)?(?P<release>[0-9]+)?'
)
'(?P<status>[A-Za-z]+)?(?P<release>[0-9]+)?'
)
try
:
try
:
s
=
open
(
fn
).
read
()
s
=
open
(
fn
).
read
()
except
IOError
:
ss
=
'unreleased version'
_zope_version
=
(
-
1
,
-
1
,
-
1
,
''
,
-
1
)
else
:
ss
=
re
.
sub
(
"
\
(.*?
\
)
\
?
"
,"",s)
ss
=
re
.
sub
(
"
\
(.*?
\
)
\
?
"
,"",s)
dict = expr.match(s).groupdict()
dict = expr.match(s).groupdict()
_zope_version = (
_zope_version = (
intval(dict, 'major'),
int(dict.get('major') or -1),
intval(dict, 'minor'),
int(dict.get('minor') or -1),
intval(dict, 'micro'),
int(dict.get('micro') or -1),
strval(dict, 'status'),
dict.get('status') or '',
intval(dict, 'release'))
int(dict.get('release') or -1),
except:
)
ss = 'unreleased version'
_zope_version = (-1, -1, -1, '', -1)
_version_string = "
%
s
,
%
s
" % (ss, pyver)
_version_string = "
%
s
,
%
s
" % (ss, pyver)
...
...
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