desc stringlengths 3 26.7k | decl stringlengths 11 7.89k | bodies stringlengths 8 553k |
|---|---|---|
'Return license filename from a license-file key in setup.cfg, or None.'
| def license_file(self):
| metadata = self.distribution.get_option_dict('metadata')
if (not ('license_file' in metadata)):
return None
return metadata['license_file'][1]
|
'Generate requirements from setup.cfg as
(\'Requires-Dist\', \'requirement; qualifier\') tuples. From a metadata
section in setup.cfg:
[metadata]
provides-extra = extra1
extra2
requires-dist = requirement; qualifier
another; qualifier2
unqualified
Yields
(\'Provides-Extra\', \'extra1\'),
(\'Provides-Extra\', \'extra2\'... | def setupcfg_requirements(self):
| metadata = self.distribution.get_option_dict('metadata')
for (key, title) in (('provides_extra', 'Provides-Extra'), ('requires_dist', 'Requires-Dist')):
if (not (key in metadata)):
continue
field = metadata[key]
for line in field[1].splitlines():
line = line.strip... |
'Add additional requirements from setup.cfg to file metadata_path'
| def add_requirements(self, metadata_path):
| additional = list(self.setupcfg_requirements())
if (not additional):
return
pkg_info = read_pkg_info(metadata_path)
if (('Provides-Extra' in pkg_info) or ('Requires-Dist' in pkg_info)):
warnings.warn('setup.cfg requirements overwrite values from setup.py')
del pkg_... |
'Convert an .egg-info directory into a .dist-info directory'
| def egg2dist(self, egginfo_path, distinfo_path):
| def adios(p):
'Appropriately delete directory, file or link.'
if (os.path.exists(p) and (not os.path.islink(p)) and os.path.isdir(p)):
shutil.rmtree(p)
elif os.path.exists(p):
os.unlink(p)
adios(distinfo_path)
if (not os.path.exists(egginfo_path... |
'Lists all the edge nodes of a CDN service.
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:rtype: :class:`EdgeNodePaged... | def list(self, custom_headers=None, raw=False, **operation_config):
| def internal_paging(next_link=None, raw=False):
if (not next_link):
url = '/providers/Microsoft.Cdn/edgenodes'
query_parameters = {}
query_parameters['api-version'] = self._serialize.query('self.api_version', self.api_version, 'str')
else:
url = next_l... |
'Lists all of the existing origins within an endpoint.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type profile_name: str
:param endpoint_name: Name of the en... | def list_by_endpoint(self, resource_group_name, profile_name, endpoint_name, custom_headers=None, raw=False, **operation_config):
| def internal_paging(next_link=None, raw=False):
if (not next_link):
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins'
path_format_arguments = {'resourceGroupName': self._serialize... |
'Gets an existing origin within an endpoint.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type profile_name: str
:param endpoint_name: Name of the endpoint und... | def get(self, resource_group_name, profile_name, endpoint_name, origin_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str', max_length=90, min_length=1... |
'Updates an existing origin within an endpoint.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type profile_name: str
:param endpoint_name: Name of the endpoint ... | def update(self, resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str', max_length=90, min_length=1... |
'Lists all of the existing custom domains within an endpoint.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type profile_name: str
:param endpoint_name: Name of... | def list_by_endpoint(self, resource_group_name, profile_name, endpoint_name, custom_headers=None, raw=False, **operation_config):
| def internal_paging(next_link=None, raw=False):
if (not next_link):
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains'
path_format_arguments = {'resourceGroupName': self._ser... |
'Gets an exisitng custom domain within an endpoint.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type profile_name: str
:param endpoint_name: Name of the endpo... | def get(self, resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str', max_length=90, ... |
'Creates a new custom domain within an endpoint.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type profile_name: str
:param endpoint_name: Name of the endpoint... | def create(self, resource_group_name, profile_name, endpoint_name, custom_domain_name, host_name, custom_headers=None, raw=False, **operation_config):
| custom_domain_properties = models.CustomDomainParameters(host_name=host_name)
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}'
path_format_arguments = {'resourceGroupName': self... |
'Deletes an existing custom domain within an endpoint.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type profile_name: str
:param endpoint_name: Name of the en... | def delete(self, resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str', max_length=90, ... |
'Disable https delivery of the custom domain.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type profile_name: str
:param endpoint_name: Name of the endpoint un... | def disable_custom_https(self, resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/disableCustomHttps'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'st... |
'Enable https delivery of the custom domain.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type profile_name: str
:param endpoint_name: Name of the endpoint und... | def enable_custom_https(self, resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/enableCustomHttps'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str... |
'Lists existing CDN endpoints.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type profile_name: str
:param dict custom_headers: headers that will be added to th... | def list_by_profile(self, resource_group_name, profile_name, custom_headers=None, raw=False, **operation_config):
| def internal_paging(next_link=None, raw=False):
if (not next_link):
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_na... |
'Gets an existing CDN endpoint with the specified endpoint name under
the specified subscription, resource group and profile.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resou... | def get(self, resource_group_name, profile_name, endpoint_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str', max_length=90, min_length=1, pattern='^[-\\w\\._... |
'Creates a new CDN endpoint with the specified endpoint name under the
specified subscription, resource group and profile.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource... | def create(self, resource_group_name, profile_name, endpoint_name, endpoint, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str', max_length=90, min_length=1, pattern='^[-\\w\\._... |
'Updates an existing CDN endpoint with the specified endpoint name under
the specified subscription, resource group and profile. Only tags and
Origin HostHeader can be updated after creating an endpoint. To update
origins, use the Update Origin operation. To update custom domains, use
the Update Custom Domain operation... | def update(self, resource_group_name, profile_name, endpoint_name, endpoint_update_properties, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str', max_length=90, min_length=1, pattern='^[-\\w\\._... |
'Deletes an existing CDN endpoint with the specified endpoint name under
the specified subscription, resource group and profile.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the re... | def delete(self, resource_group_name, profile_name, endpoint_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str', max_length=90, min_length=1, pattern='^[-\\w\\._... |
'Starts an existing CDN endpoint that is on a stopped state.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type profile_name: str
:param endpoint_name: Name of ... | def start(self, resource_group_name, profile_name, endpoint_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/start'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str', max_length=90, min_length=1, pattern='^[-\... |
'Stops an existing running CDN endpoint.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type profile_name: str
:param endpoint_name: Name of the endpoint under t... | def stop(self, resource_group_name, profile_name, endpoint_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/stop'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str', max_length=90, min_length=1, pattern='^[-\\... |
'Removes a content from CDN.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type profile_name: str
:param endpoint_name: Name of the endpoint under the profile w... | def purge_content(self, resource_group_name, profile_name, endpoint_name, content_paths, custom_headers=None, raw=False, **operation_config):
| content_file_paths = models.PurgeParameters(content_paths=content_paths)
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/purge'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_... |
'Pre-loads a content to CDN. Available for Verizon Profiles.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type profile_name: str
:param endpoint_name: Name of ... | def load_content(self, resource_group_name, profile_name, endpoint_name, content_paths, custom_headers=None, raw=False, **operation_config):
| content_file_paths = models.LoadParameters(content_paths=content_paths)
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/load'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_na... |
'Validates the custom domain mapping to ensure it maps to the correct
CDN endpoint in DNS.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type profile_name: str
... | def validate_custom_domain(self, resource_group_name, profile_name, endpoint_name, host_name, custom_headers=None, raw=False, **operation_config):
| custom_domain_properties = models.ValidateCustomDomainInput(host_name=host_name)
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/validateCustomDomain'
path_format_arguments = {'resourceGroupName': self._seriali... |
'Checks the quota and usage of geo filters and custom domains under the
given endpoint.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type profile_name: str
:pa... | def list_resource_usage(self, resource_group_name, profile_name, endpoint_name, custom_headers=None, raw=False, **operation_config):
| def internal_paging(next_link=None, raw=False):
if (not next_link):
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/checkResourceUsage'
path_format_arguments = {'resourceGroupName': self... |
'Lists all of the CDN profiles within an Azure subscription.
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:rtype: :cla... | def list(self, custom_headers=None, raw=False, **operation_config):
| def internal_paging(next_link=None, raw=False):
if (not next_link):
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/profiles'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscription_id', self.config.subscription_id, 'str')}
... |
'Lists all of the CDN profiles within a resource group.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized respo... | def list_by_resource_group(self, resource_group_name, custom_headers=None, raw=False, **operation_config):
| def internal_paging(next_link=None, raw=False):
if (not next_link):
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name... |
'Gets a CDN profile with the specified profile name under the specified
subscription and resource group.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type prof... | def get(self, resource_group_name, profile_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str', max_length=90, min_length=1, pattern='^[-\\w\\._\\(\\)]+$'), 'profileName... |
'Creates a new CDN profile with a profile name under the specified
subscription and resource group.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type profile_n... | def create(self, resource_group_name, profile_name, profile, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str', max_length=90, min_length=1, pattern='^[-\\w\\._\\(\\)]+$'), 'profileName... |
'Updates an existing CDN profile with the specified profile name under
the specified subscription and resource group.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource grou... | def update(self, resource_group_name, profile_name, tags, custom_headers=None, raw=False, **operation_config):
| profile_update_parameters = models.ProfileUpdateParameters(tags=tags)
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str',... |
'Deletes an existing CDN profile with the specified parameters. Deleting
a profile will result in the deletion of all of the sub-resources
including endpoints, origins and custom domains.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_... | def delete(self, resource_group_name, profile_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str', max_length=90, min_length=1, pattern='^[-\\w\\._\\(\\)]+$'), 'profileName... |
'Generates a dynamic SSO URI used to sign in to the CDN supplemental
portal. Supplemnetal portal is used to configure advanced feature
capabilities that are not yet available in the Azure portal, such as
core reports in a standard profile; rules engine, advanced HTTP
reports, and real-time stats and alerts in a premium... | def generate_sso_uri(self, resource_group_name, profile_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/generateSsoUri'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', resource_group_name, 'str', max_length=90, min_length=1, pattern='^[-\\w\\._\\(\\)]+$'... |
'Checks the quota and actual usage of endpoints under the given CDN
profile.
:param resource_group_name: Name of the Resource group within the
Azure subscription.
:type resource_group_name: str
:param profile_name: Name of the CDN profile which is unique within
the resource group.
:type profile_name: str
:param dict cu... | def list_resource_usage(self, resource_group_name, profile_name, custom_headers=None, raw=False, **operation_config):
| def internal_paging(next_link=None, raw=False):
if (not next_link):
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkResourceUsage'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource... |
'Check the availability of a resource name. This is needed for resources
where name is globally unique, such as a CDN endpoint.
:param name: The resource name to validate.
:type name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
des... | def check_name_availability(self, name, custom_headers=None, raw=False, **operation_config):
| check_name_availability_input = models.CheckNameAvailabilityInput(name=name)
url = '/providers/Microsoft.Cdn/checkNameAvailability'
query_parameters = {}
query_parameters['api-version'] = self._serialize.query('self.api_version', self.api_version, 'str')
header_parameters = {}
header_parameters[... |
'Check the quota and actual usage of the CDN profiles under the given
subscription.
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforope... | def list_resource_usage(self, custom_headers=None, raw=False, **operation_config):
| def internal_paging(next_link=None, raw=False):
if (not next_link):
url = '/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkResourceUsage'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscription_id', self.config.subscription_id, 'str')}
... |
'Lists all of the available CDN REST API operations.
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:rtype: :class:`Oper... | def list_operations(self, custom_headers=None, raw=False, **operation_config):
| def internal_paging(next_link=None, raw=False):
if (not next_link):
url = '/providers/Microsoft.Cdn/operations'
query_parameters = {}
query_parameters['api-version'] = self._serialize.query('self.api_version', self.api_version, 'str')
else:
url = next_... |
'Return distribution full name with - replaced with _'
| @property
def wheel_dist_name(self):
| return '-'.join((safer_name(self.distribution.get_name()), safer_version(self.distribution.get_version())))
|
'Return archive name without extension'
| def get_archive_basename(self):
| (impl_tag, abi_tag, plat_tag) = self.get_tag()
archive_basename = ('%s-%s-%s-%s' % (self.wheel_dist_name, impl_tag, abi_tag, plat_tag))
return archive_basename
|
'Return license filename from a license-file key in setup.cfg, or None.'
| def license_file(self):
| metadata = self.distribution.get_option_dict('metadata')
if (not ('license_file' in metadata)):
return None
return metadata['license_file'][1]
|
'Generate requirements from setup.cfg as
(\'Requires-Dist\', \'requirement; qualifier\') tuples. From a metadata
section in setup.cfg:
[metadata]
provides-extra = extra1
extra2
requires-dist = requirement; qualifier
another; qualifier2
unqualified
Yields
(\'Provides-Extra\', \'extra1\'),
(\'Provides-Extra\', \'extra2\'... | def setupcfg_requirements(self):
| metadata = self.distribution.get_option_dict('metadata')
for (key, title) in (('provides_extra', 'Provides-Extra'), ('requires_dist', 'Requires-Dist')):
if (not (key in metadata)):
continue
field = metadata[key]
for line in field[1].splitlines():
line = line.strip... |
'Add additional requirements from setup.cfg to file metadata_path'
| def add_requirements(self, metadata_path):
| additional = list(self.setupcfg_requirements())
if (not additional):
return
pkg_info = read_pkg_info(metadata_path)
if (('Provides-Extra' in pkg_info) or ('Requires-Dist' in pkg_info)):
warnings.warn('setup.cfg requirements overwrite values from setup.py')
del pkg_... |
'Convert an .egg-info directory into a .dist-info directory'
| def egg2dist(self, egginfo_path, distinfo_path):
| def adios(p):
'Appropriately delete directory, file or link.'
if (os.path.exists(p) and (not os.path.islink(p)) and os.path.isdir(p)):
shutil.rmtree(p)
elif os.path.exists(p):
os.unlink(p)
adios(distinfo_path)
if (not os.path.exists(egginfo_path... |
'Retrieves the properties of an existing Azure Cosmos DB database
account.
:param resource_group_name: Name of an Azure resource group.
:type resource_group_name: str
:param account_name: Cosmos DB database account name.
:type account_name: str
:param dict custom_headers: headers that will be added to the request
:para... | def get(self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscription_id', self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url('re... |
'Patches the properties of an existing Azure Cosmos DB database account.
:param resource_group_name: Name of an Azure resource group.
:type resource_group_name: str
:param account_name: Cosmos DB database account name.
:type account_name: str
:param tags:
:type tags: dict
:param dict custom_headers: headers that will b... | def patch(self, resource_group_name, account_name, tags, custom_headers=None, raw=False, **operation_config):
| update_parameters = models.DatabaseAccountPatchParameters(tags=tags)
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscription_id', self.con... |
'Creates or updates an Azure Cosmos DB database account.
:param resource_group_name: Name of an Azure resource group.
:type resource_group_name: str
:param account_name: Cosmos DB database account name.
:type account_name: str
:param create_update_parameters: The parameters to provide for the
current database account.
... | def create_or_update(self, resource_group_name, account_name, create_update_parameters, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscription_id', self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url('re... |
'Deletes an existing Azure Cosmos DB database account.
:param resource_group_name: Name of an Azure resource group.
:type resource_group_name: str
:param account_name: Cosmos DB database account name.
:type account_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns ... | def delete(self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscription_id', self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url('re... |
'Changes the failover priority for the Azure Cosmos DB database account.
A failover priority of 0 indicates a write region. The maximum value
for a failover priority = (total number of regions - 1). Failover
priority values must be unique for each of the regions in which the
database account exists.
:param resource_gro... | def failover_priority_change(self, resource_group_name, account_name, failover_policies=None, custom_headers=None, raw=False, **operation_config):
| failover_parameters = models.FailoverPolicies(failover_policies=failover_policies)
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange'
path_format_arguments = {'subscriptionId': self._serialize.url('s... |
'Lists all the Azure Cosmos DB database accounts available under the
subscription.
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoper... | def list(self, custom_headers=None, raw=False, **operation_config):
| def internal_paging(next_link=None, raw=False):
if (not next_link):
url = '/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscription_id', self.config.subscription_id, 'str'... |
'Lists all the Azure Cosmos DB database accounts available under the
given resource group.
:param resource_group_name: Name of an Azure resource group.
:type resource_group_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserial... | def list_by_resource_group(self, resource_group_name, custom_headers=None, raw=False, **operation_config):
| def internal_paging(next_link=None, raw=False):
if (not next_link):
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts'
path_format_arguments = {'resourceGroupName': self._serialize.url('resource_group_name', reso... |
'Lists the access keys for the specified Azure Cosmos DB database
account.
:param resource_group_name: Name of an Azure resource group.
:type resource_group_name: str
:param account_name: Cosmos DB database account name.
:type account_name: str
:param dict custom_headers: headers that will be added to the request
:para... | def list_keys(self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscription_id', self.config.subscription_id, 'str'), 'resourceGroupName': self._serializ... |
'Lists the connection strings for the specified Azure Cosmos DB database
account.
:param resource_group_name: Name of an Azure resource group.
:type resource_group_name: str
:param account_name: Cosmos DB database account name.
:type account_name: str
:param dict custom_headers: headers that will be added to the reques... | def list_connection_strings(self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscription_id', self.config.subscription_id, 'str'), 'resourceGroupName': s... |
'Lists the read-only access keys for the specified Azure Cosmos DB
database account.
:param resource_group_name: Name of an Azure resource group.
:type resource_group_name: str
:param account_name: Cosmos DB database account name.
:type account_name: str
:param dict custom_headers: headers that will be added to the req... | def list_read_only_keys(self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscription_id', self.config.subscription_id, 'str'), 'resourceGroupName': self._seri... |
'Regenerates an access key for the specified Azure Cosmos DB database
account.
:param resource_group_name: Name of an Azure resource group.
:type resource_group_name: str
:param account_name: Cosmos DB database account name.
:type account_name: str
:param key_kind: The access key to regenerate. Possible values
include:... | def regenerate_key(self, resource_group_name, account_name, key_kind, custom_headers=None, raw=False, **operation_config):
| key_to_regenerate = models.DatabaseAccountRegenerateKeyParameters(key_kind=key_kind)
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey'
path_format_arguments = {'subscriptionId': self._serialize.url('self.con... |
'Checks that the Azure Cosmos DB account name already exists. A valid
account name may contain only lowercase letters, numbers, and the \'-\'
character, and must be between 3 and 50 characters.
:param account_name: Cosmos DB database account name.
:type account_name: str
:param dict custom_headers: headers that will be... | def check_name_exists(self, account_name, custom_headers=None, raw=False, **operation_config):
| url = '/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}'
path_format_arguments = {'accountName': self._serialize.url('account_name', account_name, 'str', max_length=50, min_length=3)}
url = self._client.format_url(url, **path_format_arguments)
query_parameters = {}
query_parameters... |
'Return distribution full name with - replaced with _'
| @property
def wheel_dist_name(self):
| return '-'.join((safer_name(self.distribution.get_name()), safer_version(self.distribution.get_version())))
|
'Return archive name without extension'
| def get_archive_basename(self):
| (impl_tag, abi_tag, plat_tag) = self.get_tag()
archive_basename = ('%s-%s-%s-%s' % (self.wheel_dist_name, impl_tag, abi_tag, plat_tag))
return archive_basename
|
'Return license filename from a license-file key in setup.cfg, or None.'
| def license_file(self):
| metadata = self.distribution.get_option_dict('metadata')
if (not ('license_file' in metadata)):
return None
return metadata['license_file'][1]
|
'Generate requirements from setup.cfg as
(\'Requires-Dist\', \'requirement; qualifier\') tuples. From a metadata
section in setup.cfg:
[metadata]
provides-extra = extra1
extra2
requires-dist = requirement; qualifier
another; qualifier2
unqualified
Yields
(\'Provides-Extra\', \'extra1\'),
(\'Provides-Extra\', \'extra2\'... | def setupcfg_requirements(self):
| metadata = self.distribution.get_option_dict('metadata')
for (key, title) in (('provides_extra', 'Provides-Extra'), ('requires_dist', 'Requires-Dist')):
if (not (key in metadata)):
continue
field = metadata[key]
for line in field[1].splitlines():
line = line.strip... |
'Add additional requirements from setup.cfg to file metadata_path'
| def add_requirements(self, metadata_path):
| additional = list(self.setupcfg_requirements())
if (not additional):
return
pkg_info = read_pkg_info(metadata_path)
if (('Provides-Extra' in pkg_info) or ('Requires-Dist' in pkg_info)):
warnings.warn('setup.cfg requirements overwrite values from setup.py')
del pkg_... |
'Convert an .egg-info directory into a .dist-info directory'
| def egg2dist(self, egginfo_path, distinfo_path):
| def adios(p):
'Appropriately delete directory, file or link.'
if (os.path.exists(p) and (not os.path.islink(p)) and os.path.isdir(p)):
shutil.rmtree(p)
elif os.path.exists(p):
os.unlink(p)
adios(distinfo_path)
if (not os.path.exists(egginfo_path... |
'Indicates which operations can be performed by the Power BI Resource
Provider.
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperati... | def get_available_operations(self, custom_headers=None, raw=False, **operation_config):
| url = '/providers/Microsoft.PowerBI/operations'
query_parameters = {}
query_parameters['api-version'] = self._serialize.query('self.api_version', self.api_version, 'str')
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
if self.config.generate_clien... |
'Retrieves an existing Power BI Workspace Collection.
:param resource_group_name: Azure resource group
:type resource_group_name: str
:param workspace_collection_name: Power BI Embedded Workspace
Collection name
:type workspace_collection_name: str
:param dict custom_headers: headers that will be added to the request
:... | def get_by_name(self, resource_group_name, workspace_collection_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscription_id', self.config.subscription_id, 'str'), 'resourceGroupName': self._seri... |
'Creates a new Power BI Workspace Collection with the specified
properties. A Power BI Workspace Collection contains one or more
workspaces, and can be used to provision keys that provide API access
to those workspaces.
:param resource_group_name: Azure resource group
:type resource_group_name: str
:param workspace_col... | def create(self, resource_group_name, workspace_collection_name, location=None, tags=None, custom_headers=None, raw=False, **operation_config):
| body = models.CreateWorkspaceCollectionRequest(location=location, tags=tags)
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subsc... |
'Update an existing Power BI Workspace Collection with the specified
properties.
:param resource_group_name: Azure resource group
:type resource_group_name: str
:param workspace_collection_name: Power BI Embedded Workspace
Collection name
:type workspace_collection_name: str
:param tags:
:type tags: dict
:param dict cu... | def update(self, resource_group_name, workspace_collection_name, tags=None, custom_headers=None, raw=False, **operation_config):
| body = models.UpdateWorkspaceCollectionRequest(tags=tags)
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscription_id', self.c... |
'Delete a Power BI Workspace Collection.
:param resource_group_name: Azure resource group
:type resource_group_name: str
:param workspace_collection_name: Power BI Embedded Workspace
Collection name
:type workspace_collection_name: str
:param dict custom_headers: headers that will be added to the request
:param bool ra... | def delete(self, resource_group_name, workspace_collection_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscription_id', self.config.subscription_id, 'str'), 'resourceGroupName': self._seri... |
'Verify the specified Power BI Workspace Collection name is valid and
not already in use.
:param location: Azure location
:type location: str
:param name: Workspace collection name
:type name: str
:param type: Resource type
:type type: str
:param dict custom_headers: headers that will be added to the request
:param boo... | def check_name_availability(self, location, name=None, type='Microsoft.PowerBI/workspaceCollections', custom_headers=None, raw=False, **operation_config):
| body = models.CheckNameRequest(name=name, type=type)
url = '/subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/locations/{location}/checkNameAvailability'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscription_id', self.config.subscription_id, 'str'), 'location': s... |
'Retrieves all existing Power BI workspace collections in the specified
resource group.
:param resource_group_name: Azure resource group
:type resource_group_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:... | def list_by_resource_group(self, resource_group_name, custom_headers=None, raw=False, **operation_config):
| def internal_paging(next_link=None, raw=False):
if (not next_link):
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscription_id'... |
'Retrieves all existing Power BI workspace collections in the specified
subscription.
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforo... | def list_by_subscription(self, custom_headers=None, raw=False, **operation_config):
| def internal_paging(next_link=None, raw=False):
if (not next_link):
url = '/subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/workspaceCollections'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscription_id', self.config.subscription_id, 'str... |
'Retrieves the primary and secondary access keys for the specified Power
BI Workspace Collection.
:param resource_group_name: Azure resource group
:type resource_group_name: str
:param workspace_collection_name: Power BI Embedded Workspace
Collection name
:type workspace_collection_name: str
:param dict custom_headers:... | def get_access_keys(self, resource_group_name, workspace_collection_name, custom_headers=None, raw=False, **operation_config):
| url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/listKeys'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscription_id', self.config.subscription_id, 'str'), 'resourceGroupName': s... |
'Regenerates the primary or secondary access key for the specified Power
BI Workspace Collection.
:param resource_group_name: Azure resource group
:type resource_group_name: str
:param workspace_collection_name: Power BI Embedded Workspace
Collection name
:type workspace_collection_name: str
:param key_name: Key name. ... | def regenerate_key(self, resource_group_name, workspace_collection_name, key_name=None, custom_headers=None, raw=False, **operation_config):
| body = models.WorkspaceCollectionAccessKey(key_name=key_name)
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/regenerateKey'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscr... |
'Migrates an existing Power BI Workspace Collection to a different
resource group and/or subscription.
:param resource_group_name: Azure resource group
:type resource_group_name: str
:param target_resource_group: Name of the resource group the Power BI
workspace collections will be migrated to.
:type target_resource_gr... | def migrate(self, resource_group_name, target_resource_group=None, resources=None, custom_headers=None, raw=False, **operation_config):
| body = models.MigrateWorkspaceCollectionRequest(target_resource_group=target_resource_group, resources=resources)
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources'
path_format_arguments = {'subscriptionId': self._serialize.url('self.config.subscription_id', self.config... |
'Retrieves all existing Power BI workspaces in the specified workspace
collection.
:param resource_group_name: Azure resource group
:type resource_group_name: str
:param workspace_collection_name: Power BI Embedded Workspace
Collection name
:type workspace_collection_name: str
:param dict custom_headers: headers that w... | def list(self, resource_group_name, workspace_collection_name, custom_headers=None, raw=False, **operation_config):
| def internal_paging(next_link=None, raw=False):
if (not next_link):
url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/workspaces'
path_format_arguments = {'subscriptionId': self._serial... |
'Return distribution full name with - replaced with _'
| @property
def wheel_dist_name(self):
| return '-'.join((safer_name(self.distribution.get_name()), safer_version(self.distribution.get_version())))
|
'Return archive name without extension'
| def get_archive_basename(self):
| (impl_tag, abi_tag, plat_tag) = self.get_tag()
archive_basename = ('%s-%s-%s-%s' % (self.wheel_dist_name, impl_tag, abi_tag, plat_tag))
return archive_basename
|
'Return license filename from a license-file key in setup.cfg, or None.'
| def license_file(self):
| metadata = self.distribution.get_option_dict('metadata')
if (not ('license_file' in metadata)):
return None
return metadata['license_file'][1]
|
'Generate requirements from setup.cfg as
(\'Requires-Dist\', \'requirement; qualifier\') tuples. From a metadata
section in setup.cfg:
[metadata]
provides-extra = extra1
extra2
requires-dist = requirement; qualifier
another; qualifier2
unqualified
Yields
(\'Provides-Extra\', \'extra1\'),
(\'Provides-Extra\', \'extra2\'... | def setupcfg_requirements(self):
| metadata = self.distribution.get_option_dict('metadata')
for (key, title) in (('provides_extra', 'Provides-Extra'), ('requires_dist', 'Requires-Dist')):
if (not (key in metadata)):
continue
field = metadata[key]
for line in field[1].splitlines():
line = line.strip... |
'Add additional requirements from setup.cfg to file metadata_path'
| def add_requirements(self, metadata_path):
| additional = list(self.setupcfg_requirements())
if (not additional):
return
pkg_info = read_pkg_info(metadata_path)
if (('Provides-Extra' in pkg_info) or ('Requires-Dist' in pkg_info)):
warnings.warn('setup.cfg requirements overwrite values from setup.py')
del pkg_... |
'Convert an .egg-info directory into a .dist-info directory'
| def egg2dist(self, egginfo_path, distinfo_path):
| def adios(p):
'Appropriately delete directory, file or link.'
if (os.path.exists(p) and (not os.path.islink(p)) and os.path.isdir(p)):
shutil.rmtree(p)
elif os.path.exists(p):
os.unlink(p)
adios(distinfo_path)
if (not os.path.exists(egginfo_path... |
'Creates a new HTTPError with the specified status, message,
response headers and body'
| def __init__(self, status, message, respheader, respbody):
| self.status = status
self.respheader = respheader
self.respbody = respbody
Exception.__init__(self, message)
|
'Opens the request.
method:
the request VERB \'GET\', \'POST\', etc.
url:
the url to connect'
| def open(self, method, url):
| flag = VARIANT.create_bool_false()
_method = BSTR(method)
_url = BSTR(url)
_WinHttpRequest._Open(self, _method, _url, flag)
|
'Sets up the timeout for the request.'
| def set_timeout(self, timeout_in_seconds):
| timeout_in_ms = int((timeout_in_seconds * 1000))
_WinHttpRequest._SetTimeouts(self, 0, timeout_in_ms, timeout_in_ms, timeout_in_ms)
|
'Sets the request header.'
| def set_request_header(self, name, value):
| _name = BSTR(name)
_value = BSTR(value)
_WinHttpRequest._SetRequestHeader(self, _name, _value)
|
'Gets back all response headers.'
| def get_all_response_headers(self):
| bstr_headers = c_void_p()
_WinHttpRequest._GetAllResponseHeaders(self, byref(bstr_headers))
bstr_headers = ctypes.cast(bstr_headers, c_wchar_p)
headers = bstr_headers.value
_SysFreeString(bstr_headers)
return headers
|
'Sends the request body.'
| def send(self, request=None):
| if (request is None):
var_empty = VARIANT.create_empty()
_WinHttpRequest._Send(self, var_empty)
else:
_request = VARIANT.create_safearray_from_str(request)
_WinHttpRequest._Send(self, _request)
|
'Gets status of response.'
| def status(self):
| status = c_long()
_WinHttpRequest._Status(self, byref(status))
return int(status.value)
|
'Gets status text of response.'
| def status_text(self):
| bstr_status_text = c_void_p()
_WinHttpRequest._StatusText(self, byref(bstr_status_text))
bstr_status_text = ctypes.cast(bstr_status_text, c_wchar_p)
status_text = bstr_status_text.value
_SysFreeString(bstr_status_text)
return status_text
|
'Gets response body as a SAFEARRAY and converts the SAFEARRAY to str.'
| def response_body(self):
| var_respbody = VARIANT()
_WinHttpRequest._ResponseBody(self, byref(var_respbody))
if var_respbody.is_safearray_of_bytes():
respbody = var_respbody.str_from_safearray()
return respbody
else:
return ''
|
'Sets client certificate for the request.'
| def set_client_certificate(self, certificate):
| _certificate = BSTR(certificate)
_WinHttpRequest._SetClientCertificate(self, _certificate)
|
'Sets up the host and the port for the HTTP CONNECT Tunnelling.'
| def set_tunnel(self, host, port):
| url = host
if port:
url = ((url + u':') + port)
var_host = VARIANT.create_bstr_from_str(url)
var_empty = VARIANT.create_empty()
_WinHttpRequest._SetProxy(self, HTTPREQUEST_PROXYSETTING_PROXY, var_host, var_empty)
|
'Returns response headers.'
| def getheaders(self):
| return self.headers
|
'Returns resonse body.'
| def read(self, _length):
| return self.respbody[:_length]
|
'initialize the IWinHttpWebRequest Com Object.'
| def __init__(self, host, cert_file, protocol, timeout):
| self.host = unicode(host)
self.cert_file = cert_file
self._httprequest = _WinHttpRequest()
self.protocol = protocol.lower()
self.timeout = timeout
clsid = GUID('{2087C2F4-2CEF-4953-A8AB-66779B670495}')
iid = GUID('{016FE2EC-B2C8-45F8-B23B-39E53A75396B}')
_CoInitialize(None)
_CoCreate... |
'Sets up the host and the port for the HTTP CONNECT Tunnelling.'
| def set_tunnel(self, host, port=None, headers=None):
| self._httprequest.set_tunnel(unicode(host), unicode(str(port)))
|
'Connects to host and sends the request.'
| def putrequest(self, method, uri):
| protocol = unicode((self.protocol + '://'))
url = ((protocol + self.host) + unicode(uri))
self._httprequest.set_timeout(self.timeout)
self._httprequest.open(unicode(method), url)
if (self.cert_file is not None):
self._httprequest.set_client_certificate(unicode(self.cert_file))
|
'Sends the headers of request.'
| def putheader(self, name, value):
| if (sys.version_info < (3,)):
name = str(name).decode('utf-8')
value = str(value).decode('utf-8')
self._httprequest.set_request_header(name, value)
|
'No operation. Exists only to provide the same interface of httplib
HTTPConnection.'
| def endheaders(self):
| pass
|
'Sends request body.'
| def send(self, request_body):
| if (not request_body):
self._httprequest.send()
else:
self._httprequest.send(request_body)
|
'Gets the response and generates the _Response object'
| def getresponse(self):
| status = self._httprequest.status()
status_text = self._httprequest.status_text()
resp_headers = self._httprequest.get_all_response_headers()
fixed_headers = []
for resp_header in resp_headers.split('\n'):
if ((resp_header.startswith(' DCTB ') or resp_header.startswith(' ')) and fixed_hea... |
'Returns response headers.'
| def getheaders(self):
| return self.headers
|
'Returns response body.'
| def read(self, _length):
| return self.respbody[:_length]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.