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

All Samples(174)  |  Call(124)  |  Derive(0)  |  Import(50)

        def rfc1123_date(ts=None):
    # Return an RFC 1123 format date string, required for
    # use in HTTP Date headers per the HTTP 1.1 spec.
    # 'Fri, 10 Nov 2000 16:21:09 GMT'
    if ts is None: ts=time.time()
    year, month, day, hh, mm, ss, wd, y, z = time.gmtime(ts)
    return "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (weekday_abbr[wd],
                                                    day, monthname[month],
                                                    year,
                                                    hh, mm, ss)
        


src/s/l/slapos.core-HEAD/master/product/Vifib/Tool/SlapTool.py   slapos.core(Download)
import json
from DateTime import DateTime
from App.Common import rfc1123_date
class SoftwareInstanceNotReady(Exception):
  pass
      self.REQUEST.response.setHeader('Vary',
                                      'REMOTE_USER')
      self.REQUEST.response.setHeader('Last-Modified', rfc1123_date(DateTime()))
      self.REQUEST.response.setBody(result)
      return self.REQUEST.response
                                    'REMOTE_USER')
    self.REQUEST.response.setHeader('Last-Modified',
                                    rfc1123_date(software_instance.getModificationDate()))
    self.REQUEST.response.setBody(result)
    return self.REQUEST.response
    self.REQUEST.response.setHeader('Vary',
                                    'REMOTE_USER')
    self.REQUEST.response.setHeader('Last-Modified', rfc1123_date(DateTime()))
    self.REQUEST.response.setHeader('Content-Type', 'text/xml; charset=utf-8')
    self.REQUEST.response.setBody(result)
  def _logAccess(self, user_reference, context_reference, text):
    memcached_dict = self._getMemcachedDict()
    value = json.dumps({
      'user': '%s' % user_reference,
      'created_at': '%s' % rfc1123_date(DateTime()),

src/z/o/Zope2-2.13.22/src/OFS/PropertySheets.py   Zope2(Download)
from Acquisition import Implicit, Explicit
from App.Common import iso8601_date
from App.Common import rfc1123_date
from App.Dialogs import MessageDialog
from App.Management import Tabs
    def dav__getlastmodified(self):
        return rfc1123_date(self.v_self()._p_mtime)
 
    def dav__getcontenttype(self):
        vself=self.v_self()

src/z/o/Zope-HEAD/src/OFS/PropertySheets.py   Zope(Download)
from Acquisition import Implicit
from App.Common import iso8601_date
from App.Common import rfc1123_date
from App.Dialogs import MessageDialog
from App.Management import Tabs
    def dav__getlastmodified(self):
        return rfc1123_date(self.v_self()._p_mtime)
 
    def dav__getcontenttype(self):
        vself=self.v_self()

src/p/r/Products.CompositePage-1.1/Products/CompositePage/rawfile.py   Products.CompositePage(Download)
from Acquisition import aq_parent
from App.Common import package_home
from App.Common import rfc1123_date
from DateTime import DateTime
 
        self.__name__ = path.split('/')[-1]
        self.lmt = float(os.stat(path)[8]) or time.time()
        self.lmh = rfc1123_date(self.lmt)
 
 

src/e/r/erp5-HEAD/product/ERP5Type/patches/CachingPolicyManager.py   erp5(Download)
from Products.CMFCore.CachingPolicyManager import CachingPolicy, \
    CachingPolicyManager
from App.special_dtml import DTMLFile
from Products.CMFCore.Expression import Expression
from App.Common import rfc1123_date
                mtime = DateTime( mtime )
            if mtime is not None:
                mtime_str = rfc1123_date(mtime.timeTime())
                headers.append( ( 'Last-modified', mtime_str ) )
 
        control = []
 
        if self.getMaxAgeSecs() is not None:
            now = expr_context.vars[ 'time' ]
            exp_time_str = rfc1123_date(now.timeTime() + self._max_age_secs)

src/e/r/erp5-HEAD/product/ERP5Type/patches/AcceleratedHTTPCacheManager.py   erp5(Download)
import time
from Products.StandardCacheManagers.AcceleratedHTTPCacheManager import \
    AcceleratedHTTPCache, AcceleratedHTTPCacheManager
from App.Common import rfc1123_date
from App.special_dtml import DTMLFile
    seconds=self.interval
    cache_control_parameter = ['max-age=%d' %(seconds,)]
    expires=rfc1123_date(time.time() + seconds)
    if getattr(self, 'stale_if_error_interval', 0):
        cache_control_parameter.append("stale-if-error=%d" \
                                       %(self.stale_if_error_interval))
    if getattr(self, 'stale_while_revalidate_interval', 0):
        cache_control_parameter.append("stale-while-revalidate=%d" \
                                       %(self.stale_while_revalidate_interval))
    RESPONSE.setHeader('Last-Modified', rfc1123_date(time.time()))

src/p/r/Products.CMFCore-2.2.8/Products/CMFCore/CachingPolicyManager.py   Products.CMFCore(Download)
from AccessControl.SecurityInfo import ClassSecurityInfo
from App.class_init import InitializeClass
from App.Common import rfc1123_date
from App.special_dtml import DTMLFile
from DateTime.DateTime import DateTime
                    mtime = DateTime( mtime )
                if mtime is not None:
                    mtime_str = rfc1123_date(mtime.timeTime())
                    headers.append( ( 'Last-modified', mtime_str ) )
 
            control = []
 
            if self.getMaxAgeSecs() is not None:
                now = expr_context.vars[ 'time' ]
                exp_time_str = rfc1123_date(now.timeTime() + self._max_age_secs)

src/z/o/Zope2-2.13.22/src/App/ImageFile.py   Zope2(Download)
from Acquisition import Explicit
from App.Common import package_home
from App.Common import rfc1123_date
from App.config import getConfiguration
from DateTime.DateTime import DateTime
        self.size = stat_info[stat.ST_SIZE]
        self.lmt = float(stat_info[stat.ST_MTIME]) or time.time()
        self.lmh = rfc1123_date(self.lmt)
 
    def index_html(self, REQUEST, RESPONSE):

src/s/l/slapos.core-HEAD/master/bt5/slapos_rest_api/DocumentTemplateItem/portal_components/SlapOSRestAPIV1.py   slapos.core(Download)
import json
import transaction
from App.Common import rfc1123_date
from DateTime import DateTime
import re
      # Last-Modified header of subobject containing certificate
      self.REQUEST.response.setHeader('Last-Modified',
        rfc1123_date(software_instance.getModificationDate()))
      # Say that content is publicly cacheable. It is only required in order to
      # *force* storing content on clients' disk in case of using HTTPS
        d = {
          "user": "SlapOS Master",
          'created_at': '%s' % rfc1123_date(DateTime()),
          "text": "#error no data found for %s" % document.getReference()
        }

src/z/o/Zope-HEAD/src/App/ImageFile.py   Zope(Download)
from Acquisition import Explicit
from App.Common import package_home
from App.Common import rfc1123_date
from App.config import getConfiguration
from DateTime.DateTime import DateTime
        self.size = stat_info[stat.ST_SIZE]
        self.lmt = float(stat_info[stat.ST_MTIME]) or time.time()
        self.lmh = rfc1123_date(self.lmt)
 
    def index_html(self, REQUEST, RESPONSE):

  1 | 2 | 3 | 4 | 5  Next