/usr/lib/python2.7/dist-packages/pymol/checking.py is in pymol 1.7.0.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | import types
try:
import cmd
except:
cmd = None
def _raising(code=-1,_self=cmd):
# WARNING: internal routine, subject to change
if isinstance(code, types.IntType):
if code<0:
return _self.get_setting_legacy("raise_exceptions")
return 0
def is_string(obj):
return (isinstance(obj,types.StringType) or isinstance(obj,types.UnicodeType))
def is_list(obj):
return isinstance(obj,types.ListType)
def is_dict(obj):
return isinstance(obj,types.DictType)
def is_tuple(obj):
return isinstance(obj,types.TupleType)
def is_sequence(obj):
return isinstance(obj,types.ListType) or isinstance(obj,types.TupleType)
def is_error(result): # errors are always negative numbers
if isinstance(result,types.IntType):
return (result<0)
return 0
def is_ok(result): # something other than a negative number
if isinstance(result,types.IntType):
return (result>=0)
return 1
|