Example #1
0
def init_daos():
  global video_format_dao
  global landing_page_dao
  global placement_group_dao
  global campaign_dao
  global creative_association_dao
  global creative_dao
  global placement_dao
  global creative_asset_dao
  global ad_dao
  global event_tag_dao
  global dynamic_targeting_key_dao
  global spreadsheet

  spreadsheet = sheets_get(project.task['auth'], project.task['sheet_id'])

  #store.auth = project.task['auth']
  #store.trix_id = project.task.get('store', {}).get('sheet_id', project.task['sheet_id'])
  #store.load_id_map()

  video_format_dao = VideoFormatDAO(project.task['auth'], project.task['dcm_profile_id'], project.task['is_admin'])
  landing_page_dao = LandingPageDAO(project.task['auth'], project.task['dcm_profile_id'], project.task['is_admin'])
  placement_group_dao = PlacementGroupDAO(project.task['auth'], project.task['dcm_profile_id'], project.task['is_admin'])
  campaign_dao = CampaignDAO(project.task['auth'], project.task['dcm_profile_id'], project.task['is_admin'])
  creative_association_dao = CreativeAssociationDAO(project.task['auth'], project.task['dcm_profile_id'], project.task['is_admin'])
  creative_dao = CreativeDAO(project.task['auth'], project.task['dcm_profile_id'], project.task['is_admin'])
  placement_dao = PlacementDAO(project.task['auth'], project.task['dcm_profile_id'], project.task['is_admin'])
  creative_asset_dao = CreativeAssetDAO( project.task['auth'], project.task['dcm_profile_id'], project.task['is_admin'], project.id)
  ad_dao = AdDAO(project.task['auth'], project.task['dcm_profile_id'], project.task['is_admin'])
  event_tag_dao = EventTagDAO(project.task['auth'], project.task['dcm_profile_id'], project.task['is_admin'])
  dynamic_targeting_key_dao = DynamicTargetingKeyDAO(project.task['auth'], project.task['dcm_profile_id'], project.task['is_admin'])
Example #2
0
  def __init__(self, auth, trix_id, feed_name, parse=True, spreadsheet=None, timezone=None):
    """Initializes the feed with parameters.

    Args:
      auth: The authentication scheme to use based on the json configuration
        file.
      trix_id: Unique identifier of the Google Sheet that represents the
        Bulkdozer feed.
      feed_name: The name of the feed to initialize.
      spreadsheet: Optional, the spreadsheet object representing the Bulkdozer
        feed spreadsheet, useful to limit calls to the sheets API and allow
        multiple Feed objects to use the same spreadsheet instance. This is used
        to determine which tabs exist in the feed so the correct one can be
        selected for the entity this Feed object represents.
    """
    self.auth = auth
    self.trix_id = trix_id
    self.trix_range = 'A1:AZ'
    self.feed_name = feed_name
    self._parse = parse
    self._timezone = timezone or 'America/New_York'

    # TODO: Make sure we only read the spreadsheet object or the list of tabs
    # once
    if spreadsheet:
      self.spreadsheet = spreadsheet
    else:
      self.spreadsheet = sheets_get(self.auth, self.trix_id)

    self.raw_feed = self._get_feed()
    self.feed = self._feed_to_dict(parse=self._parse)