Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gajim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
196
Issues
196
List
Boards
Labels
Service Desk
Milestones
Merge Requests
21
Merge Requests
21
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gajim
gajim
Commits
d63a796a
Commit
d63a796a
authored
May 15, 2020
by
André
Committed by
Philipp Hörist
May 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optparser: Support PEP-440 versions
parent
cc5ed8e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
18 deletions
+13
-18
gajim/common/optparser.py
gajim/common/optparser.py
+13
-18
No files found.
gajim/common/optparser.py
View file @
d63a796a
...
...
@@ -28,6 +28,7 @@
import
re
import
logging
from
pathlib
import
Path
from
packaging.version
import
Version
as
V
from
gi.repository
import
Gdk
from
nbxmpp.util
import
text_to_color
...
...
@@ -126,32 +127,26 @@ def write(self):
return
True
def
update_config
(
self
,
old_version
,
new_version
):
old_version_list
=
old_version
.
split
(
'.'
)
# convert '0.x.y' to (0, x, y)
old
=
[]
while
old_version_list
:
old
.
append
(
int
(
old_version_list
.
pop
(
0
)))
new_version_list
=
new_version
.
split
(
'.'
)
new
=
[]
while
new_version_list
:
new
.
append
(
int
(
new_version_list
.
pop
(
0
)))
if
old
<
[
0
,
16
,
4
,
1
]
and
new
>=
[
0
,
16
,
4
,
1
]:
old
=
V
(
old_version
)
new
=
V
(
new_version
)
if
old
<
V
(
'0.16.4.1'
)
<=
new
:
self
.
update_config_to_01641
()
if
old
<
[
0
,
16
,
10
,
1
]
and
new
>=
[
0
,
16
,
10
,
1
]
:
if
old
<
V
(
'0.16.10.1'
)
<=
new
:
self
.
update_config_to_016101
()
if
old
<
[
0
,
16
,
10
,
2
]
and
new
>=
[
0
,
16
,
10
,
2
]
:
if
old
<
V
(
'0.16.10.2'
)
<=
new
:
self
.
update_config_to_016102
()
if
old
<
[
0
,
16
,
10
,
4
]
and
new
>=
[
0
,
16
,
10
,
4
]
:
if
old
<
V
(
'0.16.10.4'
)
<=
new
:
self
.
update_config_to_016104
()
if
old
<
[
0
,
16
,
10
,
5
]
and
new
>=
[
0
,
16
,
10
,
5
]
:
if
old
<
V
(
'0.16.10.5'
)
<=
new
:
self
.
update_config_to_016105
()
if
old
<
[
0
,
98
,
3
]
and
new
>=
[
0
,
98
,
3
]
:
if
old
<
V
(
'0.98.3'
)
<=
new
:
self
.
update_config_to_0983
()
if
old
<
[
1
,
1
,
93
]
and
new
>=
[
1
,
1
,
93
]
:
if
old
<
V
(
'1.1.93'
)
<=
new
:
self
.
update_config_to_1193
()
if
old
<
[
1
,
1
,
94
]
and
new
>=
[
1
,
1
,
94
]
:
if
old
<
V
(
'1.1.94'
)
<=
new
:
self
.
update_config_to_1194
()
if
old
<
[
1
,
1
,
95
]
and
new
>=
[
1
,
1
,
95
]
:
if
old
<
V
(
'1.1.95'
)
<=
new
:
self
.
update_config_to_1195
()
app
.
config
.
set
(
'version'
,
new_version
)
...
...
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