Skip to content

Commit 54b66c1

Browse files
committed
restore some Python 2.5 compatibility
1 parent 4ef0560 commit 54b66c1

11 files changed

+8
-21
lines changed

Diff for: anglebetweenhelices.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
(c) 2010 Thomas Holder
33
'''
44

5-
from __future__ import print_function
65
from pymol import cmd, stored, CmdException
76
from chempy import cpv
87
import math
@@ -296,10 +295,10 @@ def angle_between_helices(selection1, selection2, method='helix_orientation', vi
296295
try:
297296
orientation = methods[str(method)]
298297
except KeyError:
299-
print('no such method:', method)
298+
print('no such method: ' + str(method))
300299
raise CmdException
301300
if not quiet:
302-
print('Using method:', orientation.__name__)
301+
print('Using method: ' + orientation.__name__)
303302
cen1, dir1 = orientation(selection1, visualize, quiet=1)
304303
cen2, dir2 = orientation(selection2, visualize, quiet=1)
305304
angle = cpv.get_angle(dir1, dir2)

Diff for: b2transparency.py

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
License: BSD-2-Clause
77
'''
88

9-
from __future__ import print_function
109
from pymol import cmd, CmdException
1110

1211

Diff for: bbPlane.py

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
License: MIT
1313
'''
1414

15-
from __future__ import print_function
1615
from pymol import cmd
1716

1817

Diff for: cgo_arrow.py

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
License: BSD-2-Clause
77
'''
88

9-
from __future__ import print_function
109
from pymol import cmd, cgo, CmdException
1110

1211

Diff for: colorbyrmsd.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
License: BSD-2-Clause
88
'''
99

10-
from __future__ import print_function
1110
from pymol import cmd, CmdException
1211

1312

@@ -49,7 +48,7 @@ def colorbyrmsd(mobile, target, doAlign=1, doPretty=1, guide=1, method='super',
4948
try:
5049
align = cmd.keyword[method][0]
5150
except:
52-
print(' Error: no such method:', method)
51+
print(' Error: no such method: ' + str(method))
5352
raise CmdException
5453

5554
if guide:

Diff for: extra_fit.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
License: BSD-2-Clause
77
'''
88

9-
from __future__ import print_function
109
__version__ = '1.0'
1110

1211
from pymol import cmd, CmdException
@@ -46,7 +45,7 @@ def extra_fit(selection='(all)', reference=None, method='align', zoom=1,
4645
if method in cmd.keyword:
4746
method = cmd.keyword[method][0]
4847
else:
49-
print('Unknown method', method)
48+
print('Unknown method ' + str(method))
5049
raise CmdException
5150
for model in models:
5251
x = method(mobile='(%s) and model %s' % (selection, model),

Diff for: findseq.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
Jason Vertrees, 2009.
6060
"""
6161

62-
from __future__ import print_function
6362
from pymol import cmd
6463
import re
6564
import types
@@ -375,13 +374,13 @@ def checkParams(needle, haystack, selName, het, firstOnly):
375374
This is just a helper function for checking the user input
376375
"""
377376
# check Needle
378-
if len(needle) == 0 or type(needle) != bytes:
377+
if len(needle) == 0 or not cmd.is_string(needle):
379378
print("Error: Please provide a string 'needle' to search for.")
380379
print("Error: For help type 'help motifFinder'.")
381380
return False
382381

383382
# check Haystack
384-
if len(haystack) == 0 or type(haystack) != bytes:
383+
if len(haystack) == 0 or not cmd.is_string(haystack):
385384
print("Error: Please provide valid PyMOL object or selection name")
386385
print("Error: in which to search.")
387386
print("Error: For help type 'help motifFinder'.")
@@ -402,7 +401,7 @@ def checkParams(needle, haystack, selName, het, firstOnly):
402401
return False
403402

404403
# check selName
405-
if type(selName) != bytes:
404+
if not cmd.is_string(selName):
406405
print("Error: selName was not a string.")
407406
return False
408407
return True

Diff for: flatten_obj.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
Version: 1.0
1818
License: Public Domain
1919
"""
20-
from __future__ import print_function
2120
from pymol import cmd, stored
2221
import re
2322
try:
@@ -98,7 +97,7 @@ def _int_to_chain(i,base=_default_base):
9897
if base < 0 or 62 < base:
9998
raise ValueError("Invalid base")
10099

101-
quot = int(i)/base
100+
quot = int(i)//base
102101
rem = i%base
103102
if rem < 26:
104103
letter = chr( ord("A") + rem)

Diff for: grepset.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import print_function
21
from pymol import cmd
32
import re
43
import pymol.setting

Diff for: renumber.py

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
License: BSD-2-Clause
77
'''
88

9-
from __future__ import print_function
10-
119
from pymol import cmd, CmdException
1210

1311

Diff for: show_bumps.py

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
License: BSD-2-Clause
77
'''
88

9-
from __future__ import print_function
10-
119
from pymol import cmd
1210

1311

0 commit comments

Comments
 (0)