Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a very simple upgrade dialog (Sourcery refactored) #659

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions nowplaying/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,24 @@ def __lt__(self, other):
if self.chunk.get('rc') and not other.chunk.get('rc'):
return True

if self.chunk.get('rc') and other.chunk.get('rc'):
if self.chunk.get('rc') != other.chunk.get('rc'):
return self.chunk.get('rc') < other.chunk.get('rc')
if (
self.chunk.get('rc')
and other.chunk.get('rc')
and self.chunk.get('rc') != other.chunk.get('rc')
):
return self.chunk.get('rc') < other.chunk.get('rc')

# but commitnum > no commitnum at this point
if self.chunk.get('commitnum') and not other.chunk.get('commitnum'):
return False

if self.chunk.get('commitnum') and other.chunk.get('commitnum'):
if self.chunk.get('commitnum') != other.chunk.get('commitnum'):
return self.chunk.get('commitnum') < other.chunk.get(
'commitnum')
if (
self.chunk.get('commitnum')
and other.chunk.get('commitnum')
and self.chunk.get('commitnum') != other.chunk.get('commitnum')
):
return self.chunk.get('commitnum') < other.chunk.get(
'commitnum')
Comment on lines -89 to +106
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Version.__lt__ refactored with the following changes:


return False

Expand Down Expand Up @@ -133,10 +139,9 @@ def get_versions(self, testdata=None):
if self.prerelease < tagname:
self.prerelease = tagname
self.predata = rel
else:
if self.stable < tagname:
self.stable = tagname
self.stabledata = rel
elif self.stable < tagname:
self.stable = tagname
self.stabledata = rel
Comment on lines -136 to +144
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function UpgradeBinary.get_versions refactored with the following changes:


if self.stable > self.prerelease:
self.prerelease = self.stable
Expand Down