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

All Samples(22)  |  Call(17)  |  Derive(0)  |  Import(5)
Given a time in seconds since the epoch, returns a date value in the
format used by server descriptors (YYYY/MM/DD) in GMT

        def formatDate(when):
    """Given a time in seconds since the epoch, returns a date value in the
       format used by server descriptors (YYYY/MM/DD) in GMT"""
    gmt = time.gmtime(when+1) # Add 1 to make sure we round down.
    return "%04d-%02d-%02d" % (gmt[0],gmt[1],gmt[2])

src/m/i/mixminion-HEAD/lib/mixminion/server/ServerKeys.py   mixminion(Download)
from mixminion.ServerInfo import ServerInfo, PACKET_KEY_BYTES, MMTP_KEY_BYTES,\
from mixminion.Common import AtomicFile, LOG, MixError, MixFatalError, \
     ceilDiv, createPrivateDir, checkPrivateFile, englishSequence, \
     formatBase64, formatDate, formatTime, previousMidnight, readFile, \
                LOG.trace("Found key %s (valid from %s to %s)",
                          dirname, formatDate(t1), formatDate(t2))
            if start < end:
                LOG.warn("Multiple keys for %s.  That's unsupported.",
            elif start > end:
                LOG.warn("Gap in key schedule: no key from %s to %s",
                              formatDate(end), formatDate(start))

src/m/i/mixminion-HEAD/lib/mixminion/directory/DirFormats.py   mixminion(Download)
import mixminion.ServerInfo
from mixminion.Common import formatBase64, formatDate, floorDiv, LOG, \
     MixError, previousMidnight
    assert status in ("vote", "consensus")
    va = formatDate(previousMidnight(validAfter))
    vu = formatDate(previousMidnight(validAfter)+24*60*60+5)
    rec = [ s.lower() for s in goodServerNames[:] ]
    vu = directory['Directory-Info']['Valid-Until']
    if va != validAfter:
        raise BadVote("Validity date is wrong (%s)"%formatDate(va))
    elif vu != previousMidnight(va+24*60*60+60):
        raise BadVote("Validity span is not 1 day long (ends at %s)"%

src/m/i/mixminion-HEAD/lib/mixminion/ClientDirectory.py   mixminion(Download)
import mixminion.ServerInfo
from mixminion.Common import LOG, MixError, MixFatalError, UIError, \
     ceilDiv, createPrivateDir, formatDate, formatFnameTime, openUnique, \
     previousMidnight, readPickled, readPossiblyGzippedFile, \
        if cascade: lines.append("%s:"%nickname)
        for (va,vu),fmap in items:
            ftime = "%s to %s"%(formatDate(va),formatDate(vu))
            fvals = tuple([fmap[f] for f in features])
            if cascade==1:

src/m/i/mixminion-HEAD/lib/mixminion/directory/ServerList.py   mixminion(Download)
from mixminion.Crypto import pk_decode_public_key, pk_encode_public_key, \
from mixminion.Common import IntervalSet, LOG, MixError, MixFatalError, \
     UIError, createPrivateDir, formatBase64, formatDate, formatFnameTime, \
     formatTime, iterFileLines, Lockfile, openUnique, previousMidnight, readFile,\

src/m/i/mixminion-HEAD/lib/mixminion/ServerInfo.py   mixminion(Download)
import mixminion.Packet
from mixminion.Common import IntervalSet, LOG, MixError, createPrivateDir, \
     formatBase64, formatDate, formatTime, readPossiblyGzippedFile
from mixminion.Config import ConfigError