DataPipeline/Base.py
def addFolder(self, path):
        """Add a folder to the queue"""

        D = {}
        ext = self.extension
        #print os.path.basename(path), os.path.normpath(path)
        for root, dirs, files in os.walk(path):
            for d in dirs:
                if d.startswith('.'):
                    dirs.remove(d)
            for f in files:
                fname = os.path.join(root,f)
                if ext in os.path.splitext(fname)[1] or ext == '':
                    #print root,fname
                    label = os.path.relpath(fname,  os.path.normpath(path))
                    label = label.replace(os.path.sep,'_')
                    #print label
                    D[label] = fname
        self.queue = D
        return D
Add a folder to the queue
Add a folder to the queue
Add a folder to the queue
def addFolder(self, path):
        D = {}
        ext = self.extension
        for root, dirs, files in os.walk(path):
            for d in dirs:
                if d.startswith('.'):
                    dirs.remove(d)
            for f in files:
                fname = os.path.join(root,f)
                if ext in os.path.splitext(fname)[1] or ext == '':
                    label = os.path.relpath(fname,  os.path.normpath(path))
                    label = label.replace(os.path.sep,'_')
                    D[label] = fname
        self.queue = D
        return D
def addFolder ( self , path ) : D = { } ext = self . extension for root , dirs , files in os . walk ( path ) : for d in dirs : if d . startswith ( '.' ) : dirs . remove ( d ) for f in files : fname = os . path . join ( root , f ) if ext in os . path . splitext ( fname ) [ 1 ] or ext == '' : label = os . path . relpath ( fname , os . path . normpath ( path ) ) label = label . replace ( os . path . sep , '_' ) D [ label ] = fname self . queue = D return D
Add a folder to the queue
Add a folder to the queue
"""Add a folder to the queue""" #print os.path.basename(path), os.path.normpath(path) #print root,fname #print label
self
path