8000 Add a function that recognizes the version and converts it to a number by rosd89 · Pull Request #3 · comfuture/pql · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add a function that recognizes the version and converts it to a number #3

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

Merged
merged 1 commit into from
Sep 15, 2020

Conversation

rosd89
Copy link
@rosd89 rosd89 commented Sep 14, 2020

self.compare('version == symver("1.0.0 (0)")', {'version': 1000000000.0})

image

Copy link
Owner
@comfuture comfuture left a comment

Choose a reason for hiding this comment

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

confirmed.
Great Job.

Comment on lines +457 to +461
print(self.re_version)
print(node.value)
d = re.findall(self.re_version, node.value)[0]
print(d)
return (int(d[0]) * 1e9) + (int(d[1]) * 1e6) + (int(d[2]) * 1e3) + int(d[3])
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
print(self.re_version)
print(node.value)
d = re.findall(self.re_version, node.value)[0]
print(d)
return (int(d[0]) * 1e9) + (int(d[1]) * 1e6) + (int(d[2]) * 1e3) + int(d[3])
d = re.findall(self.re_version, node.value)[0]
return (int(d[0]) * 1e9) + (int(d[1]) * 1e6) + (int(d[2]) * 1e3) + int(d[3])

@comfuture comfuture merged commit b24fb99 into comfuture:master Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0