Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(473)  |  Call(293)  |  Derive(0)  |  Import(180)

src/w/m/wm.sampledata-0.2.2/wm/sampledata/utils.py   wm.sampledata(Download)
from zExceptions import BadRequest
from DateTime.DateTime import DateTime
from zope.component._api import getUtility, getMultiAdapter, queryMultiAdapter
from plone.portlets.interfaces import IPortletManager, IPortletAssignmentMapping,\
    ILocalPortletAssignmentManager, IPortletAssignmentSettings
def todayPlusDays(nrDays = 0, zopeDateTime=False):
    today = datetime.date.today()
    date =  today + datetime.timedelta(days = nrDays)
    if zopeDateTime:
        return DateTime(date.isoformat())

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/browser/datecomponents.py   Products.Archetypes(Download)
from DateTime.DateTime import DateTime
from DateTime.DateTime import DateTimeError
from Products.CMFCore.utils import getToolByName
from Products.Five.browser import BrowserView
from time import localtime
 
CEILING = DateTime(9999, 0)
FLOOR = DateTime(1970, 0)
PLONE_CEILING = DateTime(2021, 0)  # 2020-12-31
def english_month_names():
    names = {}
    for x in range(1, 13):
        faux = DateTime(2004, x, 1)
        names[x] = faux.Month()

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/browser/datecomponents.py   Products.Archetypes(Download)
from DateTime.DateTime import DateTime
from DateTime.DateTime import DateTimeError
from Products.CMFCore.utils import getToolByName
from Products.Five.browser import BrowserView
from time import localtime
 
CEILING = DateTime(9999, 0)
FLOOR = DateTime(1970, 0)
PLONE_CEILING = DateTime(2021, 0)  # 2020-12-31
def english_month_names():
    names = {}
    for x in range(1, 13):
        faux = DateTime(2004, x, 1)
        names[x] = faux.Month()

src/p/r/Products.CMFCalendar-2.3.0-beta/Products/CMFCalendar/CalendarTool.py   Products.CMFCalendar(Download)
from AccessControl.SecurityInfo import ClassSecurityInfo
from App.class_init import InitializeClass
from DateTime.DateTime import DateTime
from OFS.SimpleItem import SimpleItem
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
        zone = first_date.localZone()
        after_midnight_str = '%d-%02d-%02d 00:01:00 %s' % (year,month,day,zone)
        after_midnight = DateTime(after_midnight_str)
 
        # Get all events that Start on this day
            month -= 1
 
        return DateTime(year, month, 1)
 
    security.declarePublic('getNextMonth')
            month += 1
 
        return DateTime(year, month, 1)
 
    security.declarePublic('getBeginAndEndTimes')
        year = int(year)
 
        begin = DateTime('%d/%02d/%02d 00:00:00' % (year, month, day))
        end = DateTime('%d/%02d/%02d 23:59:59' % (year, month, day))
 

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/ExtensibleMetadata.py   Products.Archetypes(Download)
from AccessControl import ClassSecurityInfo
from AccessControl import Unauthorized
from DateTime.DateTime import DateTime
from App.class_init import InitializeClass
from App.special_dtml import DTMLFile
_zone = DateTime().timezone()
 
FLOOR_DATE = DateTime(1000, 1)  # always effective
CEILING_DATE = DateTime(2500, 0)  # never expires
 
    def contentExpired(self, date=None):
        """ Is the date after resource's expiration """
        if not date:
            date = DateTime()
        expires = self.getField('expirationDate').get(self)
        if not expires:
            expires = CEILING_DATE

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/ExtensibleMetadata.py   Products.Archetypes(Download)
from AccessControl import ClassSecurityInfo
from AccessControl import Unauthorized
from DateTime.DateTime import DateTime
from App.class_init import InitializeClass
from App.special_dtml import DTMLFile
_zone = DateTime().timezone()
 
FLOOR_DATE = DateTime(1000, 1)  # always effective
CEILING_DATE = DateTime(2500, 0)  # never expires
 
    def contentExpired(self, date=None):
        """ Is the date after resource's expiration """
        if not date:
            date = DateTime()
        expires = self.getField('expirationDate').get(self)
        if not expires:
            expires = CEILING_DATE

src/p/r/Products.CMFDefault-2.3.0-beta2/Products/CMFDefault/DublinCore.py   Products.CMFDefault(Download)
from App.class_init import InitializeClass
from App.special_dtml import DTMLFile
from DateTime.DateTime import DateTime
from OFS.PropertyManager import PropertyManager
from zope.component import queryUtility
                , rights=''
                ):
        now = DateTime()
        self.creation_date = now
        self.modification_date = now
        """
        if modification_date is None:
            self.modification_date = DateTime()
        else:
            self.modification_date = self._datify(modification_date)
        return self.Format()
 
    __FLOOR_DATE = DateTime( 1970, 0 ) # always effective
 
    security.declareProtected(View, 'isEffective')
        return date is None and self.__FLOOR_DATE or date
 
    __CEILING_DATE = DateTime( 2500, 0 ) # never expires
 
    security.declareProtected(View, 'expires')

src/p/r/Products.CMFCalendar-2.3.0-beta/Products/CMFCalendar/browser/calendartool.py   Products.CMFCalendar(Download)
"""
 
from DateTime.DateTime import DateTime
from zope.component import getUtility
 
        day = self.viewDay()
        event_start = event_brain.getObject().start()
        first_date = DateTime(day.Date() + " 00:00:00")
 
        if event_start < first_date:
        day = self.viewDay()
        event_end = event_brain.getObject().end()
        last_date = DateTime(day.Date() + " 23:59:59")
 
        if event_end > last_date:
        date = self.request.get('date', None) or DateTime().aCommon()[:12]
 
        return DateTime(date)
 
    # interface
    def getMonthAndYear(self):
        """ Retrieve month/year tuple
        """
        caltool = getUtility(ICalendarTool)
        current = DateTime()

src/p/r/Products.CMFCalendar-2.3.0-beta/Products/CMFCalendar/Event.py   Products.CMFCalendar(Download)
from AccessControl.SecurityInfo import ClassSecurityInfo
from App.class_init import InitializeClass
from DateTime.DateTime import DateTime
import transaction
from zope.component.factory import Factory
        if start_date is None:
            # Round time to a value that exists in buildTimes().
            dt = DateTime((int(DateTime()) / 1800 + 1) * 1800)
            # Parse time the same way as in edit(). The result is offset-naive.
            start_date = DateTime(str(dt).rsplit(' ', 1)[0])
        elif not isinstance( attrib, DateTime ):
            if attrib is not None:
                attrib = DateTime( attrib )
        return attrib
 

src/v/s/vs.event-0.3.1/vs/event/content/event_util.py   vs.event(Download)
 
from AccessControl import Unauthorized
from DateTime.DateTime import DateTime
from Products.ATContentTypes.lib.calendarsupport import rfc2445dt, vformat, foldLine, ICS_EVENT_END, ICS_EVENT_START
from Products.ATContentTypes.lib.calendarsupport import VCS_EVENT_START, VCS_EVENT_END
def getICal(event):
    start_str, end_str = _dateStringsForEvent(event)
    out = StringIO()
    map = {
        'dtstamp'   : rfc2445dt(DateTime()),
        'created'   : rfc2445dt(DateTime(event.CreationDate())),
        'uid'       : event.UID(),
        'modified'  : rfc2445dt(DateTime(event.ModificationDate())),
    out = StringIO()
    map = {
        'dtstamp'   : rfc2445dt(DateTime()),
        'created'   : rfc2445dt(DateTime(event.CreationDate())),
        'uid'       : event.UID(),

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next