コード例 #1
0
def inject_s3_transfer_methods(class_attributes, **kwargs):
    utils.inject_attribute(class_attributes, 'upload_file', upload_file)
    utils.inject_attribute(class_attributes, 'download_file', download_file)
    utils.inject_attribute(class_attributes, 'copy', copy)
    utils.inject_attribute(class_attributes, 'upload_fileobj', upload_fileobj)
    utils.inject_attribute(
        class_attributes, 'download_fileobj', download_fileobj)
コード例 #2
0
ファイル: inject.py プロジェクト: mabuaita/ops
def inject_s3_transfer_methods(class_attributes, **kwargs):
    utils.inject_attribute(class_attributes, 'upload_file', upload_file)
    utils.inject_attribute(class_attributes, 'download_file', download_file)
    utils.inject_attribute(class_attributes, 'copy', copy)
    utils.inject_attribute(class_attributes, 'upload_fileobj', upload_fileobj)
    utils.inject_attribute(
        class_attributes, 'download_fileobj', download_fileobj)
コード例 #3
0
ファイル: inject.py プロジェクト: Mukesh80530/MX-XBlock
def inject_object_methods(class_attributes, **kwargs):
    utils.inject_attribute(class_attributes, 'upload_file', object_upload_file)
    utils.inject_attribute(
        class_attributes, 'download_file', object_download_file)
    utils.inject_attribute(class_attributes, 'copy', object_copy)
    utils.inject_attribute(
        class_attributes, 'upload_fileobj', object_upload_fileobj)
    utils.inject_attribute(
        class_attributes, 'download_fileobj', object_download_fileobj)
コード例 #4
0
 def inject(self, class_attributes, service_context, event_name, **kwargs):
     resource_name = event_name.rsplit(".")[-1]
     action = Action(self.name, self.model, {})
     self.function.__name__ = self.name
     self.function.__doc__ = ActionDocstring(
         resource_name=resource_name,
         event_emitter=self.emitter,
         action_model=action,
         service_model=service_context.service_model,
         include_signature=False)
     inject_attribute(class_attributes, self.name, self.function)
コード例 #5
0
ファイル: action.py プロジェクト: Miserlou/JankyGlance
 def inject(self, class_attributes, service_context, event_name, **kwargs):
     resource_name = event_name.rsplit(".")[-1]
     action = Action(self.name, self.model, {})
     self.function.__name__ = self.name
     self.function.__doc__ = ActionDocstring(
         resource_name=resource_name,
         event_emitter=self.emitter,
         action_model=action,
         service_model=service_context.service_model,
         include_signature=False
     )
     inject_attribute(class_attributes, self.name, self.function)
コード例 #6
0
def inject_object_summary_methods(class_attributes, **kwargs):
    utils.inject_attribute(class_attributes, 'load', object_summary_load)
コード例 #7
0
ファイル: inject.py プロジェクト: mabuaita/ops
def inject_object_summary_methods(class_attributes, **kwargs):
    utils.inject_attribute(class_attributes, 'load', object_summary_load)
コード例 #8
0
ファイル: test_utils.py プロジェクト: timgates42/boto3
 def test_shadowing_existing_var_raises_exception(self):
     class_attributes = {'foo': 'preexisting'}
     with pytest.raises(RuntimeError):
         utils.inject_attribute(class_attributes, 'foo', 'bar')
コード例 #9
0
ファイル: test_utils.py プロジェクト: Armin-Smailzade/boto3
 def test_inject_attributes_with_no_shadowing(self):
     class_attributes = {}
     utils.inject_attribute(class_attributes, 'foo', 'bar')
     self.assertEqual(class_attributes['foo'], 'bar')
コード例 #10
0
ファイル: inject.py プロジェクト: lolo-pop/dast
def inject_bucket_methods(class_attributes, **kwargs):
    utils.inject_attribute(class_attributes, 'load', bucket_load)
    utils.inject_attribute(class_attributes, 'upload_file', bucket_upload_file)
    utils.inject_attribute(class_attributes, 'download_file',
                           bucket_download_file)
コード例 #11
0
ファイル: test_utils.py プロジェクト: Armin-Smailzade/boto3
 def shadows_put_object(class_attributes, **kwargs):
     utils.inject_attribute(class_attributes, 'put_object', 'invalid')
コード例 #12
0
 def shadows_put_object(class_attributes, **kwargs):
     utils.inject_attribute(class_attributes, 'put_object', 'invalid')
コード例 #13
0
ファイル: test_utils.py プロジェクト: Armin-Smailzade/boto3
 def test_shadowing_existing_var_raises_exception(self):
     class_attributes = {'foo': 'preexisting'}
     with self.assertRaises(RuntimeError):
         utils.inject_attribute(class_attributes, 'foo', 'bar')
コード例 #14
0
ファイル: inject.py プロジェクト: bstrand/boto3
def inject_bucket_load(class_attributes, **kwargs):
    utils.inject_attribute(class_attributes, 'load', bucket_load)
コード例 #15
0
ファイル: test_utils.py プロジェクト: timgates42/boto3
 def test_inject_attributes_with_no_shadowing(self):
     class_attributes = {}
     utils.inject_attribute(class_attributes, 'foo', 'bar')
     assert class_attributes['foo'] == 'bar'
コード例 #16
0
ファイル: inject.py プロジェクト: nooptr/dynamodb
def inject_bucket_load(class_attributes, **kwargs):
    utils.inject_attribute(class_attributes, 'load', bucket_load)
コード例 #17
0
ファイル: inject.py プロジェクト: Armin-Smailzade/boto3
def inject_bucket_methods(class_attributes, **kwargs):
    utils.inject_attribute(class_attributes, 'load', bucket_load)
    utils.inject_attribute(class_attributes, 'upload_file', bucket_upload_file)
    utils.inject_attribute(
        class_attributes, 'download_file', bucket_download_file)