Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
a02f949d
Commit
a02f949d
authored
Jun 02, 2019
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for updater with beta releases
parent
b4e0d039
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
updater.py
cps/updater.py
+14
-7
No files found.
cps/updater.py
View file @
a02f949d
...
...
@@ -380,18 +380,25 @@ class Updater(threading.Thread):
minor_version_update
=
int
(
commit
[
i
][
'tag_name'
]
.
split
(
'.'
)[
1
])
patch_version_update
=
int
(
commit
[
i
][
'tag_name'
]
.
split
(
'.'
)[
2
])
current_version
[
0
]
=
int
(
current_version
[
0
])
current_version
[
1
]
=
int
(
current_version
[
1
])
try
:
current_version
[
2
]
=
int
(
current_version
[
2
])
except
ValueError
:
current_version
[
2
]
=
int
(
current_version
[
2
]
.
split
(
' '
)[
0
])
-
1
# Check if major versions are identical search for newest nonenqual commit and update to this one
if
major_version_update
==
int
(
current_version
[
0
])
:
if
(
minor_version_update
==
int
(
current_version
[
1
])
and
patch_version_update
>
int
(
current_version
[
2
])
)
or
\
minor_version_update
>
int
(
current_version
[
1
])
:
if
major_version_update
==
current_version
[
0
]
:
if
(
minor_version_update
==
current_version
[
1
]
and
patch_version_update
>
current_version
[
2
]
)
or
\
minor_version_update
>
current_version
[
1
]
:
parents
.
append
([
commit
[
i
][
'tag_name'
],
commit
[
i
][
'body'
]
.
replace
(
'
\r\n
'
,
'<p>'
)])
i
-=
1
continue
if
major_version_update
<
int
(
current_version
[
0
])
:
if
major_version_update
<
current_version
[
0
]
:
i
-=
1
continue
if
major_version_update
>
int
(
current_version
[
0
])
:
if
major_version_update
>
current_version
[
0
]
:
# found update update to last version before major update, unless current version is on last version
# before major update
if
commit
[
i
+
1
][
'tag_name'
]
.
split
(
'.'
)[
1
]
==
current_version
[
1
]:
...
...
@@ -420,7 +427,7 @@ class Updater(threading.Thread):
'update'
:
True
,
'success'
:
True
,
'message'
:
_
(
u'
A new update is available. Click on the button below to update to the latest
version.'
),
u'
Click on the button below to update to the latest stable
version.'
),
'history'
:
parents
})
self
.
updateFile
=
commit
[
0
][
'zipball_url'
]
...
...
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