def __update_lib_file(self, outpath):
    libfile_path = os.path.abspath(os.path.join(outpath, 'lib.rs'))
    libfile_dir = os.path.abspath(outpath)
    if (not os.path.exists(libfile_path)):
        libfile_path = os.path.abspath(os.path.join(outpath, '../lib.rs'))
        libfile_dir = os.path.abspath(os.path.join(outpath, '../'))
        if (not os.path.exists(libfile_path)):
            return
    logger.info(('Updating lib.rs: ' + str(libfile_path)))
    with open(libfile_path, 'w') as libfile:
        for child in [f.path for f in os.scandir(libfile_dir)]:
            logger.info(('child: ' + str(child)))
            modname = os.path.splitext(os.path.basename(child))[0]
            if (not (modname == 'lib')):
                libfile.write((('pub mod ' + modname) + ';'))
                self.writer.write_newline(libfile)
def __update_lib_file(self, outpath):
    libfile_path = os.path.abspath(os.path.join(outpath, 'lib.rs'))
    libfile_dir = os.path.abspath(outpath)
    if (not os.path.exists(libfile_path)):
        libfile_path = os.path.abspath(os.path.join(outpath, '../lib.rs'))
        libfile_dir = os.path.abspath(os.path.join(outpath, '../'))
        if (not os.path.exists(libfile_path)):
            return
    logger.info(('Updating lib.rs: ' + str(libfile_path)))
    with open(libfile_path, 'w') as libfile:
        for child in [f.path for f in os.scandir(libfile_dir)]:
            logger.info(('child: ' + str(child)))
            modname = os.path.splitext(os.path.basename(child))[0]
            if (not (modname == 'lib')):
                libfile.write((('pub mod ' + modname) + ';'))
                self.writer.write_newline(libfile)