Skip to content

Commit 788ff4a

Browse files
committed
another push just to confirm before final reset and push for review
1 parent 83aae13 commit 788ff4a

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

pynuodb/connection.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ def reset():
7272
encodedsession.EncodedSession.reset()
7373

7474

75-
76-
7775
class Connection(object):
7876
"""An established SQL connection with a NuoDB database.
7977

pynuodb/datatype.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232

3333
import sys
3434
import decimal
35-
from datetime import datetime as Timestamp, date as Date, time as Time, timedelta as TimeDelta
35+
from datetime import datetime as Timestamp, date as Date, time as Time
36+
from datetime import timedelta as TimeDelta
3637
from datetime import tzinfo # pylint: disable=unused-import
3738

3839
try:
@@ -52,7 +53,7 @@
5253
UTC = timezone.utc
5354

5455
def utc_TimeStamp(year, month, day, hour=0, minute=0, second=0, microsecond=0):
55-
# type: (int,int,int,int,int,int,int) -> Timestamp
56+
# type: (int, int, int, int, int, int, int) -> Timestamp
5657
"""
5758
timezone aware datetime with UTC timezone.
5859
"""
@@ -69,7 +70,7 @@ def timezone_aware(tstamp, tz_info):
6970
from pytz import utc as UTC
7071

7172
def utc_TimeStamp(year, month, day, hour=0, minute=0, second=0, microsecond=0):
72-
# type: (int,int,int,int,int,int,int) -> Timestamp
73+
# type: (int, int, int, int, int, int, int) -> Timestamp
7374
"""
7475
timezone aware datetime with UTC timezone.
7576
"""
@@ -128,7 +129,7 @@ def DateFromTicks(ticks):
128129

129130

130131
def TimeFromTicks(ticks, micro=0, zoneinfo=localZoneInfo):
131-
# type: (int,int, tzinfo) -> Time
132+
# type: (int, int, tzinfo) -> Time
132133
"""Convert ticks to a Time object."""
133134

134135
# NuoDB release <= 7.0, it's possible that ticks is
@@ -193,7 +194,7 @@ def DateToTicks(value):
193194

194195

195196
def _packtime(seconds, microseconds):
196-
# type: (int,int) -> Tuple[int,int]
197+
# type: (int, int) -> Tuple[int,int]
197198
if microseconds:
198199
ndiv = 0
199200
shiftr = 1000000
@@ -241,7 +242,7 @@ def TimeToTicks(value, zoneinfo=localZoneInfo):
241242
return (int(time_dec * 10**abs(exponent)), abs(exponent))
242243

243244
def TimestampToTicks(value, zoneinfo=localZoneInfo):
244-
# type: (Timestamp,tzinfo) -> Tuple[int, int]
245+
# type: (Timestamp, tzinfo) -> Tuple[int, int]
245246
"""Convert a Timestamp object to ticks."""
246247
# if naive timezone then leave date/time but change tzinfo to
247248
# be connection's timezone.

pynuodb/encodedsession.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ def getScaledDate(self):
10871087
if code >= protocol.SCALEDDATELEN1 and code <= protocol.SCALEDDATELEN8:
10881088
scale = crypt.fromByteString(self._takeBytes(1))
10891089
date = crypt.fromSignedByteString(self._takeBytes(code - protocol.SCALEDDATELEN0))
1090-
return datatype.DateFromTicks(date // (10**scale))
1090+
return datatype.DateFromTicks(date // (10 ** scale))
10911091

10921092
raise DataError('Not a scaled date')
10931093

0 commit comments

Comments
 (0)