All Samples(17050) | Call(16291) | Derive(0) | Import(759)
listdir(path) -> list_of_strings
Return a list containing the names of the entries in the directory.
path: path of directory to list
The list is in arbitrary order. It does not include the special
entries '.' and '..' even if they are present in the directory.src/p/i/pity-HEAD/examples/pity-pdf.py pity(Download)
import sys import pity from tempfile import mkstemp from os import listdir, unlink, path, fdopen from lxml import etree import subprocess
sys.exit(-1)
dir = sys.argv[2]
pits = sorted(filter(lambda x: x.endswith('.svg'), listdir(dir)))
temps = [] # array of temp files to delete at the end of program
values = pity.read_data(sys.argv[1])
src/w/e/Werkzeug-0.6.2/examples/coolmagic/application.py Werkzeug(Download)
:copyright: (c) 2009 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from os import path, listdir
from coolmagic.utils import Request, local_manager, redirect
from werkzeug.routing import Map, Rule, RequestRedirect
from werkzeug.exceptions import HTTPException, NotFound
def __init__(self, config):
self.config = config
for fn in listdir(path.join(path.dirname(__file__), 'views')):
if fn.endswith('.py') and fn != '__init__.py':
__import__('coolmagic.views.' + fn[:-3])
src/n/i/nipy-HEAD/examples/fiac/fiac_util.py nipy(Download)
import os from StringIO import StringIO from os import makedirs, listdir from os.path import exists, abspath, isdir, join as pjoin # Third party
for rundir in runs:
rundir = pjoin(rootdir, rundir)
for condir in listdir(rundir):
for stat in ['sd', 'effect']:
fname_effect = abspath(pjoin(rundir, condir, 'effect.nii'))
fname_sd = abspath(pjoin(rundir, condir, 'sd.nii'))
src/n/i/NiPy-OLD-HEAD/examples/fiac/fiac_util.py NiPy-OLD(Download)
import os from StringIO import StringIO from os import makedirs, listdir from os.path import exists, abspath, isdir, join as pjoin # Third party
for rundir in runs:
rundir = pjoin(rootdir, rundir)
for condir in listdir(rundir):
for stat in ['sd', 'effect']:
fname_effect = abspath(pjoin(rundir, condir, 'effect.nii'))
fname_sd = abspath(pjoin(rundir, condir, 'sd.nii'))
src/m/e/meresco-HEAD/meresco-core/workingsets/2.22.9-EduRep/version_8/merescocore/components/reindex.py meresco(Download)
from lxml.etree import parse
from StringIO import StringIO
from os.path import isdir, join
from os import makedirs, listdir, remove, rmdir
EMPTYDOC = parse(StringIO('<empty/>'))
def _processBatches(self, sessionDirectory):
batchFile = join(sessionDirectory, listdir(sessionDirectory)[0])
for identifier in (identifier.strip() for identifier in open(batchFile).readlines()):
try:
self.do.addDocumentPart(identifier=identifier, name='ignoredName', lxmlNode=EMPTYDOC)
except Exception, e:
yield '\n!error processing "%s": %s' % (identifier, str(e))
return
yield "+%s\n" % identifier
remove(batchFile)
yield "=batches left: %d" % len(listdir(sessionDirectory))
if len(listdir(sessionDirectory)) == 0:
src/m/e/meresco-HEAD/meresco-core/workingsets/2.22.9-EduRep/version_7/merescocore/components/reindex.py meresco(Download)
from lxml.etree import parse
from StringIO import StringIO
from os.path import isdir, join
from os import makedirs, listdir, remove, rmdir
EMPTYDOC = parse(StringIO('<empty/>'))
def _processBatches(self, sessionDirectory):
batchFile = join(sessionDirectory, listdir(sessionDirectory)[0])
for identifier in (identifier.strip() for identifier in open(batchFile).readlines()):
try:
self.do.addDocumentPart(identifier=identifier, name='ignoredName', lxmlNode=EMPTYDOC)
except Exception, e:
yield '\n!error processing "%s": %s' % (identifier, str(e))
return
yield "+%s\n" % identifier
remove(batchFile)
yield "=batches left: %d" % len(listdir(sessionDirectory))
if len(listdir(sessionDirectory)) == 0:
src/m/e/meresco-HEAD/meresco-core/workingsets/2.22.9-EduRep/version_6/merescocore/components/reindex.py meresco(Download)
from lxml.etree import parse
from StringIO import StringIO
from os.path import isdir, join
from os import makedirs, listdir, remove, rmdir
EMPTYDOC = parse(StringIO('<empty/>'))
def _processBatches(self, sessionDirectory):
batchFile = join(sessionDirectory, listdir(sessionDirectory)[0])
for identifier in (identifier.strip() for identifier in open(batchFile).readlines()):
try:
self.do.addDocumentPart(identifier=identifier, name='ignoredName', lxmlNode=EMPTYDOC)
except Exception, e:
yield '\n!error processing "%s": %s' % (identifier, str(e))
return
yield "+%s\n" % identifier
remove(batchFile)
yield "=batches left: %d" % len(listdir(sessionDirectory))
if len(listdir(sessionDirectory)) == 0:
src/m/e/meresco-HEAD/meresco-core/workingsets/2.22.9-EduRep/version_5/merescocore/components/reindex.py meresco(Download)
from lxml.etree import parse
from StringIO import StringIO
from os.path import isdir, join
from os import makedirs, listdir, remove, rmdir
EMPTYDOC = parse(StringIO('<empty/>'))
def _processBatches(self, sessionDirectory):
batchFile = join(sessionDirectory, listdir(sessionDirectory)[0])
for identifier in (identifier.strip() for identifier in open(batchFile).readlines()):
try:
self.do.addDocumentPart(identifier=identifier, name='ignoredName', lxmlNode=EMPTYDOC)
except Exception, e:
yield '\n!error processing "%s": %s' % (identifier, str(e))
return
yield "+%s\n" % identifier
remove(batchFile)
yield "=batches left: %d" % len(listdir(sessionDirectory))
if len(listdir(sessionDirectory)) == 0:
src/m/e/meresco-HEAD/meresco-core/workingsets/2.22.9-EduRep/version_4/merescocore/components/reindex.py meresco(Download)
from lxml.etree import parse
from StringIO import StringIO
from os.path import isdir, join
from os import makedirs, listdir, remove, rmdir
EMPTYDOC = parse(StringIO('<empty/>'))
def _processBatches(self, sessionDirectory):
batchFile = join(sessionDirectory, listdir(sessionDirectory)[0])
for identifier in (identifier.strip() for identifier in open(batchFile).readlines()):
try:
self.do.addDocumentPart(identifier=identifier, name='ignoredName', lxmlNode=EMPTYDOC)
except Exception, e:
yield '\n!error processing "%s": %s' % (identifier, str(e))
return
yield "+%s\n" % identifier
remove(batchFile)
yield "=batches left: %d" % len(listdir(sessionDirectory))
if len(listdir(sessionDirectory)) == 0:
src/m/e/meresco-HEAD/meresco-core/workingsets/2.22.9-EduRep/version_3/merescocore/components/reindex.py meresco(Download)
from lxml.etree import parse
from StringIO import StringIO
from os.path import isdir, join
from os import makedirs, listdir, remove, rmdir
EMPTYDOC = parse(StringIO('<empty/>'))
def _processBatches(self, sessionDirectory):
batchFile = join(sessionDirectory, listdir(sessionDirectory)[0])
for identifier in (identifier.strip() for identifier in open(batchFile).readlines()):
try:
self.do.addDocumentPart(identifier=identifier, name='ignoredName', lxmlNode=EMPTYDOC)
except Exception, e:
yield '\n!error processing "%s": %s' % (identifier, str(e))
return
yield "+%s\n" % identifier
remove(batchFile)
yield "=batches left: %d" % len(listdir(sessionDirectory))
if len(listdir(sessionDirectory)) == 0:
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next