From c589e07ec371c4ee53838bbeff41f02b682b297b Mon Sep 17 00:00:00 2001 From: anmaster Date: Wed, 11 Feb 2009 21:47:17 +0000 Subject: [PATCH] Replace deprecated string.find() amd string.lower() in /python/*.py git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@11452 282e977c-c81d-0410-88c4-b93c2d0d6712 --- python/CFDialog.py | 2 +- python/CFWorld.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/CFDialog.py b/python/CFDialog.py index fd5afc37f..94d4f666c 100644 --- a/python/CFDialog.py +++ b/python/CFDialog.py @@ -275,7 +275,7 @@ class Dialog: # only need to be a substring of the message in order to trigger a reply. def isAnswer(self, msg, keywords): for ckey in keywords: - if ckey == "*" or string.find(msg.lower(), ckey.lower()) != -1: + if ckey == "*" or msg.lower().find(ckey.lower()) != -1: return 1 return 0 diff --git a/python/CFWorld.py b/python/CFWorld.py index 8a8344331..b42fb0e23 100644 --- a/python/CFWorld.py +++ b/python/CFWorld.py @@ -13,7 +13,7 @@ bigmapysize = 50 #Return an x,y tuple of where in bigworld an object is. Return false if not in bigworld. In current bigworld, values range from 5000 to 6499. def loc_from_ob(ob): cfmap = ob.Map - if ((string.find(cfmap.Path,world_prefix) != 0) or (len(cfmap.Path) != world_len)): + if ((cfmap.Path.find(world_prefix) != 0) or (len(cfmap.Path) != world_len)): return False strloc = cfmap.Path[world_prefix_len:].split(world_sep) x = (int(strloc[0]) * bigmapxsize) + ob.X