当前位置: 首页>>代码示例>>Python>>正文


Python SESConnection.list_verified_email_addresses方法代码示例

本文整理汇总了Python中boto.ses.SESConnection.list_verified_email_addresses方法的典型用法代码示例。如果您正苦于以下问题:Python SESConnection.list_verified_email_addresses方法的具体用法?Python SESConnection.list_verified_email_addresses怎么用?Python SESConnection.list_verified_email_addresses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在boto.ses.SESConnection的用法示例。


在下文中一共展示了SESConnection.list_verified_email_addresses方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: handle

# 需要导入模块: from boto.ses import SESConnection [as 别名]
# 或者: from boto.ses.SESConnection import list_verified_email_addresses [as 别名]
 def handle(self, *args, **options):
     
     verbosity = options.get('verbosity', 0)
     add_email = options.get('add', False)
     delete_email = options.get('delete', False)
     list_emails = options.get('list', False)
     
     access_key_id = getattr(settings, 'AWS_ACCESS_KEY_ID', None)
     access_key = getattr(settings, 'AWS_SECRET_ACCESS_KEY', None)
     api_endpoint = getattr(settings, 'AWS_SES_API_HOST',
                                  SESConnection.DefaultHost)
     
     connection = SESConnection(
             aws_access_key_id=access_key_id,
             aws_secret_access_key=access_key,
             host=api_endpoint,
         )
     
     if add_email:
         if verbosity != '0':
             print "Adding email: %s"  % add_email
         connection.verify_email_address(add_email)
     elif delete_email:
         if verbosity != '0':
             print "Removing email: %s" % delete_email
         connection.delete_verified_email_address(delete_email)
     elif list_emails:
         if verbosity != '0':
             print "Fetching list of verified emails:"
         response = connection.list_verified_email_addresses()
         emails = response['ListVerifiedEmailAddressesResponse']['ListVerifiedEmailAddressesResult']['VerifiedEmailAddresses']
         for email in emails:
             print email
开发者ID:Teaspiller,项目名称:django-ses,代码行数:35,代码来源:ses_email_address.py

示例2: handle

# 需要导入模块: from boto.ses import SESConnection [as 别名]
# 或者: from boto.ses.SESConnection import list_verified_email_addresses [as 别名]
    def handle(self, *args, **options):

        verbosity = options.get("verbosity", 0)
        add_email = options.get("add", False)
        delete_email = options.get("delete", False)
        list_emails = options.get("list", False)

        access_key_id = getattr(settings, "AWS_ACCESS_KEY_ID", None)
        access_key = getattr(settings, "AWS_SECRET_ACCESS_KEY", None)

        connection = SESConnection(aws_access_key_id=access_key_id, aws_secret_access_key=access_key)

        if add_email:
            if verbosity != "0":
                print "Adding email: %s" % add_email
            connection.verify_email_address(add_email)
        elif delete_email:
            if verbosity != "0":
                print "Removing email: %s" % delete_email
            connection.delete_verified_email_address(delete_email)
        elif list_emails:
            if verbosity != "0":
                print "Fetching list of verified emails:"
            response = connection.list_verified_email_addresses()
            emails = response["ListVerifiedEmailAddressesResponse"]["ListVerifiedEmailAddressesResult"][
                "VerifiedEmailAddresses"
            ]
            for email in emails:
                print email
开发者ID:philipkimmey,项目名称:django-ses,代码行数:31,代码来源:ses_email_address.py

示例3: handle

# 需要导入模块: from boto.ses import SESConnection [as 别名]
# 或者: from boto.ses.SESConnection import list_verified_email_addresses [as 别名]
    def handle(self, *args, **options):

        verbosity = options.get('verbosity', 0)
        add_email = options.get('add', False)
        delete_email = options.get('delete', False)
        list_emails = options.get('list', False)

        access_key_id = settings.ACCESS_KEY
        access_key = settings.SECRET_KEY
        region = RegionInfo(
            name=settings.AWS_SES_REGION_NAME,
            endpoint=settings.AWS_SES_REGION_ENDPOINT)

        connection = SESConnection(
                aws_access_key_id=access_key_id,
                aws_secret_access_key=access_key,
                region=region)

        if add_email:
            if verbosity != '0':
                print "Adding email: %s" % add_email
            connection.verify_email_address(add_email)
        elif delete_email:
            if verbosity != '0':
                print "Removing email: %s" % delete_email
            connection.delete_verified_email_address(delete_email)
        elif list_emails:
            if verbosity != '0':
                print "Fetching list of verified emails:"
            response = connection.list_verified_email_addresses()
            emails = response['ListVerifiedEmailAddressesResponse'][
                'ListVerifiedEmailAddressesResult']['VerifiedEmailAddresses']
            for email in emails:
                print email
开发者ID:tricoder42,项目名称:django-ses,代码行数:36,代码来源:ses_email_address.py

示例4: dashboard

# 需要导入模块: from boto.ses import SESConnection [as 别名]
# 或者: from boto.ses.SESConnection import list_verified_email_addresses [as 别名]
def dashboard(request):
    """
    Graph SES send statistics over time.
    """
    cache_key = 'vhash:django_ses_stats'
    cached_view = cache.get(cache_key)
    if cached_view:
        return cached_view

    region = RegionInfo(
        name=getattr(settings, 'AWS_SES_REGION_NAME',
            SESConnection.DefaultRegionName),
        endpoint=getattr(settings, 'AWS_SES_REGION_ENDPOINT',
            SESConnection.DefaultRegionEndpoint))

    ses_conn = SESConnection(
        aws_access_key_id=getattr(settings, 'AWS_ACCESS_KEY_ID', None),
        aws_secret_access_key=getattr(settings, 'AWS_SECRET_ACCESS_KEY', None),
        region=region)

    quota_dict = ses_conn.get_send_quota()
    verified_emails_dict = ses_conn.list_verified_email_addresses()
    stats = ses_conn.get_send_statistics()

    quota = quota_parse(quota_dict)
    verified_emails = emails_parse(verified_emails_dict)
    ordered_data = stats_to_list(stats)
    summary = sum_stats(ordered_data)

    extra_context = {
        'title': 'SES Statistics',
        'datapoints': ordered_data,
        '24hour_quota': quota['Max24HourSend'],
        '24hour_sent': quota['SentLast24Hours'],
        '24hour_remaining': float(quota['Max24HourSend']) -
                            float(quota['SentLast24Hours']),
        'persecond_rate': quota['MaxSendRate'],
        'verified_emails': verified_emails,
        'summary': summary,
        'access_key': ses_conn.gs_access_key_id,
        'local_time': True if pytz else False,
    }

    response = render_to_response(
        'django_ses/send_stats.html',
        extra_context,
        context_instance=RequestContext(request))

    cache.set(cache_key, response, 60 * 15)  # Cache for 15 minutes
    return response
开发者ID:mediapop,项目名称:django-ses,代码行数:52,代码来源:views.py

示例5: dashboard

# 需要导入模块: from boto.ses import SESConnection [as 别名]
# 或者: from boto.ses.SESConnection import list_verified_email_addresses [as 别名]
def dashboard(request):
    """
    Graph SES send statistics over time.
    """
    cache_key = 'vhash:django_ses_stats'
    cached_view = cache.get(cache_key)
    if cached_view:
        return cached_view

    region = RegionInfo(
        name=settings.AWS_SES_REGION_NAME,
        endpoint=settings.AWS_SES_REGION_ENDPOINT)

    ses_conn = SESConnection(
        aws_access_key_id=settings.ACCESS_KEY,
        aws_secret_access_key=settings.SECRET_KEY,
        region=region,
        proxy=settings.AWS_SES_PROXY,
        proxy_port=settings.AWS_SES_PROXY_PORT,
    )

    quota_dict = ses_conn.get_send_quota()
    verified_emails_dict = ses_conn.list_verified_email_addresses()
    stats = ses_conn.get_send_statistics()

    quota = quota_parse(quota_dict)
    verified_emails = emails_parse(verified_emails_dict)
    ordered_data = stats_to_list(stats)
    summary = sum_stats(ordered_data)

    extra_context = {
        'title': 'SES Statistics',
        'datapoints': ordered_data,
        '24hour_quota': quota['Max24HourSend'],
        '24hour_sent': quota['SentLast24Hours'],
        '24hour_remaining': float(quota['Max24HourSend']) -
                            float(quota['SentLast24Hours']),
        'persecond_rate': quota['MaxSendRate'],
        'verified_emails': verified_emails,
        'summary': summary,
        'access_key': ses_conn.gs_access_key_id,
        'local_time': True,
    }

    response = render(request, 'django_ses/send_stats.html', extra_context)

    cache.set(cache_key, response, 60 * 15)  # Cache for 15 minutes
    return response
开发者ID:django-ses,项目名称:django-ses,代码行数:50,代码来源:views.py

示例6: dashboard

# 需要导入模块: from boto.ses import SESConnection [as 别名]
# 或者: from boto.ses.SESConnection import list_verified_email_addresses [as 别名]
def dashboard(request):
    """
    Graph SES send statistics over time.
    """
    cache_key = "vhash:django_ses_stats"
    cached_view = cache.get(cache_key)
    if cached_view:
        return cached_view

    region = RegionInfo(name=settings.AWS_SES_REGION_NAME, endpoint=settings.AWS_SES_REGION_ENDPOINT)

    ses_conn = SESConnection(
        aws_access_key_id=settings.ACCESS_KEY,
        aws_secret_access_key=settings.SECRET_KEY,
        region=region,
        boto_profile_name=settings.BOTO_PROFILE_NAME,
    )

    quota_dict = ses_conn.get_send_quota()
    verified_emails_dict = ses_conn.list_verified_email_addresses()
    stats = ses_conn.get_send_statistics()

    quota = quota_parse(quota_dict)
    verified_emails = emails_parse(verified_emails_dict)
    ordered_data = stats_to_list(stats)
    summary = sum_stats(ordered_data)

    extra_context = {
        "title": "SES Statistics",
        "datapoints": ordered_data,
        "24hour_quota": quota["Max24HourSend"],
        "24hour_sent": quota["SentLast24Hours"],
        "24hour_remaining": float(quota["Max24HourSend"]) - float(quota["SentLast24Hours"]),
        "persecond_rate": quota["MaxSendRate"],
        "verified_emails": verified_emails,
        "summary": summary,
        "access_key": ses_conn.gs_access_key_id,
        "local_time": True if pytz else False,
    }

    response = render_to_response("django_ses/send_stats.html", extra_context, context_instance=RequestContext(request))

    cache.set(cache_key, response, 60 * 15)  # Cache for 15 minutes
    return response
开发者ID:ibraheem4,项目名称:django-ses,代码行数:46,代码来源:views.py

示例7: handle

# 需要导入模块: from boto.ses import SESConnection [as 别名]
# 或者: from boto.ses.SESConnection import list_verified_email_addresses [as 别名]
    def handle(self, *args, **options):

        verbosity = options.get('verbosity', 0)
        add_email = options.get('add', False)
        delete_email = options.get('delete', False)
        list_emails = options.get('list', False)

        access_key_id = settings.ACCESS_KEY
        access_key = settings.SECRET_KEY
        region = RegionInfo(
            name=settings.AWS_SES_REGION_NAME,
            endpoint=settings.AWS_SES_REGION_ENDPOINT)
        proxy = settings.AWS_SES_PROXY
        proxy_port = settings.AWS_SES_PROXY_PORT
        proxy_user = settings.AWS_SES_PROXY_USER
        proxy_pass = settings.AWS_SES_PROXY_PASS


        connection = SESConnection(
                aws_access_key_id=access_key_id,
                aws_secret_access_key=access_key,
                region=region,
                proxy=proxy,
                proxy_port=proxy_port,
                proxy_user=proxy_user,
                proxy_pass=proxy_pass,
        )

        if add_email:
            if verbosity != '0':
                print("Adding email: " + add_email)
            connection.verify_email_address(add_email)
        elif delete_email:
            if verbosity != '0':
                print("Removing email: " + delete_email)
            connection.delete_verified_email_address(delete_email)
        elif list_emails:
            if verbosity != '0':
                print("Fetching list of verified emails:")
            response = connection.list_verified_email_addresses()
            emails = response['ListVerifiedEmailAddressesResponse'][
                'ListVerifiedEmailAddressesResult']['VerifiedEmailAddresses']
            for email in emails:
                print(email)
开发者ID:GradConnection,项目名称:django-ses,代码行数:46,代码来源:ses_email_address.py


注:本文中的boto.ses.SESConnection.list_verified_email_addresses方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。