AbstractService.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:FT.Client 作者: aldmbmtl 项目源码 文件源码
def initialize(cls):
        """
This will be called the first time a toolbox of this type is created. This is meant for installing libraries if they are
needed. For example, if you need boto3 for an Amazon Handler, you would call
FloatingTools.installPackage('boto3', 'boto') here. This is also meant for any other set up such as getting login data.

.. note::
    This is only called once during the first call to create a toolbox if this type.

.. code-block:: python
    :linenos:

    @classmethod
    def initialize(cls):
        # install the aws api lib through pip
        FloatingTools.installPackage('boto3', 'boto')

        import boto3
        from botocore.client import Config

        # set log in data for AWS
        os.environ['AWS_ACCESS_KEY_ID'] = cls.userData()['access key']
        os.environ['AWS_SECRET_ACCESS_KEY'] = cls.userData()['secret key']

        cls.CONNECTION = boto3.resource('s3', config=Config(signature_version='s3v4'))
        """
        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号