Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f = open('orgchanges.txt', 'r')
- def AddUpdateOrg(org):
- #TODO
- #find id org by name
- #if not exist insert and get id
- #if exist return id
- return -1
- def PlayerLookup(id):
- #TODO
- #find player by name
- #return None if you can't
- return None
- def UpdatePlayerOrg(id,orgId):
- #TODO
- #update statement by playerid and org id
- print("attempting to update", id, orgId)
- pass
- for line in f:
- items = line.strip().split('|')
- org = items[0]
- ids = []
- if len(items) > 1:
- ids = items[1].split(',')
- orgId = AddUpdateOrg(org)
- for id in ids:
- if not id.isdigit():
- id = PlayerLookup(id)
- if id != None:
- UpdatePlayerOrg(id,orgId)
- else:
- print("player", id, "not found")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement