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

All Samples(37)  |  Call(23)  |  Derive(0)  |  Import(14)
Create a directory, and all parent directories, checking permissions
as we go along.  All superdirectories must be owned by root or us.

        def createPrivateDir(d, nocreate=0):
    """Create a directory, and all parent directories, checking permissions
       as we go along.  All superdirectories must be owned by root or us."""
    if not os.path.exists(d):
        if nocreate:
            raise MixFatalError("Nonexistent directory %s" % d)
        try:
            os.makedirs(d, 0700)
        except OSError, e:
            raise MixFatalError(
                "Unable to create directory %s: %s" % (d, e))

    checkPrivateDir(d)
        


src/m/i/mixminion-HEAD/lib/mixminion/Filestore.py   mixminion(Download)
import whichdb
 
from mixminion.Common import MixError, MixFatalError, secureDelete, LOG, \
     createPrivateDir, readFile, replaceFile, tryUnlink, writePickled
from mixminion.Crypto import getCommonPRNG
            raise MixFatalError("%s is not a directory" % location)
 
        createPrivateDir(location, nocreate=(not create))
 
        if scrub:
    """
    parent = os.path.split(filename)[0]
    createPrivateDir(parent)
 
    # If the file exists, but can't be read, bail.

src/m/i/mixminion-HEAD/lib/mixminion/server/ServerMain.py   mixminion(Download)
 
from bisect import insort
from mixminion.Common import LOG, LogStream, MixError, MixFatalError,\
     UIError, ceilDiv, createPrivateDir, disp64, formatTime, \
     installSIGCHLDHandler, Lockfile, LockfileLocked, readFile, secureDelete, \
        exists = getHomedirVersion(config)
 
        createPrivateDir(homeDir)
        if exists != SERVER_HOMEDIR_VERSION:
            # If we reach this point, the homedir is uninitialized.
 
        # Create directories as needed; homeDir already created.
        createPrivateDir(config.getWorkDir())
        createPrivateDir(config.getKeyDir())
        createPrivateDir(config.getQueueDir())

src/m/i/mixminion-HEAD/lib/mixminion/server/ServerKeys.py   mixminion(Download)
from mixminion.ServerInfo import ServerInfo, PACKET_KEY_BYTES, MMTP_KEY_BYTES,\
     signServerInfo
from mixminion.Common import AtomicFile, LOG, MixError, MixFatalError, \
     ceilDiv, createPrivateDir, checkPrivateFile, englishSequence, \
     formatBase64, formatDate, formatTime, previousMidnight, readFile, \
        if not os.path.exists(self.keyDir):
            LOG.info("Creating server keystore at %s", self.keyDir)
            createPrivateDir(self.keyDir)
 
        # Iterate over the entires in HOME/keys
 
        self.pingerSeed = r = mixminion.Crypto.trng(mixminion.Crypto.DIGEST_LEN)
        createPrivateDir(self.keyDir)
        writeFile(fn, r, 0600)
        return r
    def _getDHFile(self):
        """Return the filename for the diffie-helman parameters for the
           server.  Creates the file if it doesn't yet exist."""
        dhdir = os.path.split(self.dhFile)[0]
        createPrivateDir(dhdir)
        self.published = os.path.exists(self.publishedFile)
        if not os.path.exists(keydir):
            createPrivateDir(keydir)
 
    def delete(self):

src/m/i/mixminion-HEAD/lib/mixminion/ClientMain.py   mixminion(Download)
import mixminion.MMTPClient
 
from mixminion.Common import LOG, Lockfile, LockfileLocked, MixError, \
     MixFatalError, MixProtocolBadAuth, MixProtocolError, STATUS, UIError, \
     UsageError, createPrivateDir, englishSequence, floorDiv, formatTime, \
