daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. f = open('orgchanges.txt', 'r')
  2.  
  3.  
  4. def AddUpdateOrg(org):
  5.     #TODO
  6.     #find id org by name
  7.     #if not exist insert and get id
  8.     #if exist return id
  9.     return -1
  10.  
  11. def PlayerLookup(id):
  12.     #TODO
  13.     #find player by name
  14.     #return None if you can't
  15.     return None
  16.    
  17. def UpdatePlayerOrg(id,orgId):
  18.     #TODO
  19.     #update statement by playerid and org id
  20.     print("attempting to update", id, orgId)
  21.     pass
  22.    
  23.  
  24. for line in f:
  25.     items = line.strip().split('|')
  26.     org = items[0]
  27.     ids = []
  28.     if len(items) > 1:
  29.         ids = items[1].split(',')
  30.     orgId = AddUpdateOrg(org)
  31.    
  32.     for id in ids:
  33.         if not id.isdigit():
  34.             id = PlayerLookup(id)
  35.         if id != None:
  36.             UpdatePlayerOrg(id,orgId)
  37.         else:
  38.             print("player", id, "not found")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top