Gets modules routes.py and converts to module imports

def find_files(self):
        """ Gets modules routes.py and converts to module imports """
        modules = self.evernode_app.get_modules()
        root_path = sys.path[0] if self.evernode_app.root_path is None \
            else self.evernode_app.root_path
        dirs = [dict(
            dir=os.path.join(root_path, 'resources', 'lang'), module="root")]
        for module_name in modules:
            modules_folder = 'modules{}%s'.format(os.sep)
            if module_name is not None:
                modules_folder = modules_folder % (module_name.strip(os.sep))
            else:
                continue
            path = os.path.join(
                root_path, modules_folder, 'resources', 'lang')
            if os.path.isdir(path):
                dirs.append(dict(dir=path, module=module_name))
        for dir in dirs:
            module_pack = {
                'name': dir['module'],
                'languages': [],
                'file_packs': []
            }
            for path, subdirs, files in os.walk(dir['dir']):
                for subdir in subdirs:
                    module_pack['languages'].append(subdir)
                for name in files:
                    module_pack['file_packs'].append(dict(
                        file=os.path.join(path, name),
                        name=name.rsplit('.', 1)[0].lower(),
                        language=path.split("lang%s" % (os.sep), 1)[1].strip()
                    ))
            self.module_packs.append(module_pack)
        for module_pack in self.module_packs:
            module_pack['file_packs'] = \
                list({v['file']: v for v in module_pack['file_packs']}
                     .values())
        if self.app.config['DEBUG']:
            print('--- Loaded Language Files ---')
            print("Loaded Dirs: " + str(dirs))
            print("Loaded Language Packs: " + str(self.module_packs))