rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
class rml_styles_plus(trml2pdf._rml_styles): """This is a hack of _rml_styles to support CJK wordWrap. """ def _para_style_update(self, style, node): """Extended _rml_styles._para_style_update to support wordWrap. """ style = super(rml_styles_plus, self)._para_style_update(style, node) for attr in ['wordWrap']: if node... | def find_resource_abspath(path, resource_dirs): return find_resource_path(path, resource_dirs, absolute=True) | |
doc = rml_doc_plus(rml, font_resolver) | doc = trml2pdf._rml_doc(rml, font_resolver) | def rml2pdf(rml, font_resolver=None): """Generates CJK-aware PDF using monkeypatched trml2pdf. """ doc = rml_doc_plus(rml, font_resolver) buf = StringIO() doc.render(buf) return buf.getvalue() |
if value == None: return None | if value in (None, []): return [] | def encode_list(self, prop, value): if value == None: return None if not isinstance(value, list): # This is a little trick to avoid encoding when it's just a single value, # since that most likely means it's from a query item_type = getattr(prop, "item_type") return self.encode(item_type, value) # Just enumerate(value)... |
k,v = self.decode_map_element(item_type, val) try: k = int(k) except: k = v dec_val[k] = v | if val != "None" and val != None: k,v = self.decode_map_element(item_type, val) try: k = int(k) except: k = v dec_val[k] = v | def decode_list(self, prop, value): if not isinstance(value, list): value = [value] if hasattr(prop, 'item_type'): item_type = getattr(prop, "item_type") dec_val = {} for val in value: k,v = self.decode_map_element(item_type, val) try: k = int(k) except: k = v dec_val[k] = v value = dec_val.values() return value |
if type(expiration_time) != time.struct_time: raise 'Policy document must include a valid expiration Time object' | assert type(expiration_time) == time.struct_time, \ 'Policy document must include a valid expiration Time object' | def build_post_policy(self, expiration_time, conditions): """ Taken from the AWS book Python examples and modified for use with boto """ if type(expiration_time) != time.struct_time: raise 'Policy document must include a valid expiration Time object' |
if len(args) == 3 and not (args[2].islower() or args[2].isalnum()): raise BotoClientError("Bucket names cannot contain upper-case " \ "characters when using either the sub-domain or virtual " \ "hosting calling format.") | if len(args) == 3 and check_lowercase_bucketname(args[2]): pass | def wrapper(*args, **kwargs): if len(args) == 3 and not (args[2].islower() or args[2].isalnum()): raise BotoClientError("Bucket names cannot contain upper-case " \ "characters when using either the sub-domain or virtual " \ "hosting calling format.") return f(*args, **kwargs) |
if not bucket_name.islower(): raise Exception("Bucket names must be lower case.") | check_lowercase_bucketname(bucket_name) | def create_bucket(self, bucket_name, headers=None, location=Location.DEFAULT, policy=None): """ Creates a new located bucket. By default it's in the USA. You can pass Location.EU to create an European bucket. |
self.ownerId = None | self.ownerId = None self.owner_id = None | def __init__(self, connection=None): TaggedEC2Object.__init__(self, connection) self.id = None self.location = None self.state = None self.ownerId = None self.owner_alias = None self.is_public = False self.architecture = None self.platform = None self.type = None self.kernel_id = None self.ramdisk_id = None self.name =... |
self.ownerId = value | self.ownerId = value self.owner_id = value | def endElement(self, name, value, connection): if name == 'imageId': self.id = value elif name == 'imageLocation': self.location = value elif name == 'imageState': self.state = value elif name == 'imageOwnerId': self.ownerId = value elif name == 'isPublic': if value == 'false': self.is_public = False elif value == 'tru... |
:rtype: :class:`boto.sns.IAMConnection` | :rtype: :class:`boto.iam.IAMConnection` | def connect_iam(aws_access_key_id=None, aws_secret_access_key=None, **kwargs): """ :type aws_access_key_id: string :param aws_access_key_id: Your AWS Access Key ID :type aws_secret_access_key: string :param aws_secret_access_key: Your AWS Secret Access Key :rtype: :class:`boto.sns.IAMConnection` :return: A connection... |
:rtype: :class:`boto.sns.IAMConnection` :return: A connection to Amazon's IAM | :rtype: :class:`boto.ec2.connection.EC2Connection` :return: A connection to Eucalyptus server | def connect_euca(host, aws_access_key_id=None, aws_secret_access_key=None, port=8773, path='/services/Eucalyptus', is_secure=False, **kwargs): """ Connect to a Eucalyptus service. :type host: string :param host: the host name or ip address of the Eucalyptus server :type aws_access_key_id: string :param aws_access_key... |
:rtype: :class:`boto.sns.IAMConnection` :return: A connection to Amazon's IAM | :rtype: :class:`boto.s3.connection.S3Connection` :return: A connection to Walrus | def connect_walrus(host, aws_access_key_id=None, aws_secret_access_key=None, port=8773, path='/services/Walrus', is_secure=False, **kwargs): """ Connect to a Walrus service. :type host: string :param host: the host name or ip address of the Walrus server :type aws_access_key_id: string :param aws_access_key_id: Your ... |
super(BotoClientError, self).__init__() | def __init__(self, reason): self.reason = reason super(BotoClientError, self).__init__() | |
super(BotoServerError, self).__init__() | def __init__(self, status, reason, body=None): self.status = status self.reason = reason self.body = body or '' self.request_id = None self.error_code = None self.error_message = None self.box_usage = None | |
super(SQSDecodeError, self).__init__(reason) | def __init__(self, reason, message): self.message = message super(SQSDecodeError, self).__init__(reason) | |
raise S3ResponseError(self.resp.status, self.resp.reason) | body = self.resp.read() raise S3ResponseError(self.resp.status, self.resp.reason, body) | def open_read(self, headers=None, query_args=None): """ Open this key for reading :type headers: dict :param headers: Headers to pass in the web request :type query_args: string :param query_args: Arguments to pass in the query string (ie, 'torrent') """ if self.resp == None: self.mode = 'r' self.resp = self.bucket.... |
raise FPSResponseError(response.status, respons.reason, body) | raise FPSResponseError(response.status, response.reason, body) | def install_caller_instruction(self, token_type="Unrestricted", transaction_id=None): """ Set us up as a caller This will install a new caller_token into the FPS section. This should really only be called to regenerate the caller token. """ response = self.install_payment_instruction("MyRole=='Caller';", token_type=tok... |
raise FPSResponseError(response.status, respons.reason, body) | raise FPSResponseError(response.status, response.reason, body) | def install_recipient_instruction(self, token_type="Unrestricted", transaction_id=None): """ Set us up as a Recipient This will install a new caller_token into the FPS section. This should really only be called to regenerate the recipient token. """ response = self.install_payment_instruction("MyRole=='Recipient';", to... |
num_instances, keep_alive) | num_instances, keep_alive, hadoop_version) | def run_jobflow(self, name, log_uri, ec2_keyname=None, availability_zone=None, master_instance_type='m1.small', slave_instance_type='m1.small', num_instances=1, action_on_failure='TERMINATE_JOB_FLOW', keep_alive=False, enable_debugging=False, steps=[]): """ Runs a job flow |
slave_instance_type, num_instances, keep_alive): | slave_instance_type, num_instances, keep_alive, hadoop_version): | def _build_instance_args(self, ec2_keyname, availability_zone, master_instance_type, slave_instance_type, num_instances, keep_alive): params = { 'Instances.MasterInstanceType' : master_instance_type, 'Instances.SlaveInstanceType' : slave_instance_type, 'Instances.InstanceCount' : num_instances, 'Instances.KeepJobFlowAl... |
'Instances.KeepJobFlowAliveWhenNoSteps' : str(keep_alive).lower() | 'Instances.KeepJobFlowAliveWhenNoSteps' : str(keep_alive).lower(), 'Instances.HadoopVersion' : hadoop_version | def _build_instance_args(self, ec2_keyname, availability_zone, master_instance_type, slave_instance_type, num_instances, keep_alive): params = { 'Instances.MasterInstanceType' : master_instance_type, 'Instances.SlaveInstanceType' : slave_instance_type, 'Instances.InstanceCount' : num_instances, 'Instances.KeepJobFlowAl... |
return conn.get_bucket(self.bucket_name, validate, headers) | bucket = conn.get_bucket(self.bucket_name, validate, headers) self.check_response(bucket, 'bucket', self.uri) return bucket | def get_bucket(self, validate=True, headers=None): if self.bucket_name is None: raise InvalidUriError('get_bucket on bucket-less URI (%s)' % self.uri) conn = self.connect() return conn.get_bucket(self.bucket_name, validate, headers) |
return bucket.get_key(self.object_name, headers, version_id) | key = bucket.get_key(self.object_name, headers, version_id) self.check_response(key, 'key', self.uri) return key | def get_key(self, validate=True, headers=None, version_id=None): if not self.object_name: raise InvalidUriError('get_key on object-less URI (%s)' % self.uri) bucket = self.get_bucket(validate, headers) return bucket.get_key(self.object_name, headers, version_id) |
return conn.provider.acl_class | acl_class = conn.provider.acl_class self.check_response(acl_class, 'acl_class', self.uri) return acl_class | def acl_class(self): if self.bucket_name is None: raise InvalidUriError('acl_class on bucket-less URI (%s)' % self.uri) conn = self.connect() return conn.provider.acl_class |
return conn.provider.canned_acls | canned_acls = conn.provider.canned_acls self.check_response(canned_acls, 'canned_acls', self.uri) return canned_acls | def canned_acls(self): if self.bucket_name is None: raise InvalidUriError('canned_acls on bucket-less URI (%s)' % self.uri) conn = self.connect() return conn.provider.canned_acls |
return bucket.get_acl(self.object_name, headers, version_id) | acl = bucket.get_acl(self.object_name, headers, version_id) self.check_response(acl, 'acl', self.uri) return acl | def get_acl(self, validate=True, headers=None, version_id=None): if not self.bucket_name: raise InvalidUriError('get_acl on bucket-less URI (%s)' % self.uri) bucket = self.get_bucket(validate, headers) # This works for both bucket- and object- level ACLs (former passes # key_name=None): return bucket.get_acl(self.objec... |
return conn.provider | provider = conn.provider self.check_response(provider, 'provider', self.uri) return provider | def get_provider(self): conn = self.connect() return conn.provider |
pass | def __init__(self, connection): BaseAutoResultElement.__init__(self, connection) self.fields = [] self.qid = None def endElement(self, name, value, connection): if name == 'QuestionIdentifier': self.qid = value elif name == 'FreeText' and self.qid: self.fields.append((self.qid,value)) elif name == 'Answer': self.qid =... | def endElement(self, name, value, connection): # the answer consists of embedded XML, so it needs to be parsed independantly if name == 'Answer': answer_rs = ResultSet([('Answer', QuestionFormAnswer),]) h = handler.XmlHandler(answer_rs, connection) value = self.connection.get_utf8_value(value) xml.sax.parseString(value... |
if lk in ['content-md5', 'content-type', 'date'] or lk.startswith(AMAZON_HEADER_PREFIX): | if headers[key] != None and (lk in ['content-md5', 'content-type', 'date'] or lk.startswith(AMAZON_HEADER_PREFIX)): | def canonical_string(method, path, headers, expires=None): interesting_headers = {} for key in headers: lk = key.lower() if lk in ['content-md5', 'content-type', 'date'] or lk.startswith(AMAZON_HEADER_PREFIX): interesting_headers[lk] = headers[key].strip() # these keys get empty strings if they don't exist if not inte... |
if response.status != 200: raise CloudFrontServerError(response.status, response.reason, body) | def _set_config(self, distribution_id, etag, config): if isinstance(config, StreamingDistributionConfig): resource = 'streaming-distribution' else: resource = 'distribution' uri = '/%s/%s/%s/config' % (self.Version, resource, distribution_id) headers = {'If-Match' : etag, 'Content-Type' : 'text/xml'} response = self.ma... | |
monitoring_enabled=False, subnet_id=None): | monitoring_enabled=False, subnet_id=None, block_device_map=None): | def run(self, min_count=1, max_count=1, key_name=None, security_groups=None, user_data=None, addressing_type=None, instance_type='m1.small', placement=None, kernel_id=None, ramdisk_id=None, monitoring_enabled=False, subnet_id=None): """ Runs this instance. :type min_count: int :param min_count: The minimum number of i... |
monitoring_enabled, subnet_id) | monitoring_enabled, subnet_id, block_device_map) | def run(self, min_count=1, max_count=1, key_name=None, security_groups=None, user_data=None, addressing_type=None, instance_type='m1.small', placement=None, kernel_id=None, ramdisk_id=None, monitoring_enabled=False, subnet_id=None): """ Runs this instance. :type min_count: int :param min_count: The minimum number of i... |
def get_all_load_balancers(self, load_balancer_name=None): | def get_all_load_balancers(self, load_balancer_names=None): | def get_all_load_balancers(self, load_balancer_name=None): """ Retrieve all load balancers associated with your account. |
:type load_balancer_names: str :param load_balancer_names: An optional filter string to get only one ELB | :type load_balancer_names: list :param load_balancer_names: An optional list of load balancer names | def get_all_load_balancers(self, load_balancer_name=None): """ Retrieve all load balancers associated with your account. |
if load_balancer_name: params['LoadBalancerName'] = load_balancer_name | if load_balancer_names: self.build_list_params(params, load_balancer_names, 'LoadBalancerNames.member.%d') | def get_all_load_balancers(self, load_balancer_name=None): """ Retrieve all load balancers associated with your account. |
self.connection.configure_health_check(self.name, health_check) | return self.connection.configure_health_check(self.name, health_check) | def configure_health_check(self, health_check): self.connection.configure_health_check(self.name, health_check) |
page_size=10, page_number=1): | page_size=10, page_number=1, response_groups=None): | def search_hits(self, sort_by='CreationTime', sort_direction='Ascending', page_size=10, page_number=1): """ Return all of a Requester's HITs, on behalf of the Requester. The operation returns HITs of any status, except for HITs that have been disposed with the DisposeHIT operation. Note: The SearchHITs operation does n... |
page_size=10, page_number=1): | page_size=10, page_number=1, response_groups=None): | def get_assignments(self, hit_id, status=None, sort_by='SubmitTime', sort_direction='Ascending', page_size=10, page_number=1): """ Retrieves completed assignments for a HIT. Use this operation to retrieve the results for a HIT. |
return self._process_request('GetAssignmentsForHIT', params, [('Assignment', Assignment),]) | if response_groups: self.build_list_params(params, response_groups, 'ResponseGroup') return self._process_request('GetAssignmentsForHIT', params, [('Assignment', Assignment),]) | def get_assignments(self, hit_id, status=None, sort_by='SubmitTime', sort_direction='Ascending', page_size=10, page_number=1): """ Retrieves completed assignments for a HIT. Use this operation to retrieve the results for a HIT. |
def get_hit(self, hit_id): | def get_hit(self, hit_id, response_groups=None): | def get_hit(self, hit_id): """ """ params = {'HITId' : hit_id,} return self._process_request('GetHIT', params, [('HIT', HIT),]) |
def disable_hit(self, hit_id): """ Remove a HIT from the Mechanical Turk marketplace, approves all submitted assignments that have not already been approved or rejected, and disposes of the HIT and all assignment data. Assignments for the HIT that have already been submitted, but not yet approved or rejected, will be ... | def disable_hit(self, hit_id, response_groups=None): """ Remove a HIT from the Mechanical Turk marketplace, approves all submitted assignments that have not already been approved or rejected, and disposes of the HIT and all assignment data. Assignments for the HIT that have already been submitted, but not yet approved... | def disable_hit(self, hit_id): """ Remove a HIT from the Mechanical Turk marketplace, approves all submitted assignments that have not already been approved or rejected, and disposes of the HIT and all assignment data. |
for subclass in cls.__sub_classes__: type_query += " or `__type__` = '%s'" % subclass.__name__ | for subclass in self._get_all_decendents(cls).keys(): type_query += " or `__type__` = '%s'" % subclass | def _build_filter_part(self, cls, filters, order_by=None): """ Build the filter part """ import types query_parts = [] order_by_filtered = False if order_by: if order_by[0] == "-": order_by_method = "desc"; order_by = order_by[1:] else: order_by_method = "asc"; |
def get_all_mfa_devices(self, marker=None, max_items=None, user_name=None): | def get_all_mfa_devices(self, user_name, marker=None, max_items=None): | def get_all_mfa_devices(self, marker=None, max_items=None, user_name=None): """ Get all MFA devices associated with an account. |
If the user_name is not specified, it is determined implicitly based on the AWS Access Key ID used to sign the request. | :type user_name: string :param user_name: The username of the user | def get_all_mfa_devices(self, marker=None, max_items=None, user_name=None): """ Get all MFA devices associated with an account. |
:type user_name: string :param user_name: The username of the user """ params = {} | """ params = {'UserName' : user_name} | def get_all_mfa_devices(self, marker=None, max_items=None, user_name=None): """ Get all MFA devices associated with an account. |
if user_name: params['UserName'] = user_name | def get_all_mfa_devices(self, marker=None, max_items=None, user_name=None): """ Get all MFA devices associated with an account. | |
if sys.version[:3] == "2.6" and port == 443: | if sys.version[:3] in ('2.6', '2.7') and port == 443: | def server_name(self, port=None): if not port: port = self.port if port == 80: signature_host = self.host else: # This unfortunate little hack can be attributed to # a difference in the 2.6 version of httplib. In old # versions, it would append ":443" to the hostname sent # in the Host header and so we needed to make ... |
def add_grant(self, owner_id=None, name=None, cidr_ip=None): | def add_grant(self, name=None, owner_id=None, cidr_ip=None): | def add_grant(self, owner_id=None, name=None, cidr_ip=None): grant = GroupOrCIDR(self) grant.owner_id = owner_id grant.name = name grant.cidr_ip = cidr_ip self.grants.append(grant) return grant |
duration=60*60*24*7, approval_delay=None, annotation=None, qual_req=None, | duration=60*60*24*7, approval_delay=None, annotation=None, | def create_hit(self, hit_type=None, question=None, lifetime=60*60*24*7, max_assignments=1, title=None, description=None, keywords=None, reward=None, duration=60*60*24*7, approval_delay=None, annotation=None, qual_req=None, questions=None, qualifications=None, response_groups=None): """ Creates a new HIT. Returns a Resu... |
final_keywords = ', '.join(keywords) elif type(keywords) is str: | keywords = ', '.join(keywords) if type(keywords) is str: | def get_keywords_as_string(keywords): """ Returns a comma+space-separated string of keywords from either a list or a string """ if type(keywords) is list: final_keywords = ', '.join(keywords) elif type(keywords) is str: final_keywords = keywords elif type(keywords) is unicode: final_keywords = keywords.encode('utf-8') ... |
fp.write('mv %s /mnt/boto.cfg; ' % BotoConfigPath) fp.write('mv /root/.ssh/authorized_keys /mnt/authorized_keys; ') | fp.write('sudo mv %s /mnt/boto.cfg; ' % BotoConfigPath) fp.write('mv ~/.ssh/authorized_keys /mnt/authorized_keys; ') | def bundle(self, bucket=None, prefix=None, key_file=None, cert_file=None, size=None, ssh_key=None, fp=None, clear_history=True): iobject = IObject() if not bucket: bucket = iobject.get_string('Name of S3 bucket') if not prefix: prefix = iobject.get_string('Prefix for AMI file') if not key_file: key_file = iobject.get_f... |
fp.write('mv /mnt/boto.cfg %s; ' % BotoConfigPath) fp.write('mv /mnt/authorized_keys /root/.ssh/authorized_keys\n') | fp.write('sudo mv /mnt/boto.cfg %s; ' % BotoConfigPath) fp.write('mv /mnt/authorized_keys ~/.ssh/authorized_keys') | def bundle(self, bucket=None, prefix=None, key_file=None, cert_file=None, size=None, ssh_key=None, fp=None, clear_history=True): iobject = IObject() if not bucket: bucket = iobject.get_string('Name of S3 bucket') if not prefix: prefix = iobject.get_string('Prefix for AMI file') if not key_file: key_file = iobject.get_f... |
self.image_id = self.server.ec2.register_image('%s/%s.manifest.xml' % (bucket, prefix)) | self.image_id = self.server.ec2.register_image(name=prefix, image_location='%s/%s.manifest.xml' % (bucket, prefix)) | def bundle(self, bucket=None, prefix=None, key_file=None, cert_file=None, size=None, ssh_key=None, fp=None, clear_history=True): iobject = IObject() if not bucket: bucket = iobject.get_string('Name of S3 bucket') if not prefix: prefix = iobject.get_string('Prefix for AMI file') if not key_file: key_file = iobject.get_f... |
signature= boto.utils.encode(self.aws_secret_access_key, url, True) | def make_url(self, returnURL, paymentReason, pipelineName, **params): """ Generate the URL with the signature required for a transaction """ params['callerKey'] = str(self.aws_access_key_id) params['returnURL'] = str(returnURL) params['paymentReason'] = str(paymentReason) params['pipelineName'] = pipelineName | |
hmac.updaet(canonical) | hmac.update(canonical) | def make_url(self, returnURL, paymentReason, pipelineName, **params): """ Generate the URL with the signature required for a transaction """ params['callerKey'] = str(self.aws_access_key_id) params['returnURL'] = str(returnURL) params['paymentReason'] = str(paymentReason) params['pipelineName'] = pipelineName |
if value == None: return '' | def encode_reference(self, value): if isinstance(value, str) or isinstance(value, unicode): return value if value == None: return '' else: return value.id | |
block_device_map=None): | block_device_map=None, instance_initiated_shutdown_behavior=None): | def run_instances(self, image_id, min_count=1, max_count=1, key_name=None, security_groups=None, user_data=None, addressing_type=None, instance_type='m1.small', placement=None, kernel_id=None, ramdisk_id=None, monitoring_enabled=False, subnet_id=None, block_device_map=None): """ Runs an image on EC2. |
[('DBSnapshots', DBSnapshot)]) | [('DBSnapshot', DBSnapshot)]) | def get_all_dbsnapshots(self, snapshot_id=None, instance_id=None, max_records=None, marker=None): """ Get information about DB Snapshots. |
cnf = open("/etc/apache2/sites-available/%s" % domain, "w") | domain_info = domain.split('.') boto.log.info("base domain info is %s" % domain_info[0] cnf = open("/etc/apache2/sites-available/%s" % domain_info[0], "w") | def setup_vhost(self): domain = boto.config.get("Trac", "hostname").strip() if domain: cnf = open("/etc/apache2/sites-available/%s" % domain, "w") cnf.write("NameVirtualHost *:80\n") if boto.config.get("Trac", "SSLCertificateFile"): cnf.write("NameVirtualHost *:443\n\n") cnf.write("<VirtualHost *:80>\n") cnf.write("\tS... |
cnf.write("\t\tAuthBasicAuthoritative off\n") cnf.write("\t\tAuthUserFile /dev/null\n") cnf.write("\t\tPythonAuthenHandler marajo.web.authen_handler\n") cnf.write("\t\tPythonOption SDBDomain %s\n" % boto.config.get("Trac", "sdb_auth_domain")) | cnf.write("\t\tAuthUserFile /etc/apache2/passwd/passwds\n") | def setup_vhost(self): domain = boto.config.get("Trac", "hostname").strip() if domain: cnf = open("/etc/apache2/sites-available/%s" % domain, "w") cnf.write("NameVirtualHost *:80\n") if boto.config.get("Trac", "SSLCertificateFile"): cnf.write("NameVirtualHost *:443\n\n") cnf.write("<VirtualHost *:80>\n") cnf.write("\tS... |
cnf.write("\t\tPythonOption TracUriRoot /trac%s\n" % env) | cnf.write("\t\tPythonOption TracUriRoot /trac/%s\n" % env) | def setup_vhost(self): domain = boto.config.get("Trac", "hostname").strip() if domain: cnf = open("/etc/apache2/sites-available/%s" % domain, "w") cnf.write("NameVirtualHost *:80\n") if boto.config.get("Trac", "SSLCertificateFile"): cnf.write("NameVirtualHost *:443\n\n") cnf.write("<VirtualHost *:80>\n") cnf.write("\tS... |
self.config.trusted_signers, self.default_root_object) | self.config.trusted_signers) self.config.default_root_object) | def update(self, enabled=None, cnames=None, comment=None, origin_access_identity=None, trusted_signers=None, default_root_object=None): """ Update the configuration of the Distribution. |
is_secure=True, port=None, proxy=None, proxy_port=None, host='fps.sandbox.amazonaws.com', debug=0, https_connection_factory=None): AWSQueryConnection.__init__(self, aws_access_key_id, aws_secret_access_key, | is_secure=True, port=None, proxy=None, proxy_port=None, proxy_user=None, proxy_pass=None, host='fps.sandbox.amazonaws.com', debug=0, https_connection_factory=None, path=None): AWSQueryConnection.__init__(self, aws_access_key_id, aws_secret_access_key, | def __init__(self, aws_access_key_id=None, aws_secret_access_key=None, is_secure=True, port=None, proxy=None, proxy_port=None, host='fps.sandbox.amazonaws.com', debug=0, https_connection_factory=None): AWSQueryConnection.__init__(self, aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, host, ... |
host, debug=debug, https_connection_factory=https_connection_factory) | proxy_user, proxy_pass, host, debug, https_connection_factory, path) | def __init__(self, aws_access_key_id=None, aws_secret_access_key=None, is_secure=True, port=None, proxy=None, proxy_port=None, host='fps.sandbox.amazonaws.com', debug=0, https_connection_factory=None): AWSQueryConnection.__init__(self, aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, host, ... |
domain_info = domain.split('.') boto.log.info("base domain info is %s" % domain_info[0] | domain_info = domain.split('.') | def setup_vhost(self): domain = boto.config.get("Trac", "hostname").strip() if domain: domain_info = domain.split('.') boto.log.info("base domain info is %s" % domain_info[0] cnf = open("/etc/apache2/sites-available/%s" % domain_info[0], "w") cnf.write("NameVirtualHost *:80\n") if boto.config.get("Trac", "SSLCertificat... |
cnf.write("\t\tAuthUserFile /etc/apache2/passwd/passwds\n") | cnf.write("\t\tAuthUserFile /mnt/apache/passwd/passwords\n") | def setup_vhost(self): domain = boto.config.get("Trac", "hostname").strip() if domain: domain_info = domain.split('.') boto.log.info("base domain info is %s" % domain_info[0] cnf = open("/etc/apache2/sites-available/%s" % domain_info[0], "w") cnf.write("NameVirtualHost *:80\n") if boto.config.get("Trac", "SSLCertificat... |
self.run("a2ensite %s" % domain) | self.run("a2ensite %s" % domain_info[0]) | def setup_vhost(self): domain = boto.config.get("Trac", "hostname").strip() if domain: domain_info = domain.split('.') boto.log.info("base domain info is %s" % domain_info[0] cnf = open("/etc/apache2/sites-available/%s" % domain_info[0], "w") cnf.write("NameVirtualHost *:80\n") if boto.config.get("Trac", "SSLCertificat... |
self.tags = None | self.tags = TagSet() | def __init__(self, connection=None): EC2Object.__init__(self, connection) self.tags = None |
self.tags = TagSet() | def startElement(self, name, attrs, connection): if name == 'tagSet': self.tags = TagSet() return self.tags else: return None | |
return self.get_all_buckets() | for bucket in self.get_all_buckets(): yield bucket | def __iter__(self): return self.get_all_buckets() |
value = {} | def decode_map(self, prop, value): if not isinstance(value, list): value = [value] ret_value = {} item_type = getattr(prop, "item_type") value = {} for val in value: k,v = self.decode_map_element(item_type, val) value[k] = v return value | |
value[k] = v return value | ret_value[k] = v return ret_value | def decode_map(self, prop, value): if not isinstance(value, list): value = [value] ret_value = {} item_type = getattr(prop, "item_type") value = {} for val in value: k,v = self.decode_map_element(item_type, val) value[k] = v return value |
if response.status == 200: | if response.status/100 == 2: | def get_key(self, key_name, headers=None, version_id=None): """ Check to see if a particular key exists within the bucket. This method uses a HEAD request to check for the existance of the key. Returns: An instance of a Key object or None :type key_name: string :param key_name: The name of the key to retrieve :rtype... |
params['TransactionAmount.Value'] = str(transactionAmount) | params['TransactionAmount.Amount'] = str(transactionAmount) | def pay(self, transactionAmount, senderTokenId, chargeFeeTo="Recipient", callerReference=None, senderReference=None, recipientReference=None, senderDescription=None, recipientDescription=None, callerDescription=None, metadata=None, transactionDate=None, reserve=False): """ Make a payment transaction. You must specify t... |
params['RecipientTokenId'] = boto.config.get("FPS", "recipient_token") params['CallerTokenId'] = boto.config.get("FPS", "caller_token") | def pay(self, transactionAmount, senderTokenId, chargeFeeTo="Recipient", callerReference=None, senderReference=None, recipientReference=None, senderDescription=None, recipientDescription=None, callerDescription=None, metadata=None, transactionDate=None, reserve=False): """ Make a payment transaction. You must specify t... | |
if(transactionDate != None): params['TransactionDate'] = transactionDate | def pay(self, transactionAmount, senderTokenId, chargeFeeTo="Recipient", callerReference=None, senderReference=None, recipientReference=None, senderDescription=None, recipientDescription=None, callerDescription=None, metadata=None, transactionDate=None, reserve=False): """ Make a payment transaction. You must specify t... | |
params['AutoApprovalDelayInSeconds']= approval_delay | d = self.duration_as_seconds(approval_delay) params['AutoApprovalDelayInSeconds'] = d | def register_hit_type(self, title, description, reward, duration, keywords=None, approval_delay=None, qual_req=None): """ Register a new HIT Type \ttitle, description are strings \treward is a Price object \tduration can be a timedelta, or an object castable to an int """ params = dict( Title=title, Description=descrip... |
'LifetimeInSeconds' : lifetime, | 'LifetimeInSeconds' : self.duration_as_seconds(lifetime), | def create_hit(self, hit_type=None, question=None, lifetime=datetime.timedelta(days=7), max_assignments=1, title=None, description=None, keywords=None, reward=None, duration=datetime.timedelta(days=7), approval_delay=None, annotation=None, questions=None, qualifications=None, response_groups=None): """ Creates a new HI... |
additional_params['AutoApprovalDelayInSeconds'] = approval_delay | d = self.duration_as_seconds(approval_delay) additional_params['AutoApprovalDelayInSeconds'] = d | def create_hit(self, hit_type=None, question=None, lifetime=datetime.timedelta(days=7), max_assignments=1, title=None, description=None, keywords=None, reward=None, duration=datetime.timedelta(days=7), approval_delay=None, annotation=None, questions=None, qualifications=None, response_groups=None): """ Creates a new HI... |
:return: The :class:`boto.ec2.instance.Reservation` associated with the request for machines | :return: The :class:`boto.ec2.spotinstancerequest.SpotInstanceRequest` associated with the request for machines | def request_spot_instances(self, price, image_id, count=1, type=None, valid_from=None, valid_until=None, launch_group=None, availability_zone_group=None, key_name=None, security_groups=None, user_data=None, addressing_type=None, instance_type='m1.small', placement=None, kernel_id=None, ramdisk_id=None, monitoring_enabl... |
param['MultiAZ'] = 'true' | params['MultiAZ'] = 'true' | def create_dbinstance(self, id, allocated_storage, instance_class, master_username, master_password, port=3306, engine='MySQL5.1', db_name=None, param_group=None, security_groups=None, availability_zone=None, preferred_maintenance_window=None, backup_retention_period=None, preferred_backup_window=None, multi_az=False):... |
self.build_list_params(params, instances, 'instances.member.%d') | self.build_list_params(params, instances, 'Instances.member.%d') | def describe_instance_health(self, load_balancer_name, instances=None): """ Get current state of all Instances registered to an Load Balancer. |
args.extend(('-input', self.input)) | if isinstance(self.input, list): for input in self.input: args.extend(('-input', input)) else: args.extend(('-input', self.input)) | def args(self): args = ['-mapper', self.mapper, '-reducer', self.reducer] |
def __init__(self, requirements = []): | def __init__(self, requirements=None): if requirements == None: requirements = [] | def __init__(self, requirements = []): self.requirements = requirements |
hosts = list(self._cache.keys()) for host in hosts: conn = self._cache[host] conn.close() del self._cache[host] | if hasattr(self, '_cache') and isinstance(self._cache, dict): hosts = list(self._cache.keys()) for host in hosts: conn = self._cache[host] conn.close() del self._cache[host] | def close(self): """(Optional) Close any open HTTP connections. This is non-destructive, and making a new request will open a connection again.""" |
return simplejson.loads(body) | return json.loads(body) | def get_all_topics(self, next_token=None): """ :type next_token: string :param next_token: Token returned by the previous call to this method. |
return simplejson.loads(body) | return json.loads(body) | def get_topic_attributes(self, topic): """ Get attributes of a Topic |
return simplejson.loads(body) | return json.loads(body) | def add_permission(self, topic, label, account_ids, actions): """ Adds a statement to a topic's access control policy, granting access for the specified AWS accounts to the specified actions. |
return simplejson.loads(body) | return json.loads(body) | def remove_permission(self, topic, label): """ Removes a statement from a topic's access control policy. |
return simplejson.loads(body) | return json.loads(body) | def create_topic(self, topic): """ Create a new Topic. |
return simplejson.loads(body) | return json.loads(body) | def publish(self, topic, message, subject=None): """ Get properties of a Topic |
return simplejson.loads(body) | return json.loads(body) | def subscribe(self, topic, protocol, endpoint): """ Subscribe to a Topic. |
return simplejson.loads(body) | return json.loads(body) | def confirm_subscription(self, topic, token, authenticate_on_unsubscribe=False): """ Get properties of a Topic |
return simplejson.loads(body) | return json.loads(body) | def unsubscribe(self, subscription): """ Allows endpoint owner to delete subscription. Confirmation message will be delivered. |
return simplejson.loads(body) | return json.loads(body) | def get_all_subscriptions(self, next_token=None): """ Get list of all subscriptions. |
return simplejson.loads(body) else: boto.log.error('%s %s' % (response.status, response.reason)) boto.log.error('%s' % body) raise self.ResponseError(response.status, response.reason, body) | return json.loads(body) else: boto.log.error('%s %s' % (response.status, response.reason)) boto.log.error('%s' % body) raise self.ResponseError(response.status, response.reason, body) | def get_all_subscriptions_by_topic(self, topic, next_token=None): """ Get list of all subscriptions to a specific topic. |
new_msg = queue.write(msg) | new_msg = queue.write(new_msg) | def run(self, msg, vtimeout=60): delay = self.check() boto.log.info('Task[%s] - delay=%s seconds' % (self.name, delay)) if delay == 0: self._run(msg, vtimeout) queue = msg.queue new_msg = queue.new_message(self.id) new_msg = queue.write(msg) self.message_id = new_msg.id self.put() boto.log.info('Task[%s] - new message ... |
headers[provider.storage_class] = storage_class | headers[provider.storage_class_header] = storage_class | def copy_key(self, new_key_name, src_bucket_name, src_key_name, metadata=None, src_version_id=None, storage_class='STANDARD', preserve_acl=False): """ Create a new key in the bucket by copying another existing key. |
https_connection_factory=None, path=None): | https_connection_factory=None, path="/"): | def __init__(self, aws_access_key_id=None, aws_secret_access_key=None, is_secure=True, port=None, proxy=None, proxy_port=None, proxy_user=None, proxy_pass=None, host='fps.sandbox.amazonaws.com', debug=0, https_connection_factory=None, path=None): AWSQueryConnection.__init__(self, aws_access_key_id, aws_secret_access_ke... |
self.config.trusted_signers) | self.config.trusted_signers, | def update(self, enabled=None, cnames=None, comment=None, origin_access_identity=None, trusted_signers=None, default_root_object=None): """ Update the configuration of the Distribution. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.