projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a bunch of __init__.py's; maybe this will fix import
[python_utils.git]
/
type
/
centcount.py
diff --git
a/type/centcount.py
b/type/centcount.py
index 13f14b7f835d2e15679ea3bddd9499398056448e..2cb99e029ede3a72f3ccb83e79fbfaf62b6cbb15 100644
(file)
--- a/
type/centcount.py
+++ b/
type/centcount.py
@@
-50,7
+50,8
@@
class CentCount(object):
if isinstance(other, CentCount):
if self.currency == other.currency:
return CentCount(
if isinstance(other, CentCount):
if self.currency == other.currency:
return CentCount(
- centcount=self.centcount + other.centcount, currency=self.currency
+ centcount=self.centcount + other.centcount,
+ currency=self.currency,
)
else:
raise TypeError('Incompatible currencies in add expression')
)
else:
raise TypeError('Incompatible currencies in add expression')
@@
-64,7
+65,8
@@
class CentCount(object):
if isinstance(other, CentCount):
if self.currency == other.currency:
return CentCount(
if isinstance(other, CentCount):
if self.currency == other.currency:
return CentCount(
- centcount=self.centcount - other.centcount, currency=self.currency
+ centcount=self.centcount - other.centcount,
+ currency=self.currency,
)
else:
raise TypeError('Incompatible currencies in add expression')
)
else:
raise TypeError('Incompatible currencies in add expression')
@@
-79,7
+81,8
@@
class CentCount(object):
raise TypeError('can not multiply monetary quantities')
else:
return CentCount(
raise TypeError('can not multiply monetary quantities')
else:
return CentCount(
- centcount=int(self.centcount * float(other)), currency=self.currency
+ centcount=int(self.centcount * float(other)),
+ currency=self.currency,
)
def __truediv__(self, other):
)
def __truediv__(self, other):
@@
-113,7
+116,8
@@
class CentCount(object):
if isinstance(other, CentCount):
if self.currency == other.currency:
return CentCount(
if isinstance(other, CentCount):
if self.currency == other.currency:
return CentCount(
- centcount=other.centcount - self.centcount, currency=self.currency
+ centcount=other.centcount - self.centcount,
+ currency=self.currency,
)
else:
raise TypeError('Incompatible currencies in sub expression')
)
else:
raise TypeError('Incompatible currencies in sub expression')
@@
-122,7
+126,8
@@
class CentCount(object):
raise TypeError('In strict_mode only two moneys can be added')
else:
return CentCount(
raise TypeError('In strict_mode only two moneys can be added')
else:
return CentCount(
- centcount=int(other) - self.centcount, currency=self.currency
+ centcount=int(other) - self.centcount,
+ currency=self.currency,
)
__rmul__ = __mul__
)
__rmul__ = __mul__