forked from github/server
update script aktuell
This commit is contained in:
parent
4e2566c933
commit
6f1a253ee3
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue