Skip to content

Commit

Permalink
Make some var names shorter for 79 char line length.
Browse files Browse the repository at this point in the history
  • Loading branch information
coleifer committed May 10, 2024
1 parent ec236ac commit 41bc6eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions peewee.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,14 @@ def datetime_adapter(d): return d.isoformat(' ')
def convert_date(d): return datetime.date(*map(int, d.split(b'-')))
def convert_timestamp(t):
date, time = t.split(b' ')
year, month, day = map(int, date.split(b'-'))
y, m, d = map(int, date.split(b'-'))
t_full = time.split(b'.')
hour, minute, second = map(int, t_full[0].split(b':'))
if len(t_full) == 2:
usec = int('{:0<6.6}'.format(t_full[1].decode()))
else:
usec = 0
return datetime.datetime(year, month, day, hour, minute, second, usec)
return datetime.datetime(y, m, d, hour, minute, second, usec)
sqlite3.register_adapter(datetime.datetime, datetime_adapter)
sqlite3.register_converter('date', convert_date)
sqlite3.register_converter('timestamp', convert_timestamp)
Expand Down

0 comments on commit 41bc6eb

Please sign in to comment.