Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
plugin_dbui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
w2pext
plugin_dbui
Commits
d5011092
Commit
d5011092
authored
13 years ago
by
Renaud Le Gac
Browse files
Options
Downloads
Patches
Plain Diff
Polish the argument of the buildVersion script.
parent
c69484df
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
buildVersion.py
+23
-11
23 additions, 11 deletions
buildVersion.py
with
23 additions
and
11 deletions
buildVersion.py
+
23
−
11
View file @
d5011092
...
@@ -107,11 +107,11 @@ def git():
...
@@ -107,11 +107,11 @@ def git():
subprocess
.
call
(
cmd
)
subprocess
.
call
(
cmd
)
def
update
(
version
):
def
set_version
(
version
):
"""
Update
version identifier in CHANGELOG and appbase.js
"""
Set
version identifier in CHANGELOG and appbase.js
"""
"""
print
'
Modified
'
,
JSBASE
print
'
Set version in
'
,
JSBASE
s
=
open
(
JSBASE
,
'
rb
'
).
read
()
s
=
open
(
JSBASE
,
'
rb
'
).
read
()
# look for a pattern App.version = '0.8.3'; in appbase.js
# look for a pattern App.version = '0.8.3'; in appbase.js
...
@@ -132,7 +132,7 @@ def update(version):
...
@@ -132,7 +132,7 @@ def update(version):
# look for a pattern HEAD in the CHANGELOG
# look for a pattern HEAD in the CHANGELOG
# split the the string in 2 parts (pre HEAD, post HEAD)
# split the the string in 2 parts (pre HEAD, post HEAD)
print
'
Modified
'
,
CHANGELOG
print
'
Set version in
'
,
CHANGELOG
s
=
open
(
CHANGELOG
,
'
rb
'
).
read
()
s
=
open
(
CHANGELOG
,
'
rb
'
).
read
()
m
=
re
.
match
(
"
(.+HEAD
\n
)(.*)
"
,
s
,
re
.
DOTALL
)
m
=
re
.
match
(
"
(.+HEAD
\n
)(.*)
"
,
s
,
re
.
DOTALL
)
...
@@ -201,10 +201,15 @@ if __name__ == '__main__':
...
@@ -201,10 +201,15 @@ if __name__ == '__main__':
action
=
"
store_true
"
,
action
=
"
store_true
"
,
dest
=
"
git
"
,
dest
=
"
git
"
,
help
=
"
run the git steps.
"
)
help
=
"
run the git steps.
"
)
ops
.
add_option
(
"
-r
"
,
"
--release
"
,
action
=
"
store_true
"
,
dest
=
"
get
"
,
help
=
"
run the version of the current release and exit.
"
)
ops
.
add_option
(
"
-
u
"
,
"
--
update
"
,
ops
.
add_option
(
"
-
s
"
,
"
--
set_version
"
,
action
=
"
store_true
"
,
action
=
"
store_true
"
,
dest
=
"
update
"
,
dest
=
"
set
"
,
help
=
"
run the update version step.
"
)
help
=
"
run the update version step.
"
)
ops
.
add_option
(
"
-y
"
,
"
--yuicompressor
"
,
ops
.
add_option
(
"
-y
"
,
"
--yuicompressor
"
,
...
@@ -218,16 +223,23 @@ if __name__ == '__main__':
...
@@ -218,16 +223,23 @@ if __name__ == '__main__':
help
=
"
run the web2py step.
"
)
help
=
"
run the web2py step.
"
)
ops
.
set_defaults
(
clean
=
False
,
ops
.
set_defaults
(
clean
=
False
,
get
=
False
,
git
=
False
,
git
=
False
,
update
=
False
,
set
=
False
,
yuicompressor
=
False
,
yuicompressor
=
False
,
web2py
=
False
)
web2py
=
False
)
(
opt
,
args
)
=
ops
.
parse_args
()
(
opt
,
args
)
=
ops
.
parse_args
()
# the version of the current release
if
opt
.
get
:
version
=
get_version
()
print
"
\n
The version of the current release is %s
\n
"
%
version
sys
.
exit
(
0
)
# by default run all steps: update, git, YUIcompressor and web2py
# by default run all steps: update, git, YUIcompressor and web2py
if
not
(
opt
.
update
or
opt
.
git
or
opt
.
yuicompressor
or
opt
.
web2py
):
if
not
(
opt
.
set
or
opt
.
git
or
opt
.
yuicompressor
or
opt
.
web2py
):
opt
.
update
=
True
opt
.
set
=
True
opt
.
git
=
True
opt
.
git
=
True
opt
.
yuicompressor
=
True
opt
.
yuicompressor
=
True
opt
.
web2py
=
True
opt
.
web2py
=
True
...
@@ -239,14 +251,14 @@ if __name__ == '__main__':
...
@@ -239,14 +251,14 @@ if __name__ == '__main__':
clean
()
clean
()
sys
.
exit
(
0
)
sys
.
exit
(
0
)
if
opt
.
update
:
if
opt
.
set
:
if
args
:
if
args
:
version
=
args
[
0
]
version
=
args
[
0
]
else
:
else
:
version
=
raw_input
(
'
Enter the version identifier:
'
)
version
=
raw_input
(
'
Enter the version identifier:
'
)
update
(
version
)
set_version
(
version
)
if
opt
.
yuicompressor
:
yuicompressor
()
if
opt
.
yuicompressor
:
yuicompressor
()
if
opt
.
git
:
git
()
if
opt
.
git
:
git
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment