Hackfut Security File Manager
Current Path:
/usr/lib/python2.6/site-packages/boto/beanstalk
usr
/
lib
/
python2.6
/
site-packages
/
boto
/
beanstalk
/
📁
..
📄
__init__.py
(1.64 KB)
📄
__init__.pyc
(1009 B)
📄
__init__.pyo
(1009 B)
📄
exception.py
(2.08 KB)
📄
exception.pyc
(6.63 KB)
📄
exception.pyo
(6.63 KB)
📄
layer1.py
(54.94 KB)
📄
layer1.pyc
(49.47 KB)
📄
layer1.pyo
(49.47 KB)
📄
response.py
(27.39 KB)
📄
response.pyc
(33.28 KB)
📄
response.pyo
(33.28 KB)
📄
wrapper.py
(1.05 KB)
📄
wrapper.pyc
(1.91 KB)
📄
wrapper.pyo
(1.91 KB)
Editing: wrapper.py
"""Wraps layer1 api methods and converts layer1 dict responses to objects.""" from boto.beanstalk.layer1 import Layer1 import boto.beanstalk.response from boto.exception import BotoServerError import boto.beanstalk.exception as exception def beanstalk_wrapper(func, name): def _wrapped_low_level_api(*args, **kwargs): try: response = func(*args, **kwargs) except BotoServerError as e: raise exception.simple(e) # Turn 'this_is_a_function_name' into 'ThisIsAFunctionNameResponse'. cls_name = ''.join([part.capitalize() for part in name.split('_')]) + 'Response' cls = getattr(boto.beanstalk.response, cls_name) return cls(response) return _wrapped_low_level_api class Layer1Wrapper(object): def __init__(self, *args, **kwargs): self.api = Layer1(*args, **kwargs) def __getattr__(self, name): try: return beanstalk_wrapper(getattr(self.api, name), name) except AttributeError: raise AttributeError("%s has no attribute %r" % (self, name))
Upload File
Create Folder