All Samples(8828) | Call(8255) | Derive(0) | Import(573)
makedirs(path [, mode=0777]) Super-mkdir; create a leaf directory and all intermediate ones. Works like mkdir, except that any intermediate path segment (not just the rightmost) will be created if it does not exist. This is recursive.
def makedirs(name, mode=0777):
"""makedirs(path [, mode=0777])
Super-mkdir; create a leaf directory and all intermediate ones.
Works like mkdir, except that any intermediate path segment (not
just the rightmost) will be created if it does not exist. This is
recursive.
"""
head, tail = path.split(name)
if not tail:
head, tail = path.split(head)
if head and tail and not path.exists(head):
try:
makedirs(head, mode)
except OSError, e:
# be happy if someone already created the path
if e.errno != errno.EEXIST:
raise
if tail == curdir: # xxx/newdir/. exists if xxx/newdir exists
return
mkdir(name, mode)
def makedirs(self, mode=0777):
os.makedirs(self, mode)
def rmdir(self):
os.rmdir(self)
def removedirs(self):
src/p/y/PyMT-0.5.1/examples/apps/mtwitter/twitter.py PyMT(Download)
def Set(self,key,data):
path = self._GetPath(key)
directory = os.path.dirname(path)
if not os.path.exists(directory):
os.makedirs(directory)
if not os.path.isdir(directory):
raise _FileCacheError('%s exists but is not a directory' % directory)
src/p/k/pksampler-HEAD/pk/stereo/ripper.py pksampler(Download)
disc = '%s - %s' % (self.artist, self.album)
path = os.path.join(LIBRARY, self.genre, disc)
try: os.makedirs(path)
except: pass
try: os.chdir(path)
except: pass
src/n/o/notmm-0.4.1/examples/lib/l10n/bin/make-messages.py notmm(Download)
print "processing language", lang
basedir = os.path.join(localedir, lang, 'LC_MESSAGES')
if not os.path.isdir(basedir):
os.makedirs(basedir)
pofile = os.path.join(basedir, '%s.po' % domain)
potfile = os.path.join(basedir, '%s.pot' % domain)
src/l/a/lamson-1.0/examples/librelist/app/model/archive.py lamson(Download)
def store_path(list_name, name):
datedir = os.path.join(settings.ARCHIVE_BASE, list_name, day_of_year_path())
if not os.path.exists(datedir):
os.makedirs(datedir)
return os.path.join(datedir, name)
def update_json(list_name, key, message):
jpath = store_path(list_name, 'json')
json_file = key + ".json"
json_archive = os.path.join(jpath, json_file)
if not os.path.exists(jpath):
os.makedirs(jpath)
src/n/i/NiPy-OLD-HEAD/examples/neurospin/need_data/get_data_light.py NiPy-OLD(Download)
datafile = os.path.join(url,filename)
fp = urllib2.urlopen(datafile)
if not os.path.exists(data_dir):
os.makedirs(data_dir)
assert os.path.exists(data_dir)
local_file = open(MaskImage, 'w')
local_file.write(fp.read())
datafile = os.path.join(url,filename)
fp = urllib2.urlopen(datafile)
if not os.path.exists(data_dir):
os.makedirs(data_dir)
assert os.path.exists(data_dir)
local_file = open(InputImage, 'w')
local_file.write(fp.read())
datafile = os.path.join(url,filename)
fp = urllib2.urlopen(datafile)
if not os.path.exists(data_dir):
os.makedirs(data_dir)
assert os.path.exists(data_dir)
local_file = open(GroupData, 'w')
local_file.write(fp.read())
src/v/a/vapp-HEAD/trunk/samples/voicemail/VoicemailStorage.py vapp(Download)
def saveMessage(self, fd, format, cli, logger):
folder_path = "%s/%d" % (self.__home, FOLDER_INBOX)
last_id_filename = "%s/last_id.txt" % self.__home
try:
os.stat(folder_path)
except OSError:
os.makedirs(folder_path)
src/v/a/vapp-HEAD/samples/voicemail/VoicemailStorage.py vapp(Download)
def saveMessage(self, fd, format, cli, logger):
folder_path = "%s/%d" % (self.__home, FOLDER_INBOX)
last_id_filename = "%s/last_id.txt" % self.__home
try:
os.stat(folder_path)
except OSError:
os.makedirs(folder_path)
src/n/i/nipy-HEAD/examples/neurospin/need_data/get_data_light.py nipy(Download)
# if needed create data_dir
if not os.path.exists(data_dir):
os.makedirs(data_dir)
assert os.path.exists(data_dir)
# download mask_image if necessary
# create data_dir
if not os.path.exists(data_dir):
os.makedirs(data_dir)
assert os.path.exists(data_dir)
# download mask_image if necessary
src/m/e/meresco-HEAD/meresco-components/workingsets/2.23.6-UvT/version_1/merescocomponents/examples/dna/server.py meresco(Download)
from sys import stdout from os.path import join, isdir from os import makedirs from merescocore.framework import be, Observable, TransactionScope, ResourceManager, Transparant
if __name__ == '__main__':
databasePath = '/tmp/meresco'
if not isdir(databasePath):
makedirs(databasePath)
reactor = Reactor()
server = be(dna(reactor, config['host'], config['port'], databasePath))
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next