Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.09 KB | None | 0 0
  1.      def insert_floodlights():
  2.          Workbook.caller()
  3.          service = authenticate.authenticate_user()
  4.          prof_id = authenticate.profile_id(service)
  5.          tags = pd.DataFrame(Range('Create_Floodlights', 'A1').table.value,
  6.                              columns=Range('Create_Floodlights', 'A1').horizontal.value)
  7.          tags.drop(0, inplace=True)
  8.  
  9.          tags['Secure'] = np.where(tags['Secure'] == 'Yes', 'True', 'False')
  10.  
  11.          j = 2
  12.          for index, row in tags.iterrows():
  13.              new_floodlight = {
  14.                  'kind': 'dfareporting#floodlightActivity',
  15.                  'countingMethod': 'STANDARD_COUNTING',
  16.                  'sslRequired': row['Secure'],
  17.                  'floodlightActivityGroupId': row['Floodlight Activity Group ID'],
  18.                  'name': row['Floodlight Name'],
  19.                  'expectedUrl': row['Expected URL']
  20.              }
  21.  
  22.              service.floodlightActivities().insert(profileId=prof_id, body=new_floodlight).execute()
  23.              Range('Create_Floodlights', 'E' + str(j)).value = 'Created'
  24.              j += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement