Removed many unnecessary files and started changing pypo to use setuptools
This commit is contained in:
parent
144923c353
commit
97805ad271
169 changed files with 5 additions and 8620 deletions
17
python_apps/pypo/pypo/pure.py
Normal file
17
python_apps/pypo/pypo/pure.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
import re
|
||||
|
||||
|
||||
def version_cmp(version1, version2):
|
||||
def normalize(v):
|
||||
return [int(x) for x in re.sub(r'(\.0+)*$','', v).split(".")]
|
||||
return cmp(normalize(version1), normalize(version2))
|
||||
|
||||
def date_interval_to_seconds(interval):
|
||||
"""
|
||||
Convert timedelta object into int representing the number of seconds. If
|
||||
number of seconds is less than 0, then return 0.
|
||||
"""
|
||||
seconds = (interval.microseconds + \
|
||||
(interval.seconds + interval.days * 24 * 3600) * 10 ** 6) / float(10 ** 6)
|
||||
|
||||
return seconds
|
Loading…
Add table
Add a link
Reference in a new issue