def __update_module_files(self, outpath):
    modfile_path = os.path.join(outpath, 'mod.rs')
    modfile_path = os.path.abspath(modfile_path)
    for (root, dirs, files) in os.walk(outpath):
        logger.info(('Updating modfile: ' + os.path.join(root, 'mod.rs')))
        with open(os.path.join(root, 'mod.rs'), 'w') as modfile:
            for name in sorted(files):
                if ((name != 'mod.rs') and name.endswith('.rs')):
                    modname = os.path.splitext(name)[0]
                    modfile.write((('pub mod ' + modname) + ';'))
                    self.writer.write_newline(modfile)
                    modfile.write((('pub use ' + modname) + '::*;'))
                    self.writer.write_newline(modfile)
            for name in sorted(dirs):
                modname = os.path.splitext(name)[0]
                modfile.write((('pub mod ' + modname) + ';'))
                self.writer.write_newline(modfile)
                modfile.write((('pub use ' + modname) + '::*;'))
                self.writer.write_newline(modfile)
def __update_module_files(self, outpath):
    modfile_path = os.path.join(outpath, 'mod.rs')
    modfile_path = os.path.abspath(modfile_path)
    for (root, dirs, files) in os.walk(outpath):
        logger.info(('Updating modfile: ' + os.path.join(root, 'mod.rs')))
        with open(os.path.join(root, 'mod.rs'), 'w') as modfile:
            for name in sorted(files):
                if ((name != 'mod.rs') and name.endswith('.rs')):
                    modname = os.path.splitext(name)[0]
                    modfile.write((('pub mod ' + modname) + ';'))
                    self.writer.write_newline(modfile)
                    modfile.write((('pub use ' + modname) + '::*;'))
                    self.writer.write_newline(modfile)
            for name in sorted(dirs):
                modname = os.path.splitext(name)[0]
                modfile.write((('pub mod ' + modname) + ';'))
                self.writer.write_newline(modfile)
                modfile.write((('pub use ' + modname) + '::*;'))
                self.writer.write_newline(modfile)