mirror of
https://github.com/kennethreitz/maya.git
synced 2026-06-05 23:00:18 +00:00
Compare commits
7 Commits
Tafkas-master
...
v0.3.2
| Author | SHA1 | Date | |
|---|---|---|---|
| 7814ec2864 | |||
| f39c932039 | |||
| 96ff770071 | |||
| cd16ee94f0 | |||
| 7c68489682 | |||
| 93e163722b | |||
| b3ac13fcbf |
@@ -1,2 +1,2 @@
|
||||
tests:
|
||||
pytest test_maya.py
|
||||
pytest test_maya.py test_maya_interval.py
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
from .core import *
|
||||
@@ -19,7 +19,7 @@ import dateparser
|
||||
import pendulum
|
||||
from tzlocal import get_localzone
|
||||
|
||||
from compat import cmp, comparable
|
||||
from .compat import cmp, comparable
|
||||
|
||||
_EPOCH_START = (1970, 1, 1)
|
||||
|
||||
@@ -66,23 +66,23 @@ class MayaDT(object):
|
||||
|
||||
@validate_class_type_arguments('!=')
|
||||
def __ne__(self, maya_dt):
|
||||
return self._epoch != maya_dt._epoch
|
||||
return int(self._epoch) != int(maya_dt._epoch)
|
||||
|
||||
@validate_class_type_arguments('<')
|
||||
def __lt__(self, maya_dt):
|
||||
return self._epoch < maya_dt._epoch
|
||||
return int(self._epoch) < int(maya_dt._epoch)
|
||||
|
||||
@validate_class_type_arguments('<=')
|
||||
def __le__(self, maya_dt):
|
||||
return self._epoch <= maya_dt._epoch
|
||||
return int(self._epoch) <= int(maya_dt._epoch)
|
||||
|
||||
@validate_class_type_arguments('>')
|
||||
def __gt__(self, maya_dt):
|
||||
return self._epoch > maya_dt._epoch
|
||||
return int(self._epoch) > int(maya_dt._epoch)
|
||||
|
||||
@validate_class_type_arguments('>=')
|
||||
def __ge__(self, maya_dt):
|
||||
return self._epoch >= maya_dt._epoch
|
||||
return int(self._epoch) >= int(maya_dt._epoch)
|
||||
|
||||
def __hash__(self):
|
||||
return hash(int(self.epoch))
|
||||
@@ -244,7 +244,7 @@ class MayaDT(object):
|
||||
|
||||
@property
|
||||
def epoch(self):
|
||||
return self._epoch
|
||||
return int(self._epoch)
|
||||
|
||||
# Human Slang Extras
|
||||
# ------------------
|
||||
@@ -41,7 +41,7 @@ setup(
|
||||
author='Kenneth Reitz',
|
||||
author_email='me@kennethreitz.org',
|
||||
url='https://github.com/kennethreitz/maya',
|
||||
py_modules=['maya'],
|
||||
packages=['maya'],
|
||||
install_requires=required,
|
||||
license='MIT',
|
||||
classifiers=(
|
||||
|
||||
@@ -5,7 +5,7 @@ import pytest
|
||||
import pytz
|
||||
|
||||
import maya
|
||||
from compat import cmp
|
||||
from maya.compat import cmp
|
||||
|
||||
Los_Angeles = pytz.timezone('America/Los_Angeles')
|
||||
New_York = pytz.timezone('America/New_York')
|
||||
|
||||
Reference in New Issue
Block a user