def configure_gtk(self):
        paths = [
            os.path.join('etc', 'gtk-2.0', 'gtk.immodules'),
            os.path.join('etc', 'gtk-2.0', 'im-multipress.conf'),
            os.path.join('etc', 'pango', 'pango.modules')
        ]

        for path in paths:
            bundle_path = os.path.join(self.bundle_res_dir, path) + '.in'
            path = os.path.join(self.prefix, path)

            if not os.path.isfile(path):
                continue

            try:
                os.makedirs(os.path.dirname(bundle_path))
            except:
                pass

            ifp = open(path)
            ofp = open(bundle_path, 'w')
            for line in ifp:
                if line.startswith('#'):
                    continue
                ofp.write(line.replace(self.prefix, '${APP_RESOURCES}'))
            ifp.close()
            ofp.close()

            if os.path.basename(path) == 'pango.modules':
                fp = open(os.path.join(os.path.dirname(
                    bundle_path), 'pangorc'), 'w')
                fp.write('[Pango]\n')
                fp.write('ModuleFiles=./pango.modules\n')
                fp.close()
dataset/ETHPy150Open mono/bockbuild/bockbuild/darwinprofile.py/DarwinProfile.configure_gtk/original