Changeset 795
- Timestamp:
- 03/06/07 18:37:27 (1 year ago)
- Files:
-
- pg8000/trunk/pg8000.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pg8000/trunk/pg8000.py
r794 r795 1 1 import socket 2 2 import struct 3 import datetime 3 4 import md5 4 5 … … 396 397 397 398 def boolout(v): 398 if v: 399 return 't' 400 else: 401 return 'f' 399 # imp req. 400 pass 402 401 403 402 def int4in(data, description): … … 405 404 406 405 def int4out(v): 407 return str(v) 406 # imp req. 407 pass 408 409 def timestamp_in(data, description): 410 year = int(data[0:4]) 411 month = int(data[5:7]) 412 day = int(data[8:10]) 413 hour = int(data[11:13]) 414 minute = int(data[14:16]) 415 sec = int(data[17:19]) 416 return datetime.datetime(year, month, day, hour, minute, sec) 417 418 def timestamp_out(v): 419 # imp req. 420 pass 408 421 409 422 t_formats_text = { 410 423 16: (boolin, boolout), 411 424 23: (int4in, int4out), 425 1114: (timestamp_in, timestamp_out), 412 426 } 413 427
