當前位置: 首頁>>代碼示例>>Python>>正文


Python Settings.SEEDS_AWS_SECRET_ACCESS_KEY方法代碼示例

本文整理匯總了Python中frontera.settings.Settings.SEEDS_AWS_SECRET_ACCESS_KEY方法的典型用法代碼示例。如果您正苦於以下問題:Python Settings.SEEDS_AWS_SECRET_ACCESS_KEY方法的具體用法?Python Settings.SEEDS_AWS_SECRET_ACCESS_KEY怎麽用?Python Settings.SEEDS_AWS_SECRET_ACCESS_KEY使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在frontera.settings.Settings的用法示例。


在下文中一共展示了Settings.SEEDS_AWS_SECRET_ACCESS_KEY方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: setUp

# 需要導入模塊: from frontera.settings import Settings [as 別名]
# 或者: from frontera.settings.Settings import SEEDS_AWS_SECRET_ACCESS_KEY [as 別名]
    def setUp(self):
        self.tmp_path = mkdtemp()
        settings = Settings()
        settings.SEEDS_SOURCE = 's3://some-bucket/seeds-folder'
        settings.SEEDS_AWS_ACCESS_KEY = 'access_key'
        settings.SEEDS_AWS_SECRET_ACCESS_KEY = 'secret_key'
        crawler = type('crawler', (object,), {})
        crawler.settings = settings
        self.seed_path_1 = os.path.join(self.tmp_path, 'seeds1.txt')
        self.seed_path_2 = os.path.join(self.tmp_path, 'seeds2.txt')
        s1_content = """
https://www.example.com
https://www.scrapy.org
"""
        s2_content = """
https://www.dmoz.org
https://www.test.com
"""

        with open(self.seed_path_1, 'wb') as tmpl_file:
            tmpl_file.write(s1_content.encode('utf-8'))
        with open(self.seed_path_2, 'wb') as tmpl_file:
            tmpl_file.write(s2_content.encode('utf-8'))
        self.seed_loader = S3SeedLoader(crawler)
開發者ID:Preetwinder,項目名稱:frontera,代碼行數:26,代碼來源:test_seed_loader.py


注:本文中的frontera.settings.Settings.SEEDS_AWS_SECRET_ACCESS_KEY方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。