'Recursive function to group Eden files into respective modules'

def group_files(self, currentDir, curmod='', vflag=0):

    path = os.path
    currentDir = path.abspath(currentDir)
    base_dir = path.basename(currentDir)
    if (base_dir in ('.git', 'docs', 'languages', 'private', 'templates', 'tests', 'uploads')):
        return
    if (base_dir == 'views'):
        vflag = 1
    d = self.d
    files = os.listdir(currentDir)
    for f in files:
        if (f.startswith('.') or f.endswith('.pyc') or (f in ('test.py', 'tests.py'))):
            continue
        curFile = path.join(currentDir, f)
        if path.isdir(curFile):
            if vflag:
                self.group_files(curFile, f, vflag)
            else:
                self.group_files(curFile, curmod, vflag)
        else:
            if vflag:
                base = curmod
            elif (f in ('s3menus.py', 's3cfg.py', '000_config.py', 'config.py', 'menus.py')):
                base = 'special'
            else:
                base = path.splitext(f)[0]
                if ('s3' in base):
                    base = base[2:]
            if (base in d.keys()):
                d[base].append(curFile)
            else:
                d['core'].append(curFile)