def configureClientLock(filename):
    """Prepare the client lock for use."""
    global _CLIENT_LOCKFILE
    parent, fname = os.path.split(filename)
    createPrivateDir(parent)
    def __init__(self, keyDir, passwordManager=None):
        """Create a new ClientKeyring, storing its keys in 'keyDir'"""
        if passwordManager is None:
            passwordManager = mixminion.ClientUtils.CLIPasswordManager()
        createPrivateDir(keyDir)
        # Make directories
        userdir = self.config['User']['UserDir']
        createPrivateDir(userdir)
        keyDir = os.path.join(userdir, "keys")
        if password_fileno is None:

src/m/i/mixminion-HEAD/lib/mixminion/directory/ServerList.py   mixminion(Download)
from mixminion.Crypto import pk_decode_public_key, pk_encode_public_key, \
     pk_same_public_key
from mixminion.Common import IntervalSet, LOG, MixError, MixFatalError, \
     UIError, createPrivateDir, formatBase64, formatDate, formatFnameTime, \
     formatTime, iterFileLines, Lockfile, openUnique, previousMidnight, readFile,\
        else:
            self._statusDB = None
        createPrivateDir(location)
 
    def close(self):

src/m/i/mixminion-HEAD/lib/mixminion/server/Modules.py   mixminion(Download)
import mixminion.server.PacketHandler
from mixminion.Config import ConfigError
from mixminion.Common import LOG, MixError, ceilDiv, createPrivateDir, \
     encodeBase64, floorDiv, isPrintingAscii, isSMTPMailbox, previousMidnight,\
     readFile, waitForChildren
    def configure(self, config):
        self._setQueueRoot(os.path.join(config.getQueueDir(), 'deliver'))
        createPrivateDir(self.queueRoot)
        for m in self.modules:
            m.configure(config, self)

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, \
    def configure(self, config):
        """Set up the directory where imported descriptors are stored."""
        self.directory = os.path.join(config.getDirectoryRoot(),
                                      "imported")
        createPrivateDir(self.directory)
    def configure(self, config):
        self.fnameBase = os.path.join(config.getDirectoryRoot(), "dir")
        createPrivateDir(config.getDirectoryRoot())
        timeout =config.get('DirectoryServers',{}).get('DirectoryTimeout',None)
        if timeout:
    def configure(self,config):
        self.cacheFile = os.path.join(config.getDirectoryRoot(),
                                      "cache")
        createPrivateDir(config.getDirectoryRoot())
        for b in self.bases: b.configure(config)

src/m/i/mixminion-HEAD/lib/mixminion/server/EventStats.py   mixminion(Download)
from time import time
 
from mixminion.Common import formatTime, LOG, previousMidnight, floorDiv, \
     createPrivateDir, MixError, readPickled, tryUnlink, writePickled
 
        for fn in filename, historyFile:
            parent = os.path.split(fn)[0]
            createPrivateDir(parent)
        self.rotateInterval = interval
        self.lastSave = time()

src/m/i/mixminion-HEAD/lib/mixminion/server/Pinger.py   mixminion(Download)
import mixminion.server.MMTPServer
 
from mixminion.Common import MixError, AtomicFile, ceilDiv, createPrivateDir, \
     floorDiv, formatBase64, formatFnameDate, formatTime, IntervalSet, LOG, \
     parseFnameDate, previousMidnight, readPickled, secureDelete, \
    def __init__(self, location):
        """Create a SQLite database storing its data in the file 'location'."""
        parent = os.path.split(location)[0]
        createPrivateDir(parent)
        self._theConnection = sqlite3.connect(location, isolation_level=None)

src/m/i/mixminion-HEAD/lib/mixminion/ClientUtils.py   mixminion(Download)
import mixminion.Packet
 
from mixminion.Common import LOG, MixError, UIError, ceilDiv, \
     createPrivateDir, floorDiv, previousMidnight, readFile, \
     succeedingMidnight, writeFile, armorText, unarmorText, MixFatalError
    def __init__(self, directory, prng=None):
        """Create a new ClientQueue object, storing packets in 'directory'
           and generating random filenames using 'prng'."""
        self.dir = directory
        createPrivateDir(directory)
    def __init__(self, directory):
        """Create a new FragmentPool storing its messages in 'directory'."""
        createPrivateDir(directory)
        self.dir = directory
        self.pool = None

  1 | 2  Next