Created
February 9, 2017 19:38
-
-
Save elektro-NIK/20d0846eef388ddc4ca12871cc2c13f6 to your computer and use it in GitHub Desktop.
Patch fdb for using with InterBase (https://community.embarcadero.com/blogs/entry/interbase-and-python)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
if input('This patch only for version 1.6.1! Continue? [y]/n: ') == 'n': | |
exit(0) | |
fbcore_diff = {'fb_interpret': 'isc_interprete', | |
'512, ': '', | |
'isc_info_firebird_version': 'isc_info_version'} | |
ibase_diff = {'fbclient.dll': 'gds32.dll', | |
'Firebird Project\Firebird Server\Instances': 'Embarcadero\InterBase\Servers', | |
'DefaultInstance': 'RootDirectory', | |
"'fbclient'": "'gdb'", | |
'libfbclient': 'libgds', | |
'self.fb_interpret': '#self.fb_interpret'} | |
with open('fbcore.py', 'r') as f: | |
fbcore = f.readlines() | |
with open('ibase.py', 'r') as f: | |
ibase = f.readlines() | |
for i in fbcore_diff.keys(): | |
fbcore = [line.replace(i, fbcore_diff[i]) for line in fbcore] | |
for i in ibase_diff.keys(): | |
ibase = [line.replace(i, ibase_diff[i]) for line in ibase] | |
with open('fbcore.py', 'w') as f: | |
f.writelines(fbcore) | |
with open('ibase.py', 'w') as f: | |
f.writelines(ibase) | |
print('Success!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment