Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
devflow
Commits
442fd5d3
Commit
442fd5d3
authored
Jan 29, 2013
by
Christos Stavrakakis
Browse files
pep8, pylint fixes
parent
3b1b0946
Changes
2
Hide whitespace changes
Inline
Side-by-side
devflow/autopkg.py
View file @
442fd5d3
...
...
@@ -129,8 +129,8 @@ def main():
dest
=
"dist"
,
default
=
"unstable"
,
help
=
"If running in snapshot mode, automatically set"
" the changelog distribution to this value"
" (default=unstable)."
)
" the changelog distribution to this value"
" (default=unstable)."
)
(
options
,
args
)
=
parser
.
parse_args
()
...
...
@@ -170,9 +170,9 @@ def main():
# Get current branch name and type and check if it is a valid one
branch
=
original_repo
.
head
.
reference
.
name
branch_type
=
versioning
.
get_branch_type
(
branch
)
branch_type
_str
=
versioning
.
get_branch_type
(
branch
)
if
branch_type
not
in
BRANCH_TYPES
.
keys
():
if
branch_type
_str
not
in
BRANCH_TYPES
.
keys
():
allowed_branches
=
", "
.
join
(
BRANCH_TYPES
.
keys
())
raise
ValueError
(
"Malformed branch name '%s', cannot classify as"
" one of %s"
%
(
branch
,
allowed_branches
))
...
...
@@ -182,7 +182,7 @@ def main():
origin_debian
=
"origin/"
+
debian_branch
if
not
debian_branch
in
original_repo
.
branches
:
# Get default debian branch
default_debian
=
BRANCH_TYPES
[
branch_type
].
default_debian_branch
default_debian
=
BRANCH_TYPES
[
branch_type
_str
].
default_debian_branch
origin_debian
=
"origin/"
+
default_debian
if
not
default_debian
in
original_repo
.
branches
:
original_repo
.
git
.
branch
(
default_debian
,
...
...
@@ -316,10 +316,5 @@ def call(cmd):
raise
RuntimeError
(
"Command '%s' failed!"
%
cmd
)
def
create_temp_directory
(
suffix
):
create_dir_cmd
=
mktemp
(
"-d"
,
"/tmp/"
+
suffix
+
"-XXXXX"
)
return
create_dir_cmd
.
stdout
.
strip
()
if
__name__
==
"__main__"
:
sys
.
exit
(
main
())
devflow/versioning.py
View file @
442fd5d3
...
...
@@ -321,8 +321,8 @@ def python_version(base_version, vcs_info, mode):
if
((
snap
and
not
btype
.
builds_snapshot
)
or
(
not
snap
and
not
btype
.
builds_release
)):
# nopep8
raise
ValueError
(
"Invalid mode '%s' in branch type '%s'"
%
(
mode
,
btypestr
))
raise
ValueError
(
"Invalid mode '%s' in branch type '%s'"
%
(
mode
,
btypestr
))
if
snap
:
v
=
"%s_%d_%s"
%
(
base_version
,
vcs_info
.
revno
,
vcs_info
.
revid
)
...
...
@@ -453,7 +453,7 @@ __version_user_info__ = "%(user_info)s"
vcs_info
=
pprint
.
PrettyPrinter
().
pformat
(
dict
(
v
.
_asdict
())),
user_info
=
user_info
())
for
pkg_name
,
pkg_info
in
config
[
'packages'
].
items
():
for
_
pkg_name
,
pkg_info
in
config
[
'packages'
].
items
():
version_filename
=
pkg_info
[
'version_file'
]
log
.
info
(
"Updating version file '%s'"
%
version_filename
)
version_file
=
file
(
version_filename
,
"w+"
)
...
...
@@ -492,7 +492,7 @@ def bump_version(new_version):
lines
=
f
.
readlines
()
for
i
in
range
(
0
,
len
(
lines
)):
if
not
lines
[
i
].
startswith
(
"#"
):
lines
[
i
]
=
lines
[
i
].
replace
(
old_version
,
new_version
)
lines
[
i
]
=
lines
[
i
].
replace
(
old_version
,
new_version
)
f
.
seek
(
0
)
f
.
truncate
(
0
)
f
.
writelines
(
lines
)
...
...
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