diff --git a/scripts/register/update.py b/scripts/register/update.py index ff7d88287..c4d7ba370 100644 --- a/scripts/register/update.py +++ b/scripts/register/update.py @@ -7,12 +7,12 @@ import sys dbname=sys.argv[1] file=sys.argv[2] game=int(sys.argv[3]) -infile=open('update.log', 'r') +infile=open(file, 'r') db=MySQLdb.connect(db=dbname) cursor=db.cursor() matchrenum=re.compile( - r"""renum\s(.*)\s(.*)""", + r"""renum\s([^\s]+)\s(.*)\n""", re.IGNORECASE | re.DOTALL | re.VERBOSE) matchdropout=re.compile( @@ -24,6 +24,6 @@ for line in infile.readlines(): if match!=None: fold=match.group(1) fnew=match.group(2) - i=cursor.execute("update subscriptions set faction='"+fnew+"' where game="+str(game)+" and faction='"+fold+"') + i=cursor.execute("update subscriptions set faction='"+fnew+"' where game="+str(game)+" and faction='"+fold+"'") if i!=1: print "could not renum faction "+fold+" to new id "+fnew