From e851c02d2747be0acc336bc278da9e0460b75738 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 28 Jan 2009 20:49:26 -0400 Subject: Unit test for Python are now auto-generated from the C++ tests. --- python/py_times.cc | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'python/py_times.cc') diff --git a/python/py_times.cc b/python/py_times.cc index 0fc62941..23532cc2 100644 --- a/python/py_times.cc +++ b/python/py_times.cc @@ -32,12 +32,6 @@ #include "pyinterp.h" #include "pyutils.h" -#include -#include -#include -#include - -#include #include // jww (2007-05-04): Convert time duration objects to PyDelta @@ -121,12 +115,26 @@ struct datetime_from_python typedef register_python_conversion datetime_python_conversion; +datetime_t py_parse_datetime(const string& str) { + return parse_datetime(str); +} + +date_t py_parse_date(const string& str) { + return parse_date(str); +} + void export_times() { - date_python_conversion(); datetime_python_conversion(); + date_python_conversion(); register_optional_to_python(); + register_optional_to_python(); + + scope().attr("parse_datetime") = &py_parse_datetime; + scope().attr("parse_date") = &py_parse_date; + scope().attr("current_time") = current_time; + scope().attr("current_date") = current_date; } } // namespace ledger -- cgit v1.2.3