Home | History | Annotate | Download | only in Modules

Lines Matching refs:PyObject

605 static PyObject *
608 PyObject *self;
610 self = (PyObject *)
615 return (PyObject *)PyErr_NoMemory();
620 static PyObject *
623 PyObject *self;
625 self = (PyObject *)
630 return (PyObject *)PyErr_NoMemory();
655 static PyObject *
663 return (PyObject *) self;
670 static PyObject *
672 int second, int usecond, PyObject *tzinfo, PyTypeObject *type)
690 return (PyObject *)self;
698 static PyObject *
700 PyObject *tzinfo, PyTypeObject *type)
718 return (PyObject *)self;
730 static PyObject *
751 return (PyObject *) self;
765 check_tzinfo_subclass(PyObject *p)
779 static PyObject *
780 call_tzinfo_method(PyObject *tzinfo, char *methname, PyObject *tzinfoarg)
782 PyObject *result;
799 static PyObject *
800 get_tzinfo_member(PyObject *self)
802 PyObject *tzinfo = NULL;
821 call_utc_tzinfo_method(PyObject *tzinfo, char *name, PyObject *tzinfoarg,
824 PyObject *u;
886 call_utcoffset(PyObject *tzinfo, PyObject *tzinfoarg, int *none)
893 static PyObject *
894 offset_as_timedelta(PyObject *tzinfo, char *name, PyObject *tzinfoarg) {
895 PyObject *result;
927 call_dst(PyObject *tzinfo, PyObject *tzinfoarg, int *none)
937 static PyObject *
938 call_tzname(PyObject *tzinfo, PyObject *tzinfoarg)
940 PyObject *result;
991 classify_utcoffset(PyObject *op, PyObject *tzinfoarg, int *offset)
994 PyObject *tzinfo;
1022 classify_two_utcoffsets(PyObject *o1, int *offset1, naivety *n1,
1023 PyObject *tzinfoarg1,
1024 PyObject *o2, int *offset2, naivety *n2,
1025 PyObject *tzinfoarg2)
1047 static PyObject *
1048 append_keyword_tzinfo(PyObject *repr, PyObject *tzinfo)
1050 PyObject *temp;
1080 static PyObject *
1113 PyObject *tzinfo, PyObject *tzinfoarg)
1140 static PyObject *
1141 make_freplacement(PyObject *object)
1161 static PyObject *
1162 wrap_strftime(PyObject *object, const char *format, size_t format_len,
1163 PyObject *timetuple, PyObject *tzinfoarg)
1165 PyObject *result = NULL; /* guilty until proved innocent */
1167 PyObject *zreplacement = NULL; /* py string, replacement for %z */
1168 PyObject *Zreplacement = NULL; /* py string, replacement for %Z */
1169 PyObject *freplacement = NULL; /* py string, replacement for %f */
1174 PyObject *newfmt = NULL; /* py string, the output format */
1196 PyObject *pyyear = PySequence_GetItem(timetuple, 0);
1242 PyObject *tzinfo = get_tzinfo_member(object);
1265 PyObject *tzinfo = get_tzinfo_member(object);
1269 PyObject *temp;
1346 PyObject *time = PyImport_ImportModuleNoBlock("time");
1396 static PyObject *
1399 PyObject *result = NULL;
1400 PyObject *time = PyImport_ImportModuleNoBlock("time");
1412 static PyObject *
1415 PyObject *time;
1416 PyObject *result = NULL;
1440 static PyObject *
1443 PyObject *result;
1463 static PyObject *
1464 cmperror(PyObject *a, PyObject *b)
1477 static PyObject *us_per_us = NULL; /* 1 */
1478 static PyObject *us_per_ms = NULL; /* 1000 */
1479 static PyObject *us_per_second = NULL; /* 1000000 */
1480 static PyObject
1481 static PyObject *us_per_hour = NULL; /* 1e6 * 3600 as Python long */
1482 static PyObject *us_per_day = NULL; /* 1e6 * 3600 * 24 as Python long */
1483 static PyObject *us_per_week = NULL; /* 1e6*3600*24*7 as Python long */
1484 static PyObject *seconds_per_day = NULL; /* 3600*24 as Python int */
1500 static PyObject *
1503 PyObject *x1 = NULL;
1504 PyObject *x2 = NULL;
1505 PyObject *x3 = NULL;
1506 PyObject *result = NULL;
1550 static PyObject *
1551 microseconds_to_delta_ex(PyObject *pyus, PyTypeObject *type)
1558 PyObject *tuple = NULL;
1559 PyObject *num = NULL;
1560 PyObject *result = NULL;
1632 static PyObject *
1633 multiply_int_timedelta(PyObject *intobj, PyDateTime_Delta *delta)
1635 PyObject *pyus_in;
1636 PyObject *pyus_out;
1637 PyObject *result;
1653 static PyObject *
1654 divide_timedelta_int(PyDateTime_Delta *delta, PyObject *intobj)
1656 PyObject *pyus_in;
1657 PyObject *pyus_out;
1658 PyObject *result;
1674 static PyObject *
1675 delta_add(PyObject *left, PyObject *right)
1677 PyObject *result = Py_NotImplemented;
1696 static PyObject *
1705 static PyObject *
1717 static PyObject *
1720 PyObject *result;
1733 static PyObject *
1734 delta_subtract(PyObject *left, PyObject *right)
1736 PyObject *result = Py_NotImplemented;
1759 static PyObject *
1760 delta_richcompare(PyDateTime_Delta *self, PyObject *other, int op)
1777 return cmperror((PyObject *)self, other);
1782 static PyObject *delta_getstate(PyDateTime_Delta *self);
1788 PyObject *temp = delta_getstate(self);
1797 static PyObject *
1798 delta_multiply(PyObject *left, PyObject *right)
1800 PyObject *result = Py_NotImplemented;
1817 static PyObject *
1818 delta_divide(PyObject *left, PyObject *right)
1820 PyObject *result = Py_NotImplemented;
1844 static PyObject *
1845 accum(const char* tag, PyObject *sofar, PyObject *num, PyObject *factor,
1848 PyObject *prod;
1849 PyObject *sum;
1866 PyObject *x;
1867 PyObject *y;
1928 static PyObject *
1929 delta_new(PyTypeObject *type, PyObject *args, PyObject *kw)
1931 PyObject *self = NULL;
1934 PyObject *day = NULL;
1935 PyObject *second = NULL;
1936 PyObject *us = NULL;
1937 PyObject *ms = NULL;
1938 PyObject *minute = NULL;
1939 PyObject *hour = NULL;
1940 PyObject *week = NULL;
1942 PyObject *x = NULL; /* running sum of microseconds */
1943 PyObject *y = NULL; /* temp sum of microseconds */
1997 PyObject *temp = PyLong_FromLong(round_to_long(leftover_us));
2023 static PyObject *
2043 static PyObject *
2092 static PyObject *
2100 static PyObject *
2101 delta_total_seconds(PyObject *self)
2103 PyObject *total_seconds;
2104 PyObject *total_microseconds;
2105 PyObject *one_million;
2124 static PyObject *
2248 static PyObject *
2254 static PyObject *
2260 static PyObject *
2277 static PyObject *
2278 date_new(PyTypeObject *type, PyObject *args, PyObject *kw)
2280 PyObject *self = NULL;
2281 PyObject *state;
2300 return (PyObject *)me;
2313 static PyObject *
2314 date_local_from_time_t(PyObject *cls, double ts)
2318 PyObject *result = NULL;
2341 static PyObject *
2342 date_today(PyObject *cls, PyObject *dummy)
2344 PyObject *time;
2345 PyObject *result;
2363 static PyObject *
2364 date_fromtimestamp(PyObject *cls, PyObject *args)
2367 PyObject *result = NULL;
2377 static PyObject *
2378 date_fromordinal(PyObject *cls, PyObject *args)
2380 PyObject *result = NULL;
2407 static PyObject *
2410 PyObject *result = NULL;
2422 static PyObject *
2423 date_add(PyObject *left, PyObject *right)
2451 static PyObject *
2452 date_subtract(PyObject *left, PyObject *right)
2483 static PyObject *
2497 static PyObject *
2507 static PyObject *
2510 return PyObject_CallMethod((PyObject *)self, "isoformat", "()");
2514 static PyObject *
2520 static PyObject *
2521 date_strftime(PyDateTime_Date *self, PyObject *args, PyObject *kw)
2526 PyObject *result;
2527 PyObject *tuple;
2536 tuple = PyObject_CallMethod((PyObject *)self, "timetuple", "()");
2539 result = wrap_strftime((PyObject *)self, format, format_len, tuple,
2540 (PyObject *)self);
2545 static PyObject *
2546 date_format(PyDateTime_Date *self, PyObject *args)
2548 PyObject *format;
2557 return PyObject_Str((PyObject *)self);
2561 return PyObject_Unicode((PyObject *)self);
2568 return PyObject_CallMethod((PyObject *)self, "strftime", "O", format);
2573 static PyObject *
2581 static PyObject *
2609 static PyObject *
2610 date_richcompare(PyDateTime_Date *self, PyObject *other, int op)
2627 return cmperror((PyObject *)self, other);
2632 static PyObject *
2641 static PyObject *
2642 date_replace(PyDateTime_Date *self, PyObject *args, PyObject *kw)
2644 PyObject *clone;
2645 PyObject *tuple;
2661 static PyObject *date_getstate(PyDateTime_Date *self);
2667 PyObject *temp = date_getstate(self);
2676 static PyObject *
2683 static PyObject *
2694 static PyObject *
2703 static PyObject *
2704 date_reduce(PyDateTime_Date *self, PyObject *arg)
2846 static PyObject *
2857 static PyObject *
2858 tzinfo_tzname(PyDateTime_TZInfo *self, PyObject *dt)
2863 static PyObject *
2864 tzinfo_utcoffset(PyDateTime_TZInfo *self, PyObject *dt)
2869 static PyObject *
2870 tzinfo_dst(PyDateTime_TZInfo *self, PyObject *dt)
2875 static PyObject *
2880 PyObject *result;
2890 if (! HASTZINFO(dt) || dt->tzinfo != (PyObject *)self) {
2896 off = call_utcoffset(dt->tzinfo, (PyObject *)dt, &none);
2905 dst = call_dst(dt->tzinfo, (PyObject *)dt, &none);
2962 static PyObject *
2963 tzinfo_reduce(PyObject *self)
2965 PyObject *args, *state, *tmp;
2966 PyObject *getinitargs, *getstate;
2998 PyObject **dictptr;
3092 static PyObject *
3098 static PyObject *
3105 static PyObject *
3111 static PyObject *
3117 static PyObject *
3120 PyObject *result = HASTZINFO(self) ? self->tzinfo : Py_None;
3141 static PyObject *
3142 time_new(PyTypeObject *type, PyObject *args, PyObject *kw)
3144 PyObject *self = NULL;
3145 PyObject *state;
3150 PyObject *tzinfo = Py_None;
3183 return (PyObject *)me;
3209 Py_TYPE(self)->tp_free((PyObject *)self);
3217 static PyObject *
3218 time_utcoffset(PyDateTime_Time *self, PyObject *unused) {
3223 static PyObject *
3224 time_dst(PyDateTime_Time *self, PyObject *unused) {
3229 static PyObject *
3230 time_tzname(PyDateTime_Time *self, PyObject *unused) {
3239 static PyObject *
3248 PyObject *result = NULL;
3265 static PyObject *
3268 return PyObject_CallMethod((PyObject *)self, "isoformat", "()");
3271 static PyObject *
3272 time_isoformat(PyDateTime_Time *self, PyObject *unused)
3275 PyObject *result;
3300 static PyObject *
3301 time_strftime(PyDateTime_Time *self, PyObject *args, PyObject *kw)
3303 PyObject *result;
3304 PyObject *tuple;
3326 result = wrap_strftime((PyObject *)self, format, format_len, tuple,
3340 static PyObject *
3341 time_richcompare(PyDateTime_Time *self, PyObject *other, int op)
3349 PyObject *result = op == Py_EQ ? Py_False : Py_True;
3354 return cmperror((PyObject *)self, other);
3356 if (classify_two_utcoffsets((PyObject *)self, &offset1, &n1, Py_None,
3401 PyObject *temp;
3403 n = classify_utcoffset((PyObject *)self, Py_None, &offset);
3441 static PyObject *
3442 time_replace(PyDateTime_Time *self, PyObject *args, PyObject *kw)
3444 PyObject *clone;
3445 PyObject *tuple;
3450 PyObject *tzinfo = HASTZINFO(self) ? self->tzinfo : Py_None;
3492 static PyObject *
3495 PyObject *basestate;
3496 PyObject *result = NULL;
3510 static PyObject *
3511 time_reduce(PyDateTime_Time *self, PyObject *arg)
3618 static PyObject *
3624 static PyObject *
3630 static PyObject *
3636 static PyObject *
3642 static PyObject *
3645 PyObject *result = HASTZINFO(self) ? self->tzinfo : Py_None;
3668 static PyObject *
3669 datetime_new(PyTypeObject *type, PyObject *args, PyObject *kw)
3671 PyObject *self = NULL;
3672 PyObject *state;
3680 PyObject *tzinfo = Py_None;
3713 return (PyObject *)me;
3739 static PyObject *
3740 datetime_from_timet_and_us(PyObject *cls, TM_FUNC f, time_t timet, int us,
3741 PyObject *tzinfo)
3744 PyObject *result = NULL;
3780 static PyObject *
3781 datetime_from_timestamp(PyObject *cls, TM_FUNC f, double timestamp,
3782 PyObject *tzinfo)
3813 static PyObject *
3814 datetime_best_possible(PyObject *cls, TM_FUNC f, PyObject *tzinfo)
3835 PyObject *time;
3852 static PyObject *
3853 datetime_now(PyObject *cls, PyObject *args, PyObject *kw)
3855 PyObject *self;
3856 PyObject *tzinfo = Py_None;
3870 PyObject *temp = self;
3880 static PyObject *
3881 datetime_utcnow(PyObject *cls, PyObject *dummy)
3887 static PyObject *
3888 datetime_fromtimestamp(PyObject *cls, PyObject *args, PyObject *kw)
3890 PyObject *self;
3892 PyObject *tzinfo = Py_None;
3907 PyObject *temp = self;
3915 static PyObject *
3916 datetime_utcfromtimestamp(PyObject *cls, PyObject *args)
3919 PyObject *result = NULL;
3928 static PyObject *
3929 datetime_strptime(PyObject *cls, PyObject *args)
3931 static PyObject *module = NULL;
3932 PyObject *result = NULL, *obj, *st = NULL, *frac = NULL;
3960 PyObject *p = PySequence_GetItem(st, i);
3998 PyObject *
3999 datetime_combine(PyObject *cls, PyObject *args, PyObject *kw)
4002 PyObject *date;
4003 PyObject *time;
4004 PyObject *result = NULL;
4009 PyObject *tzinfo = Py_None;
4036 Py_TYPE(self)->tp_free((PyObject *)self);
4044 static PyObject *
4045 datetime_utcoffset(PyDateTime_DateTime *self, PyObject *unused) {
4047 "utcoffset", (PyObject *)self);
4050 static PyObject *
4051 datetime_dst(PyDateTime_DateTime *self, PyObject *unused) {
4053 "dst", (PyObject *)self);
4056 static PyObject *
4057 datetime_tzname(PyDateTime_DateTime *self, PyObject *unused) {
4059 (PyObject *)self);
4069 static PyObject *
4095 static PyObject *
4096 datetime_add(PyObject *left, PyObject *right)
4117 static PyObject *
4118 datetime_subtract(PyObject *left, PyObject *right)
4120 PyObject *result = Py_NotImplemented;
4181 static PyObject *
4186 PyObject *baserepr;
4218 static PyObject *
4221 return PyObject_CallMethod((PyObject *)self, "isoformat", "(s)", " ");
4224 static PyObject *
4225 datetime_isoformat(PyDateTime_DateTime *self, PyObject *args, PyObject *kw)
4231 PyObject *result;
4246 (PyObject *)self) < 0) {
4254 static PyObject *
4269 static PyObject *
4270 datetime_richcompare(PyDateTime_DateTime *self, PyObject *other, int op)
4293 PyObject *result = op == Py_EQ ? Py_False : Py_True;
4298 return cmperror((PyObject *)self, other);
4301 if (classify_two_utcoffsets((PyObject *)self, &offset1, &n1,
4302 (PyObject *)self,
4321 delta = (PyDateTime_Delta *)datetime_subtract((PyObject *)self,
4346 PyObject *temp;
4348 n = classify_utcoffset((PyObject *)self, (PyObject *)self,
4384 static PyObject *
4385 datetime_replace(PyDateTime_DateTime *self, PyObject *args, PyObject *kw)
4387 PyObject *clone;
4388 PyObject *tuple;
4396 PyObject *tzinfo = HASTZINFO(self) ? self->tzinfo : Py_None;
4411 static PyObject *
4412 datetime_astimezone(PyDateTime_DateTime *self, PyObject *args, PyObject *kw)
4415 PyObject *result;
4418 PyObject *tzinfo;
4431 return (PyObject *)self;
4435 offset = call_utcoffset(self->tzinfo, (PyObject *)self, &none);
4457 PyObject *temp = result;
4470 static PyObject *
4478 dstflag = call_dst(self->tzinfo, (PyObject *)self, &none);
4497 static PyObject *
4505 static PyObject *
4515 static PyObject *
4525 static PyObject *
4540 offset = call_utcoffset(self->tzinfo, (PyObject *)self, &none);
4573 static PyObject *
4576 PyObject *basestate;
4577 PyObject *result = NULL;
4591 static PyObject *
4592 datetime_reduce(PyDateTime_DateTime *self, PyObject *arg)
4767 PyObject *m; /* a module object */
4768 PyObject *d; /* its dict */
4769 PyObject *x;
4864 PyModule_AddObject(m, "date", (PyObject *) &PyDateTime_DateType);
4868 (PyObject *)&PyDateTime_DateTimeType);
4871 PyModule_AddObject(m, "time", (PyObject *) &PyDateTime_TimeType);
4874 PyModule_AddObject(m, "timedelta", (PyObject *) &PyDateTime_DeltaType);
4877 PyModule_AddObject(m, "tzinfo", (PyObject *) &PyDateTime_TZInfoType);