Skip to content

Commit

Permalink
Organize imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
mherrmann committed Dec 2, 2015
1 parent 269dd6a commit 9e4e5ef
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pypxlib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import datetime

from collections import OrderedDict
from datetime import date, time
from pypxlib.pxlib_ctypes import *

import atexit
Expand Down Expand Up @@ -156,7 +155,7 @@ def _deserialize(self, pxval_value):
PX_SdnToGregorian(
days_since_jan_0_0000, byref(year), byref(month), byref(day)
)
return datetime.date(year.value, month.value, day.value)
return date(year.value, month.value, day.value)
def _serialize_to(self, value, pxval_value):
sdn = PX_GregorianToSdn(value.year, value.month, value.day)
pxval_value.lval = sdn - 1721425
Expand Down Expand Up @@ -198,7 +197,7 @@ def _deserialize_ms(cls, ms_since_midnight):
minutes_since_midnight = seconds_since_midnight // 60
minutes = minutes_since_midnight % 60
hours = minutes_since_midnight // 60
return datetime.time(hours, minutes, seconds, ms * 1000)
return time(hours, minutes, seconds, ms * 1000)
@classmethod
def _serialize_to(cls, value, pxval_value):
pxval_value.lval = cls._serialize_ms(value)
Expand Down

0 comments on commit 9e4e5ef

Please sign in to comment.