示例#1
0
 def __init__(self, bucket=BUCKET_NAME, 
                    bucket_url=BUCKET_URL,
                    enable_link_token=ENABLE_LINK_TOKEN,
                    link_token=LINK_TOKEN,
                    link_expiration=LINK_EXPIRATION,
                    operator_name=OPERATOR_NAME, 
                    operator_password=OPERATOR_PASSWORD):
     self.bucket = bucket
     self.operator_name = operator_name
     self.operator_password = operator_password
     self.bucket_url = bucket_url
     self.enable_link_token = enable_link_token
     self.link_token = link_token
     self.link_expiration = link_expiration
     if not bucket or not operator_name or not operator_password:
         raise ImproperlyConfigured('bucket , opeartor_name, operator_password is requied')
     self.upyun_client = UpYun(self.bucket, self.operator_name, self.operator_password)