本文整理汇总了Python中pycalendar.datetime.PyCalendarDateTime.offsetYear方法的典型用法代码示例。如果您正苦于以下问题:Python PyCalendarDateTime.offsetYear方法的具体用法?Python PyCalendarDateTime.offsetYear怎么用?Python PyCalendarDateTime.offsetYear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pycalendar.datetime.PyCalendarDateTime
的用法示例。
在下文中一共展示了PyCalendarDateTime.offsetYear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: doCapabilities
# 需要导入模块: from pycalendar.datetime import PyCalendarDateTime [as 别名]
# 或者: from pycalendar.datetime.PyCalendarDateTime import offsetYear [as 别名]
def doCapabilities(self, request):
"""
Return a list of all timezones known to the server.
"""
# Determine min/max date-time for iSchedule
now = PyCalendarDateTime.getNowUTC()
minDateTime = PyCalendarDateTime(now.getYear(), 1, 1, 0, 0, 0, PyCalendarTimezone(utc=True))
minDateTime.offsetYear(-1)
maxDateTime = PyCalendarDateTime(now.getYear(), 1, 1, 0, 0, 0, PyCalendarTimezone(utc=True))
maxDateTime.offsetYear(10)
result = ischedulexml.QueryResult(
ischedulexml.Capabilities(
ischedulexml.Version.fromString(config.Scheduling.iSchedule.SerialNumber),
ischedulexml.Versions(
ischedulexml.Version.fromString("1.0"),
),
ischedulexml.SchedulingMessages(
ischedulexml.Component(
ischedulexml.Method(name="REQUEST"),
ischedulexml.Method(name="CANCEL"),
ischedulexml.Method(name="REPLY"),
name="VEVENT"
),
ischedulexml.Component(
ischedulexml.Method(name="REQUEST"),
ischedulexml.Method(name="CANCEL"),
ischedulexml.Method(name="REPLY"),
name="VTODO"
),
ischedulexml.Component(
ischedulexml.Method(name="REQUEST"),
name="VFREEBUSY"
),
),
ischedulexml.CalendarDataTypes(
ischedulexml.CalendarDataType(**{
"content-type": "text/calendar",
"version": "2.0",
}),
),
ischedulexml.Attachments(
ischedulexml.External(),
),
ischedulexml.MaxContentLength.fromString(config.MaxResourceSize),
ischedulexml.MinDateTime.fromString(minDateTime.getText()),
ischedulexml.MaxDateTime.fromString(maxDateTime.getText()),
ischedulexml.MaxInstances.fromString(config.MaxAllowedInstances),
ischedulexml.MaxRecipients.fromString(config.MaxAttendeesPerInstance),
ischedulexml.Administrator.fromString(request.unparseURL(params="", querystring="", fragment="")),
),
)
response = XMLResponse(responsecode.OK, result)
response.headers.addRawHeader(ISCHEDULE_CAPABILITIES, str(config.Scheduling.iSchedule.SerialNumber))
return response