-
Notifications
You must be signed in to change notification settings - Fork 17
/
fix_python3_conflicts.py
47 lines (36 loc) · 1.45 KB
/
fix_python3_conflicts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# op_tests remove decode
# Read in the file
with open("bin/op_tests", 'r') as file:
filedata = file.read()
# Replace the target string
filedata = filedata.replace(".decode('utf-8')", '')
# Write the file out again
with open("bin/op_tests", 'w') as file:
file.write(filedata)
# openprocurement_client/utils.py substitute basestring for str
# Read in the file
with open("src/openprocurement_client/openprocurement_client/utils.py", 'r') as file:
filedata = file.read()
# Replace the target string
filedata = filedata.replace("basestring", 'str')
# Write the file out again
with open("src/openprocurement_client/openprocurement_client/utils.py", 'w') as file:
file.write(filedata)
# src/openprocurement_client/openprocurement_client/resources/tenders.py substitute basestring for str
# Read in the file
with open("src/openprocurement_client/openprocurement_client/resources/tenders.py", 'r') as file:
filedata = file.read()
# Replace the target string
filedata = filedata.replace("basestring", 'str')
# Write the file out again
with open("src/openprocurement_client/openprocurement_client/resources/tenders.py", 'w') as file:
file.write(filedata)
# rebot update output function
# Read in the file
with open("bin/rebot", 'r') as file:
filedata = file.read()
# Replace the target string
filedata = filedata.replace("robot.rebot.rebot_cli()", 'robot.rebot_cli()')
# Write the file out again
with open("bin/rebot", 'w') as file:
file.write(filedata)