before 1.6 is out so it has to be compatible with 1.5.2.
global _dir
_dir = dir
- if sys.platform.startswith('win'):
+ if sys.platform[:3] == 'win':
genplatfile = os.path.join(dir, "config-win.txt")
# XXX don't know what the platform string is on a Mac
- elif sys.platform.startswith('mac'):
+ elif sys.platform[:3] == 'mac':
genplatfile = os.path.join(dir, "config-mac.txt")
else:
genplatfile = os.path.join(dir, "config-unix.txt")
if i is None \
or keysym_type(buf[i]) != right_keysym_type:
return None
- lines_back = buf[i:].count("\n") - 1
+ lines_back = string.count(buf[i:], "\n") - 1
# subtract one for the "\n" added to please the parser
upto_open = buf[:i]
- j = upto_open.rfind("\n") + 1 # offset of column 0 of line
+ j = string.rfind(upto_open, "\n") + 1 # offset of column 0 of line
offset = i - j
return "%d.%d" % (lno - lines_back, offset)