partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
valid
Catalog.get_resource
returns a single resource object. Will return None if no resource is found. Will raise an error if more than one resource with the same name is found.
src/geoserver/catalog.py
def get_resource(self, name=None, store=None, workspace=None): ''' returns a single resource object. Will return None if no resource is found. Will raise an error if more than one resource with the same name is found. ''' resources = self.get_resources(names=name, ...
def get_resource(self, name=None, store=None, workspace=None): ''' returns a single resource object. Will return None if no resource is found. Will raise an error if more than one resource with the same name is found. ''' resources = self.get_resources(names=name, ...
[ "returns", "a", "single", "resource", "object", ".", "Will", "return", "None", "if", "no", "resource", "is", "found", ".", "Will", "raise", "an", "error", "if", "more", "than", "one", "resource", "with", "the", "same", "name", "is", "found", "." ]
boundlessgeo/gsconfig
python
https://github.com/boundlessgeo/gsconfig/blob/532f561f32b91ea8debea0573c503dd20988bf40/src/geoserver/catalog.py#L899-L907
[ "def", "get_resource", "(", "self", ",", "name", "=", "None", ",", "store", "=", "None", ",", "workspace", "=", "None", ")", ":", "resources", "=", "self", ".", "get_resources", "(", "names", "=", "name", ",", "stores", "=", "store", ",", "workspaces",...
532f561f32b91ea8debea0573c503dd20988bf40
valid
Catalog.get_layergroups
names and workspaces can be provided as a comma delimited strings or as arrays, and are used for filtering. If no workspaces are provided, will return all layer groups in the catalog (global and workspace specific). Will always return an array.
src/geoserver/catalog.py
def get_layergroups(self, names=None, workspaces=None): ''' names and workspaces can be provided as a comma delimited strings or as arrays, and are used for filtering. If no workspaces are provided, will return all layer groups in the catalog (global and workspace specific). Will always ...
def get_layergroups(self, names=None, workspaces=None): ''' names and workspaces can be provided as a comma delimited strings or as arrays, and are used for filtering. If no workspaces are provided, will return all layer groups in the catalog (global and workspace specific). Will always ...
[ "names", "and", "workspaces", "can", "be", "provided", "as", "a", "comma", "delimited", "strings", "or", "as", "arrays", "and", "are", "used", "for", "filtering", ".", "If", "no", "workspaces", "are", "provided", "will", "return", "all", "layer", "groups", ...
boundlessgeo/gsconfig
python
https://github.com/boundlessgeo/gsconfig/blob/532f561f32b91ea8debea0573c503dd20988bf40/src/geoserver/catalog.py#L932-L976
[ "def", "get_layergroups", "(", "self", ",", "names", "=", "None", ",", "workspaces", "=", "None", ")", ":", "layergroups", "=", "[", "]", "if", "workspaces", "is", "None", "or", "len", "(", "workspaces", ")", "==", "0", ":", "# Add global layergroups", "...
532f561f32b91ea8debea0573c503dd20988bf40
valid
Catalog.get_layergroup
returns a single layergroup object. Will return None if no layergroup is found. Will raise an error if more than one layergroup with the same name is found.
src/geoserver/catalog.py
def get_layergroup(self, name, workspace=None): ''' returns a single layergroup object. Will return None if no layergroup is found. Will raise an error if more than one layergroup with the same name is found. ''' layergroups = self.get_layergroups(names=name, works...
def get_layergroup(self, name, workspace=None): ''' returns a single layergroup object. Will return None if no layergroup is found. Will raise an error if more than one layergroup with the same name is found. ''' layergroups = self.get_layergroups(names=name, works...
[ "returns", "a", "single", "layergroup", "object", ".", "Will", "return", "None", "if", "no", "layergroup", "is", "found", ".", "Will", "raise", "an", "error", "if", "more", "than", "one", "layergroup", "with", "the", "same", "name", "is", "found", "." ]
boundlessgeo/gsconfig
python
https://github.com/boundlessgeo/gsconfig/blob/532f561f32b91ea8debea0573c503dd20988bf40/src/geoserver/catalog.py#L978-L986
[ "def", "get_layergroup", "(", "self", ",", "name", ",", "workspace", "=", "None", ")", ":", "layergroups", "=", "self", ".", "get_layergroups", "(", "names", "=", "name", ",", "workspaces", "=", "workspace", ")", "return", "self", ".", "_return_first_item", ...
532f561f32b91ea8debea0573c503dd20988bf40
valid
Catalog.get_styles
names and workspaces can be provided as a comma delimited strings or as arrays, and are used for filtering. If no workspaces are provided, will return all styles in the catalog (global and workspace specific). Will always return an array.
src/geoserver/catalog.py
def get_styles(self, names=None, workspaces=None): ''' names and workspaces can be provided as a comma delimited strings or as arrays, and are used for filtering. If no workspaces are provided, will return all styles in the catalog (global and workspace specific). Will always return an a...
def get_styles(self, names=None, workspaces=None): ''' names and workspaces can be provided as a comma delimited strings or as arrays, and are used for filtering. If no workspaces are provided, will return all styles in the catalog (global and workspace specific). Will always return an a...
[ "names", "and", "workspaces", "can", "be", "provided", "as", "a", "comma", "delimited", "strings", "or", "as", "arrays", "and", "are", "used", "for", "filtering", ".", "If", "no", "workspaces", "are", "provided", "will", "return", "all", "styles", "in", "t...
boundlessgeo/gsconfig
python
https://github.com/boundlessgeo/gsconfig/blob/532f561f32b91ea8debea0573c503dd20988bf40/src/geoserver/catalog.py#L995-L1040
[ "def", "get_styles", "(", "self", ",", "names", "=", "None", ",", "workspaces", "=", "None", ")", ":", "all_styles", "=", "[", "]", "if", "workspaces", "is", "None", ":", "# Add global styles", "url", "=", "\"{}/styles.xml\"", ".", "format", "(", "self", ...
532f561f32b91ea8debea0573c503dd20988bf40
valid
Catalog.get_style
returns a single style object. Will return None if no style is found. Will raise an error if more than one style with the same name is found.
src/geoserver/catalog.py
def get_style(self, name, workspace=None): ''' returns a single style object. Will return None if no style is found. Will raise an error if more than one style with the same name is found. ''' styles = self.get_styles(names=name, workspaces=workspace) retur...
def get_style(self, name, workspace=None): ''' returns a single style object. Will return None if no style is found. Will raise an error if more than one style with the same name is found. ''' styles = self.get_styles(names=name, workspaces=workspace) retur...
[ "returns", "a", "single", "style", "object", ".", "Will", "return", "None", "if", "no", "style", "is", "found", ".", "Will", "raise", "an", "error", "if", "more", "than", "one", "style", "with", "the", "same", "name", "is", "found", "." ]
boundlessgeo/gsconfig
python
https://github.com/boundlessgeo/gsconfig/blob/532f561f32b91ea8debea0573c503dd20988bf40/src/geoserver/catalog.py#L1042-L1050
[ "def", "get_style", "(", "self", ",", "name", ",", "workspace", "=", "None", ")", ":", "styles", "=", "self", ".", "get_styles", "(", "names", "=", "name", ",", "workspaces", "=", "workspace", ")", "return", "self", ".", "_return_first_item", "(", "style...
532f561f32b91ea8debea0573c503dd20988bf40
valid
Catalog.get_workspaces
Returns a list of workspaces in the catalog. If names is specified, will only return workspaces that match. names can either be a comma delimited string or an array. Will return an empty list if no workspaces are found.
src/geoserver/catalog.py
def get_workspaces(self, names=None): ''' Returns a list of workspaces in the catalog. If names is specified, will only return workspaces that match. names can either be a comma delimited string or an array. Will return an empty list if no workspaces are found. ''...
def get_workspaces(self, names=None): ''' Returns a list of workspaces in the catalog. If names is specified, will only return workspaces that match. names can either be a comma delimited string or an array. Will return an empty list if no workspaces are found. ''...
[ "Returns", "a", "list", "of", "workspaces", "in", "the", "catalog", ".", "If", "names", "is", "specified", "will", "only", "return", "workspaces", "that", "match", ".", "names", "can", "either", "be", "a", "comma", "delimited", "string", "or", "an", "array...
boundlessgeo/gsconfig
python
https://github.com/boundlessgeo/gsconfig/blob/532f561f32b91ea8debea0573c503dd20988bf40/src/geoserver/catalog.py#L1110-L1129
[ "def", "get_workspaces", "(", "self", ",", "names", "=", "None", ")", ":", "if", "names", "is", "None", ":", "names", "=", "[", "]", "elif", "isinstance", "(", "names", ",", "basestring", ")", ":", "names", "=", "[", "s", ".", "strip", "(", ")", ...
532f561f32b91ea8debea0573c503dd20988bf40
valid
Catalog.get_workspace
returns a single workspace object. Will return None if no workspace is found. Will raise an error if more than one workspace with the same name is found.
src/geoserver/catalog.py
def get_workspace(self, name): ''' returns a single workspace object. Will return None if no workspace is found. Will raise an error if more than one workspace with the same name is found. ''' workspaces = self.get_workspaces(names=name) return self._return...
def get_workspace(self, name): ''' returns a single workspace object. Will return None if no workspace is found. Will raise an error if more than one workspace with the same name is found. ''' workspaces = self.get_workspaces(names=name) return self._return...
[ "returns", "a", "single", "workspace", "object", ".", "Will", "return", "None", "if", "no", "workspace", "is", "found", ".", "Will", "raise", "an", "error", "if", "more", "than", "one", "workspace", "with", "the", "same", "name", "is", "found", "." ]
boundlessgeo/gsconfig
python
https://github.com/boundlessgeo/gsconfig/blob/532f561f32b91ea8debea0573c503dd20988bf40/src/geoserver/catalog.py#L1131-L1139
[ "def", "get_workspace", "(", "self", ",", "name", ")", ":", "workspaces", "=", "self", ".", "get_workspaces", "(", "names", "=", "name", ")", "return", "self", ".", "_return_first_item", "(", "workspaces", ")" ]
532f561f32b91ea8debea0573c503dd20988bf40
valid
md_link
Extract a metadata link tuple from an xml node
src/geoserver/resource.py
def md_link(node): """Extract a metadata link tuple from an xml node""" mimetype = node.find("type") mdtype = node.find("metadataType") content = node.find("content") if None in [mimetype, mdtype, content]: return None else: return (mimetype.text, mdtype.text, content.text)
def md_link(node): """Extract a metadata link tuple from an xml node""" mimetype = node.find("type") mdtype = node.find("metadataType") content = node.find("content") if None in [mimetype, mdtype, content]: return None else: return (mimetype.text, mdtype.text, content.text)
[ "Extract", "a", "metadata", "link", "tuple", "from", "an", "xml", "node" ]
boundlessgeo/gsconfig
python
https://github.com/boundlessgeo/gsconfig/blob/532f561f32b91ea8debea0573c503dd20988bf40/src/geoserver/resource.py#L20-L28
[ "def", "md_link", "(", "node", ")", ":", "mimetype", "=", "node", ".", "find", "(", "\"type\"", ")", "mdtype", "=", "node", ".", "find", "(", "\"metadataType\"", ")", "content", "=", "node", ".", "find", "(", "\"content\"", ")", "if", "None", "in", "...
532f561f32b91ea8debea0573c503dd20988bf40
valid
build_url
Create a URL from a list of path segments and an optional dict of query parameters.
src/geoserver/support.py
def build_url(base, seg, query=None): """ Create a URL from a list of path segments and an optional dict of query parameters. """ def clean_segment(segment): """ Cleans the segment and encodes to UTF-8 if the segment is unicode. """ segment = segment.strip('/') ...
def build_url(base, seg, query=None): """ Create a URL from a list of path segments and an optional dict of query parameters. """ def clean_segment(segment): """ Cleans the segment and encodes to UTF-8 if the segment is unicode. """ segment = segment.strip('/') ...
[ "Create", "a", "URL", "from", "a", "list", "of", "path", "segments", "and", "an", "optional", "dict", "of", "query", "parameters", "." ]
boundlessgeo/gsconfig
python
https://github.com/boundlessgeo/gsconfig/blob/532f561f32b91ea8debea0573c503dd20988bf40/src/geoserver/support.py#L47-L69
[ "def", "build_url", "(", "base", ",", "seg", ",", "query", "=", "None", ")", ":", "def", "clean_segment", "(", "segment", ")", ":", "\"\"\"\n Cleans the segment and encodes to UTF-8 if the segment is unicode.\n \"\"\"", "segment", "=", "segment", ".", "str...
532f561f32b91ea8debea0573c503dd20988bf40
valid
prepare_upload_bundle
GeoServer's REST API uses ZIP archives as containers for file formats such as Shapefile and WorldImage which include several 'boxcar' files alongside the main data. In such archives, GeoServer assumes that all of the relevant files will have the same base name and appropriate extensions, and live in th...
src/geoserver/support.py
def prepare_upload_bundle(name, data): """GeoServer's REST API uses ZIP archives as containers for file formats such as Shapefile and WorldImage which include several 'boxcar' files alongside the main data. In such archives, GeoServer assumes that all of the relevant files will have the same base name ...
def prepare_upload_bundle(name, data): """GeoServer's REST API uses ZIP archives as containers for file formats such as Shapefile and WorldImage which include several 'boxcar' files alongside the main data. In such archives, GeoServer assumes that all of the relevant files will have the same base name ...
[ "GeoServer", "s", "REST", "API", "uses", "ZIP", "archives", "as", "containers", "for", "file", "formats", "such", "as", "Shapefile", "and", "WorldImage", "which", "include", "several", "boxcar", "files", "alongside", "the", "main", "data", ".", "In", "such", ...
boundlessgeo/gsconfig
python
https://github.com/boundlessgeo/gsconfig/blob/532f561f32b91ea8debea0573c503dd20988bf40/src/geoserver/support.py#L231-L250
[ "def", "prepare_upload_bundle", "(", "name", ",", "data", ")", ":", "fd", ",", "path", "=", "mkstemp", "(", ")", "zip_file", "=", "ZipFile", "(", "path", ",", "'w'", ")", "for", "ext", ",", "stream", "in", "data", ".", "items", "(", ")", ":", "fnam...
532f561f32b91ea8debea0573c503dd20988bf40
valid
md_dimension_info
Extract metadata Dimension Info from an xml node
src/geoserver/support.py
def md_dimension_info(name, node): """Extract metadata Dimension Info from an xml node""" def _get_value(child_name): return getattr(node.find(child_name), 'text', None) resolution = _get_value('resolution') defaultValue = node.find("defaultValue") strategy = defaultValue.find("strategy") i...
def md_dimension_info(name, node): """Extract metadata Dimension Info from an xml node""" def _get_value(child_name): return getattr(node.find(child_name), 'text', None) resolution = _get_value('resolution') defaultValue = node.find("defaultValue") strategy = defaultValue.find("strategy") i...
[ "Extract", "metadata", "Dimension", "Info", "from", "an", "xml", "node" ]
boundlessgeo/gsconfig
python
https://github.com/boundlessgeo/gsconfig/blob/532f561f32b91ea8debea0573c503dd20988bf40/src/geoserver/support.py#L399-L420
[ "def", "md_dimension_info", "(", "name", ",", "node", ")", ":", "def", "_get_value", "(", "child_name", ")", ":", "return", "getattr", "(", "node", ".", "find", "(", "child_name", ")", ",", "'text'", ",", "None", ")", "resolution", "=", "_get_value", "("...
532f561f32b91ea8debea0573c503dd20988bf40
valid
md_dynamic_default_values_info
Extract metadata Dynamic Default Values from an xml node
src/geoserver/support.py
def md_dynamic_default_values_info(name, node): """Extract metadata Dynamic Default Values from an xml node""" configurations = node.find("configurations") if configurations is not None: configurations = [] for n in node.findall("configuration"): dimension = n.find("dimension") ...
def md_dynamic_default_values_info(name, node): """Extract metadata Dynamic Default Values from an xml node""" configurations = node.find("configurations") if configurations is not None: configurations = [] for n in node.findall("configuration"): dimension = n.find("dimension") ...
[ "Extract", "metadata", "Dynamic", "Default", "Values", "from", "an", "xml", "node" ]
boundlessgeo/gsconfig
python
https://github.com/boundlessgeo/gsconfig/blob/532f561f32b91ea8debea0573c503dd20988bf40/src/geoserver/support.py#L461-L476
[ "def", "md_dynamic_default_values_info", "(", "name", ",", "node", ")", ":", "configurations", "=", "node", ".", "find", "(", "\"configurations\"", ")", "if", "configurations", "is", "not", "None", ":", "configurations", "=", "[", "]", "for", "n", "in", "nod...
532f561f32b91ea8debea0573c503dd20988bf40
valid
md_jdbc_virtual_table
Extract metadata JDBC Virtual Tables from an xml node
src/geoserver/support.py
def md_jdbc_virtual_table(key, node): """Extract metadata JDBC Virtual Tables from an xml node""" name = node.find("name") sql = node.find("sql") escapeSql = node.find("escapeSql") escapeSql = escapeSql.text if escapeSql is not None else None keyColumn = node.find("keyColumn") keyColumn = ke...
def md_jdbc_virtual_table(key, node): """Extract metadata JDBC Virtual Tables from an xml node""" name = node.find("name") sql = node.find("sql") escapeSql = node.find("escapeSql") escapeSql = escapeSql.text if escapeSql is not None else None keyColumn = node.find("keyColumn") keyColumn = ke...
[ "Extract", "metadata", "JDBC", "Virtual", "Tables", "from", "an", "xml", "node" ]
boundlessgeo/gsconfig
python
https://github.com/boundlessgeo/gsconfig/blob/532f561f32b91ea8debea0573c503dd20988bf40/src/geoserver/support.py#L563-L582
[ "def", "md_jdbc_virtual_table", "(", "key", ",", "node", ")", ":", "name", "=", "node", ".", "find", "(", "\"name\"", ")", "sql", "=", "node", ".", "find", "(", "\"sql\"", ")", "escapeSql", "=", "node", ".", "find", "(", "\"escapeSql\"", ")", "escapeSq...
532f561f32b91ea8debea0573c503dd20988bf40
valid
md_entry
Extract metadata entries from an xml node
src/geoserver/support.py
def md_entry(node): """Extract metadata entries from an xml node""" key = None value = None if 'key' in node.attrib: key = node.attrib['key'] else: key = None if key in ['time', 'elevation'] or key.startswith('custom_dimension'): value = md_dimension_info(key, node.find(...
def md_entry(node): """Extract metadata entries from an xml node""" key = None value = None if 'key' in node.attrib: key = node.attrib['key'] else: key = None if key in ['time', 'elevation'] or key.startswith('custom_dimension'): value = md_dimension_info(key, node.find(...
[ "Extract", "metadata", "entries", "from", "an", "xml", "node" ]
boundlessgeo/gsconfig
python
https://github.com/boundlessgeo/gsconfig/blob/532f561f32b91ea8debea0573c503dd20988bf40/src/geoserver/support.py#L585-L606
[ "def", "md_entry", "(", "node", ")", ":", "key", "=", "None", "value", "=", "None", "if", "'key'", "in", "node", ".", "attrib", ":", "key", "=", "node", ".", "attrib", "[", "'key'", "]", "else", ":", "key", "=", "None", "if", "key", "in", "[", ...
532f561f32b91ea8debea0573c503dd20988bf40
valid
DimensionInfo.resolution_millis
if set, get the value of resolution in milliseconds
src/geoserver/support.py
def resolution_millis(self): '''if set, get the value of resolution in milliseconds''' if self.resolution is None or not isinstance(self.resolution, basestring): return self.resolution val, mult = self.resolution.split(' ') return int(float(val) * self._multipier(mult) * ...
def resolution_millis(self): '''if set, get the value of resolution in milliseconds''' if self.resolution is None or not isinstance(self.resolution, basestring): return self.resolution val, mult = self.resolution.split(' ') return int(float(val) * self._multipier(mult) * ...
[ "if", "set", "get", "the", "value", "of", "resolution", "in", "milliseconds" ]
boundlessgeo/gsconfig
python
https://github.com/boundlessgeo/gsconfig/blob/532f561f32b91ea8debea0573c503dd20988bf40/src/geoserver/support.py#L376-L381
[ "def", "resolution_millis", "(", "self", ")", ":", "if", "self", ".", "resolution", "is", "None", "or", "not", "isinstance", "(", "self", ".", "resolution", ",", "basestring", ")", ":", "return", "self", ".", "resolution", "val", ",", "mult", "=", "self"...
532f561f32b91ea8debea0573c503dd20988bf40
valid
DimensionInfo.resolution_str
if set, get the value of resolution as "<n> <period>s", for example: "8 seconds"
src/geoserver/support.py
def resolution_str(self): '''if set, get the value of resolution as "<n> <period>s", for example: "8 seconds"''' if self.resolution is None or isinstance(self.resolution, basestring): return self.resolution seconds = self.resolution / 1000. biggest = self._lookup[0] f...
def resolution_str(self): '''if set, get the value of resolution as "<n> <period>s", for example: "8 seconds"''' if self.resolution is None or isinstance(self.resolution, basestring): return self.resolution seconds = self.resolution / 1000. biggest = self._lookup[0] f...
[ "if", "set", "get", "the", "value", "of", "resolution", "as", "<n", ">", "<period", ">", "s", "for", "example", ":", "8", "seconds" ]
boundlessgeo/gsconfig
python
https://github.com/boundlessgeo/gsconfig/blob/532f561f32b91ea8debea0573c503dd20988bf40/src/geoserver/support.py#L383-L396
[ "def", "resolution_str", "(", "self", ")", ":", "if", "self", ".", "resolution", "is", "None", "or", "isinstance", "(", "self", ".", "resolution", ",", "basestring", ")", ":", "return", "self", ".", "resolution", "seconds", "=", "self", ".", "resolution", ...
532f561f32b91ea8debea0573c503dd20988bf40
valid
MySQLBrowserResource._init
Read resource information into self._cache, for cached access. See DAVResource._init()
wsgidav/samples/mysql_dav_provider.py
def _init(self): """Read resource information into self._cache, for cached access. See DAVResource._init() """ # TODO: recalc self.path from <self._file_path>, to fix correct file system case # On windows this would lead to correct URLs self.provider._count_get_res...
def _init(self): """Read resource information into self._cache, for cached access. See DAVResource._init() """ # TODO: recalc self.path from <self._file_path>, to fix correct file system case # On windows this would lead to correct URLs self.provider._count_get_res...
[ "Read", "resource", "information", "into", "self", ".", "_cache", "for", "cached", "access", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/mysql_dav_provider.py#L90-L136
[ "def", "_init", "(", "self", ")", ":", "# TODO: recalc self.path from <self._file_path>, to fix correct file system case", "# On windows this would lead to correct URLs", "self", ".", "provider", ".", "_count_get_resource_inst_init", "+=", "1", "tableName", ",", "primKey", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
MySQLBrowserResource.get_member_list
Return list of (direct) collection member names (UTF-8 byte strings). See DAVResource.get_member_list()
wsgidav/samples/mysql_dav_provider.py
def get_member_list(self): """Return list of (direct) collection member names (UTF-8 byte strings). See DAVResource.get_member_list() """ members = [] conn = self.provider._init_connection() try: tableName, primKey = self.provider._split_path(self.path) ...
def get_member_list(self): """Return list of (direct) collection member names (UTF-8 byte strings). See DAVResource.get_member_list() """ members = [] conn = self.provider._init_connection() try: tableName, primKey = self.provider._split_path(self.path) ...
[ "Return", "list", "of", "(", "direct", ")", "collection", "member", "names", "(", "UTF", "-", "8", "byte", "strings", ")", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/mysql_dav_provider.py#L165-L209
[ "def", "get_member_list", "(", "self", ")", ":", "members", "=", "[", "]", "conn", "=", "self", ".", "provider", ".", "_init_connection", "(", ")", "try", ":", "tableName", ",", "primKey", "=", "self", ".", "provider", ".", "_split_path", "(", "self", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
MySQLBrowserResource.get_content
Open content as a stream for reading. See DAVResource.get_content()
wsgidav/samples/mysql_dav_provider.py
def get_content(self): """Open content as a stream for reading. See DAVResource.get_content() """ filestream = compat.StringIO() tableName, primKey = self.provider._split_path(self.path) if primKey is not None: conn = self.provider._init_connection() ...
def get_content(self): """Open content as a stream for reading. See DAVResource.get_content() """ filestream = compat.StringIO() tableName, primKey = self.provider._split_path(self.path) if primKey is not None: conn = self.provider._init_connection() ...
[ "Open", "content", "as", "a", "stream", "for", "reading", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/mysql_dav_provider.py#L211-L245
[ "def", "get_content", "(", "self", ")", ":", "filestream", "=", "compat", ".", "StringIO", "(", ")", "tableName", ",", "primKey", "=", "self", ".", "provider", ".", "_split_path", "(", "self", ".", "path", ")", "if", "primKey", "is", "not", "None", ":"...
cec0d84222fc24bea01be1cea91729001963f172
valid
MySQLBrowserResource.get_property_names
Return list of supported property names in Clark Notation. Return supported live and dead properties. (See also DAVProvider.get_property_names().) In addition, all table field names are returned as properties.
wsgidav/samples/mysql_dav_provider.py
def get_property_names(self, is_allprop): """Return list of supported property names in Clark Notation. Return supported live and dead properties. (See also DAVProvider.get_property_names().) In addition, all table field names are returned as properties. """ # Let default imple...
def get_property_names(self, is_allprop): """Return list of supported property names in Clark Notation. Return supported live and dead properties. (See also DAVProvider.get_property_names().) In addition, all table field names are returned as properties. """ # Let default imple...
[ "Return", "list", "of", "supported", "property", "names", "in", "Clark", "Notation", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/mysql_dav_provider.py#L247-L264
[ "def", "get_property_names", "(", "self", ",", "is_allprop", ")", ":", "# Let default implementation return supported live and dead properties", "propNames", "=", "super", "(", "MySQLBrowserResource", ",", "self", ")", ".", "get_property_names", "(", "is_allprop", ")", "#...
cec0d84222fc24bea01be1cea91729001963f172
valid
MySQLBrowserResource.get_property_value
Return the value of a property. The base implementation handles: - ``{DAV:}lockdiscovery`` and ``{DAV:}supportedlock`` using the associated lock manager. - All other *live* properties (i.e. name starts with ``{DAV:}``) are delegated to self.getLivePropertyValue() - ...
wsgidav/samples/mysql_dav_provider.py
def get_property_value(self, name): """Return the value of a property. The base implementation handles: - ``{DAV:}lockdiscovery`` and ``{DAV:}supportedlock`` using the associated lock manager. - All other *live* properties (i.e. name starts with ``{DAV:}``) are dele...
def get_property_value(self, name): """Return the value of a property. The base implementation handles: - ``{DAV:}lockdiscovery`` and ``{DAV:}supportedlock`` using the associated lock manager. - All other *live* properties (i.e. name starts with ``{DAV:}``) are dele...
[ "Return", "the", "value", "of", "a", "property", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/mysql_dav_provider.py#L266-L293
[ "def", "get_property_value", "(", "self", ",", "name", ")", ":", "# Return table field as property", "tableName", ",", "primKey", "=", "self", ".", "provider", ".", "_split_path", "(", "self", ".", "path", ")", "if", "primKey", "is", "not", "None", ":", "ns"...
cec0d84222fc24bea01be1cea91729001963f172
valid
MySQLBrowserResource.set_property_value
Set or remove property value. See DAVResource.set_property_value()
wsgidav/samples/mysql_dav_provider.py
def set_property_value(self, name, value, dry_run=False): """Set or remove property value. See DAVResource.set_property_value() """ raise DAVError( HTTP_FORBIDDEN, err_condition=PRECONDITION_CODE_ProtectedProperty )
def set_property_value(self, name, value, dry_run=False): """Set or remove property value. See DAVResource.set_property_value() """ raise DAVError( HTTP_FORBIDDEN, err_condition=PRECONDITION_CODE_ProtectedProperty )
[ "Set", "or", "remove", "property", "value", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/mysql_dav_provider.py#L295-L302
[ "def", "set_property_value", "(", "self", ",", "name", ",", "value", ",", "dry_run", "=", "False", ")", ":", "raise", "DAVError", "(", "HTTP_FORBIDDEN", ",", "err_condition", "=", "PRECONDITION_CODE_ProtectedProperty", ")" ]
cec0d84222fc24bea01be1cea91729001963f172
valid
MySQLBrowserProvider._split_path
Return (tableName, primaryKey) tuple for a request path.
wsgidav/samples/mysql_dav_provider.py
def _split_path(self, path): """Return (tableName, primaryKey) tuple for a request path.""" if path.strip() in (None, "", "/"): return (None, None) tableName, primKey = util.save_split(path.strip("/"), "/", 1) # _logger.debug("'%s' -> ('%s', '%s')" % (path, tableName, ...
def _split_path(self, path): """Return (tableName, primaryKey) tuple for a request path.""" if path.strip() in (None, "", "/"): return (None, None) tableName, primKey = util.save_split(path.strip("/"), "/", 1) # _logger.debug("'%s' -> ('%s', '%s')" % (path, tableName, ...
[ "Return", "(", "tableName", "primaryKey", ")", "tuple", "for", "a", "request", "path", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/mysql_dav_provider.py#L327-L333
[ "def", "_split_path", "(", "self", ",", "path", ")", ":", "if", "path", ".", "strip", "(", ")", "in", "(", "None", ",", "\"\"", ",", "\"/\"", ")", ":", "return", "(", "None", ",", "None", ")", "tableName", ",", "primKey", "=", "util", ".", "save_...
cec0d84222fc24bea01be1cea91729001963f172
valid
MySQLBrowserProvider.get_resource_inst
Return info dictionary for path. See get_resource_inst()
wsgidav/samples/mysql_dav_provider.py
def get_resource_inst(self, path, environ): """Return info dictionary for path. See get_resource_inst() """ # TODO: calling exists() makes directory browsing VERY slow. # At least compared to PyFileServer, which simply used string # functions to get display_t...
def get_resource_inst(self, path, environ): """Return info dictionary for path. See get_resource_inst() """ # TODO: calling exists() makes directory browsing VERY slow. # At least compared to PyFileServer, which simply used string # functions to get display_t...
[ "Return", "info", "dictionary", "for", "path", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/mysql_dav_provider.py#L569-L582
[ "def", "get_resource_inst", "(", "self", ",", "path", ",", "environ", ")", ":", "# TODO: calling exists() makes directory browsing VERY slow.", "# At least compared to PyFileServer, which simply used string", "# functions to get display_type and displayTypeComment", "self", "...
cec0d84222fc24bea01be1cea91729001963f172
valid
get_http_status_string
Return HTTP response string, e.g. 204 -> ('204 No Content'). The return string always includes descriptive text, to satisfy Apache mod_dav. `v`: status code or DAVError
wsgidav/dav_error.py
def get_http_status_string(v): """Return HTTP response string, e.g. 204 -> ('204 No Content'). The return string always includes descriptive text, to satisfy Apache mod_dav. `v`: status code or DAVError """ code = get_http_status_code(v) try: return ERROR_DESCRIPTIONS[code] except K...
def get_http_status_string(v): """Return HTTP response string, e.g. 204 -> ('204 No Content'). The return string always includes descriptive text, to satisfy Apache mod_dav. `v`: status code or DAVError """ code = get_http_status_code(v) try: return ERROR_DESCRIPTIONS[code] except K...
[ "Return", "HTTP", "response", "string", "e", ".", "g", ".", "204", "-", ">", "(", "204", "No", "Content", ")", ".", "The", "return", "string", "always", "includes", "descriptive", "text", "to", "satisfy", "Apache", "mod_dav", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_error.py#L264-L274
[ "def", "get_http_status_string", "(", "v", ")", ":", "code", "=", "get_http_status_code", "(", "v", ")", "try", ":", "return", "ERROR_DESCRIPTIONS", "[", "code", "]", "except", "KeyError", ":", "return", "\"{} Status\"", ".", "format", "(", "code", ")" ]
cec0d84222fc24bea01be1cea91729001963f172
valid
as_DAVError
Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.
wsgidav/dav_error.py
def as_DAVError(e): """Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.""" if isinstance(e, DAVError): return e elif isinstance(e, Exception): # traceback.print_exc() return DAVError(HTTP_INTERNAL_ERROR, src_exception=e) else: return DAVError(HTTP_INTERNAL_ERROR...
def as_DAVError(e): """Convert any non-DAVError exception to HTTP_INTERNAL_ERROR.""" if isinstance(e, DAVError): return e elif isinstance(e, Exception): # traceback.print_exc() return DAVError(HTTP_INTERNAL_ERROR, src_exception=e) else: return DAVError(HTTP_INTERNAL_ERROR...
[ "Convert", "any", "non", "-", "DAVError", "exception", "to", "HTTP_INTERNAL_ERROR", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_error.py#L282-L290
[ "def", "as_DAVError", "(", "e", ")", ":", "if", "isinstance", "(", "e", ",", "DAVError", ")", ":", "return", "e", "elif", "isinstance", "(", "e", ",", "Exception", ")", ":", "# traceback.print_exc()", "return", "DAVError", "(", "HTTP_INTERNAL_ERROR", ",", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
DAVError.get_user_info
Return readable string.
wsgidav/dav_error.py
def get_user_info(self): """Return readable string.""" if self.value in ERROR_DESCRIPTIONS: s = "{}".format(ERROR_DESCRIPTIONS[self.value]) else: s = "{}".format(self.value) if self.context_info: s += ": {}".format(self.context_info) elif self...
def get_user_info(self): """Return readable string.""" if self.value in ERROR_DESCRIPTIONS: s = "{}".format(ERROR_DESCRIPTIONS[self.value]) else: s = "{}".format(self.value) if self.context_info: s += ": {}".format(self.context_info) elif self...
[ "Return", "readable", "string", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_error.py#L205-L222
[ "def", "get_user_info", "(", "self", ")", ":", "if", "self", ".", "value", "in", "ERROR_DESCRIPTIONS", ":", "s", "=", "\"{}\"", ".", "format", "(", "ERROR_DESCRIPTIONS", "[", "self", ".", "value", "]", ")", "else", ":", "s", "=", "\"{}\"", ".", "format...
cec0d84222fc24bea01be1cea91729001963f172
valid
DAVError.get_response_page
Return a tuple (content-type, response page).
wsgidav/dav_error.py
def get_response_page(self): """Return a tuple (content-type, response page).""" # If it has pre- or post-condition: return as XML response if self.err_condition: return ("application/xml", compat.to_bytes(self.err_condition.as_string())) # Else return as HTML status...
def get_response_page(self): """Return a tuple (content-type, response page).""" # If it has pre- or post-condition: return as XML response if self.err_condition: return ("application/xml", compat.to_bytes(self.err_condition.as_string())) # Else return as HTML status...
[ "Return", "a", "tuple", "(", "content", "-", "type", "response", "page", ")", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_error.py#L224-L253
[ "def", "get_response_page", "(", "self", ")", ":", "# If it has pre- or post-condition: return as XML response", "if", "self", ".", "err_condition", ":", "return", "(", "\"application/xml\"", ",", "compat", ".", "to_bytes", "(", "self", ".", "err_condition", ".", "as_...
cec0d84222fc24bea01be1cea91729001963f172
valid
VirtualResource.handle_delete
Change semantic of DELETE to remove resource tags.
wsgidav/samples/virtual_dav_provider.py
def handle_delete(self): """Change semantic of DELETE to remove resource tags.""" # DELETE is only supported for the '/by_tag/' collection if "/by_tag/" not in self.path: raise DAVError(HTTP_FORBIDDEN) # path must be '/by_tag/<tag>/<resname>' catType, tag, _rest = uti...
def handle_delete(self): """Change semantic of DELETE to remove resource tags.""" # DELETE is only supported for the '/by_tag/' collection if "/by_tag/" not in self.path: raise DAVError(HTTP_FORBIDDEN) # path must be '/by_tag/<tag>/<resname>' catType, tag, _rest = uti...
[ "Change", "semantic", "of", "DELETE", "to", "remove", "resource", "tags", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/virtual_dav_provider.py#L311-L321
[ "def", "handle_delete", "(", "self", ")", ":", "# DELETE is only supported for the '/by_tag/' collection", "if", "\"/by_tag/\"", "not", "in", "self", ".", "path", ":", "raise", "DAVError", "(", "HTTP_FORBIDDEN", ")", "# path must be '/by_tag/<tag>/<resname>'", "catType", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
VirtualResource.handle_copy
Change semantic of COPY to add resource tags.
wsgidav/samples/virtual_dav_provider.py
def handle_copy(self, dest_path, depth_infinity): """Change semantic of COPY to add resource tags.""" # destPath must be '/by_tag/<tag>/<resname>' if "/by_tag/" not in dest_path: raise DAVError(HTTP_FORBIDDEN) catType, tag, _rest = util.save_split(dest_path.strip("/"), "/", 2...
def handle_copy(self, dest_path, depth_infinity): """Change semantic of COPY to add resource tags.""" # destPath must be '/by_tag/<tag>/<resname>' if "/by_tag/" not in dest_path: raise DAVError(HTTP_FORBIDDEN) catType, tag, _rest = util.save_split(dest_path.strip("/"), "/", 2...
[ "Change", "semantic", "of", "COPY", "to", "add", "resource", "tags", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/virtual_dav_provider.py#L323-L332
[ "def", "handle_copy", "(", "self", ",", "dest_path", ",", "depth_infinity", ")", ":", "# destPath must be '/by_tag/<tag>/<resname>'", "if", "\"/by_tag/\"", "not", "in", "dest_path", ":", "raise", "DAVError", "(", "HTTP_FORBIDDEN", ")", "catType", ",", "tag", ",", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
VirtualResource.handle_move
Change semantic of MOVE to change resource tags.
wsgidav/samples/virtual_dav_provider.py
def handle_move(self, dest_path): """Change semantic of MOVE to change resource tags.""" # path and destPath must be '/by_tag/<tag>/<resname>' if "/by_tag/" not in self.path: raise DAVError(HTTP_FORBIDDEN) if "/by_tag/" not in dest_path: raise DAVError(HTTP_FORBID...
def handle_move(self, dest_path): """Change semantic of MOVE to change resource tags.""" # path and destPath must be '/by_tag/<tag>/<resname>' if "/by_tag/" not in self.path: raise DAVError(HTTP_FORBIDDEN) if "/by_tag/" not in dest_path: raise DAVError(HTTP_FORBID...
[ "Change", "semantic", "of", "MOVE", "to", "change", "resource", "tags", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/virtual_dav_provider.py#L334-L349
[ "def", "handle_move", "(", "self", ",", "dest_path", ")", ":", "# path and destPath must be '/by_tag/<tag>/<resname>'", "if", "\"/by_tag/\"", "not", "in", "self", ".", "path", ":", "raise", "DAVError", "(", "HTTP_FORBIDDEN", ")", "if", "\"/by_tag/\"", "not", "in", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
VirtualResource.get_property_names
Return list of supported property names in Clark Notation. See DAVResource.get_property_names()
wsgidav/samples/virtual_dav_provider.py
def get_property_names(self, is_allprop): """Return list of supported property names in Clark Notation. See DAVResource.get_property_names() """ # Let base class implementation add supported live and dead properties propNameList = super(VirtualResource, self).get_property_names(...
def get_property_names(self, is_allprop): """Return list of supported property names in Clark Notation. See DAVResource.get_property_names() """ # Let base class implementation add supported live and dead properties propNameList = super(VirtualResource, self).get_property_names(...
[ "Return", "list", "of", "supported", "property", "names", "in", "Clark", "Notation", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/virtual_dav_provider.py#L355-L364
[ "def", "get_property_names", "(", "self", ",", "is_allprop", ")", ":", "# Let base class implementation add supported live and dead properties", "propNameList", "=", "super", "(", "VirtualResource", ",", "self", ")", ".", "get_property_names", "(", "is_allprop", ")", "# A...
cec0d84222fc24bea01be1cea91729001963f172
valid
VirtualResource.get_property_value
Return the value of a property. See get_property_value()
wsgidav/samples/virtual_dav_provider.py
def get_property_value(self, name): """Return the value of a property. See get_property_value() """ # Supported custom live properties if name == "{virtres:}key": return self.data["key"] elif name == "{virtres:}title": return self.data["title"] ...
def get_property_value(self, name): """Return the value of a property. See get_property_value() """ # Supported custom live properties if name == "{virtres:}key": return self.data["key"] elif name == "{virtres:}title": return self.data["title"] ...
[ "Return", "the", "value", "of", "a", "property", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/virtual_dav_provider.py#L366-L386
[ "def", "get_property_value", "(", "self", ",", "name", ")", ":", "# Supported custom live properties", "if", "name", "==", "\"{virtres:}key\"", ":", "return", "self", ".", "data", "[", "\"key\"", "]", "elif", "name", "==", "\"{virtres:}title\"", ":", "return", "...
cec0d84222fc24bea01be1cea91729001963f172
valid
VirtualResource.set_property_value
Set or remove property value. See DAVResource.set_property_value()
wsgidav/samples/virtual_dav_provider.py
def set_property_value(self, name, value, dry_run=False): """Set or remove property value. See DAVResource.set_property_value() """ if value is None: # We can never remove properties raise DAVError(HTTP_FORBIDDEN) if name == "{virtres:}tags": ...
def set_property_value(self, name, value, dry_run=False): """Set or remove property value. See DAVResource.set_property_value() """ if value is None: # We can never remove properties raise DAVError(HTTP_FORBIDDEN) if name == "{virtres:}tags": ...
[ "Set", "or", "remove", "property", "value", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/virtual_dav_provider.py#L388-L411
[ "def", "set_property_value", "(", "self", ",", "name", ",", "value", ",", "dry_run", "=", "False", ")", ":", "if", "value", "is", "None", ":", "# We can never remove properties", "raise", "DAVError", "(", "HTTP_FORBIDDEN", ")", "if", "name", "==", "\"{virtres:...
cec0d84222fc24bea01be1cea91729001963f172
valid
VirtualResourceProvider.get_resource_inst
Return _VirtualResource object for path. path is expected to be categoryType/category/name/artifact for example: 'by_tag/cool/My doc 2/info.html' See DAVProvider.get_resource_inst()
wsgidav/samples/virtual_dav_provider.py
def get_resource_inst(self, path, environ): """Return _VirtualResource object for path. path is expected to be categoryType/category/name/artifact for example: 'by_tag/cool/My doc 2/info.html' See DAVProvider.get_resource_inst() """ _logger.info(...
def get_resource_inst(self, path, environ): """Return _VirtualResource object for path. path is expected to be categoryType/category/name/artifact for example: 'by_tag/cool/My doc 2/info.html' See DAVProvider.get_resource_inst() """ _logger.info(...
[ "Return", "_VirtualResource", "object", "for", "path", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/virtual_dav_provider.py#L604-L617
[ "def", "get_resource_inst", "(", "self", ",", "path", ",", "environ", ")", ":", "_logger", ".", "info", "(", "\"get_resource_inst('%s')\"", "%", "path", ")", "self", ".", "_count_get_resource_inst", "+=", "1", "root", "=", "RootCollection", "(", "environ", ")"...
cec0d84222fc24bea01be1cea91729001963f172
valid
WsgiDAVApp.add_provider
Add a provider to the provider_map routing table.
wsgidav/wsgidav_app.py
def add_provider(self, share, provider, readonly=False): """Add a provider to the provider_map routing table.""" # Make sure share starts with, or is '/' share = "/" + share.strip("/") assert share not in self.provider_map if compat.is_basestring(provider): # Syntax:...
def add_provider(self, share, provider, readonly=False): """Add a provider to the provider_map routing table.""" # Make sure share starts with, or is '/' share = "/" + share.strip("/") assert share not in self.provider_map if compat.is_basestring(provider): # Syntax:...
[ "Add", "a", "provider", "to", "the", "provider_map", "routing", "table", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/wsgidav_app.py#L290-L342
[ "def", "add_provider", "(", "self", ",", "share", ",", "provider", ",", "readonly", "=", "False", ")", ":", "# Make sure share starts with, or is '/'", "share", "=", "\"/\"", "+", "share", ".", "strip", "(", "\"/\"", ")", "assert", "share", "not", "in", "sel...
cec0d84222fc24bea01be1cea91729001963f172
valid
WsgiDAVApp.resolve_provider
Get the registered DAVProvider for a given path. Returns: tuple: (share, provider)
wsgidav/wsgidav_app.py
def resolve_provider(self, path): """Get the registered DAVProvider for a given path. Returns: tuple: (share, provider) """ # Find DAV provider that matches the share share = None lower_path = path.lower() for r in self.sorted_share_list: ...
def resolve_provider(self, path): """Get the registered DAVProvider for a given path. Returns: tuple: (share, provider) """ # Find DAV provider that matches the share share = None lower_path = path.lower() for r in self.sorted_share_list: ...
[ "Get", "the", "registered", "DAVProvider", "for", "a", "given", "path", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/wsgidav_app.py#L344-L365
[ "def", "resolve_provider", "(", "self", ",", "path", ")", ":", "# Find DAV provider that matches the share", "share", "=", "None", "lower_path", "=", "path", ".", "lower", "(", ")", "for", "r", "in", "self", ".", "sorted_share_list", ":", "# @@: Case sensitivity s...
cec0d84222fc24bea01be1cea91729001963f172
valid
HTTPAuthenticator.compute_digest_response
Computes digest hash. Calculation of the A1 (HA1) part is delegated to the dc interface method `digest_auth_user()`. Args: realm (str): user_name (str): method (str): WebDAV Request Method uri (str): nonce (str): server generated nonc...
wsgidav/http_authenticator.py
def compute_digest_response( self, realm, user_name, method, uri, nonce, cnonce, qop, nc, environ ): """Computes digest hash. Calculation of the A1 (HA1) part is delegated to the dc interface method `digest_auth_user()`. Args: realm (str): user_name ...
def compute_digest_response( self, realm, user_name, method, uri, nonce, cnonce, qop, nc, environ ): """Computes digest hash. Calculation of the A1 (HA1) part is delegated to the dc interface method `digest_auth_user()`. Args: realm (str): user_name ...
[ "Computes", "digest", "hash", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/http_authenticator.py#L566-L607
[ "def", "compute_digest_response", "(", "self", ",", "realm", ",", "user_name", ",", "method", ",", "uri", ",", "nonce", ",", "cnonce", ",", "qop", ",", "nc", ",", "environ", ")", ":", "def", "md5h", "(", "data", ")", ":", "return", "md5", "(", "compa...
cec0d84222fc24bea01be1cea91729001963f172
valid
FileLikeQueue.read
Read a chunk of bytes from queue. size = 0: Read next chunk (arbitrary length) > 0: Read one chunk of `size` bytes (or less if stream was closed) < 0: Read all bytes as single chunk (i.e. blocks until stream is closed) This method blocks until the requested size become availa...
wsgidav/stream_tools.py
def read(self, size=0): """Read a chunk of bytes from queue. size = 0: Read next chunk (arbitrary length) > 0: Read one chunk of `size` bytes (or less if stream was closed) < 0: Read all bytes as single chunk (i.e. blocks until stream is closed) This method blocks unt...
def read(self, size=0): """Read a chunk of bytes from queue. size = 0: Read next chunk (arbitrary length) > 0: Read one chunk of `size` bytes (or less if stream was closed) < 0: Read all bytes as single chunk (i.e. blocks until stream is closed) This method blocks unt...
[ "Read", "a", "chunk", "of", "bytes", "from", "queue", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/stream_tools.py#L55-L82
[ "def", "read", "(", "self", ",", "size", "=", "0", ")", ":", "res", "=", "self", ".", "unread", "self", ".", "unread", "=", "\"\"", "# Get next chunk, cumulating requested size as needed", "while", "res", "==", "\"\"", "or", "size", "<", "0", "or", "(", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
FileLikeQueue.write
Put a chunk of bytes (or an iterable) to the queue. May block if max_size number of chunks is reached.
wsgidav/stream_tools.py
def write(self, chunk): """Put a chunk of bytes (or an iterable) to the queue. May block if max_size number of chunks is reached. """ if self.is_closed: raise ValueError("Cannot write to closed object") # print("FileLikeQueue.write(), n={}".format(len(chunk))) ...
def write(self, chunk): """Put a chunk of bytes (or an iterable) to the queue. May block if max_size number of chunks is reached. """ if self.is_closed: raise ValueError("Cannot write to closed object") # print("FileLikeQueue.write(), n={}".format(len(chunk))) ...
[ "Put", "a", "chunk", "of", "bytes", "(", "or", "an", "iterable", ")", "to", "the", "queue", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/stream_tools.py#L84-L97
[ "def", "write", "(", "self", ",", "chunk", ")", ":", "if", "self", ".", "is_closed", ":", "raise", "ValueError", "(", "\"Cannot write to closed object\"", ")", "# print(\"FileLikeQueue.write(), n={}\".format(len(chunk)))", "# Add chunk to queue (blocks if queue is full)", "if...
cec0d84222fc24bea01be1cea91729001963f172
valid
StreamingFile.read
Read bytes from an iterator.
wsgidav/stream_tools.py
def read(self, size=None): """Read bytes from an iterator.""" while size is None or len(self.buffer) < size: try: self.buffer += next(self.data_stream) except StopIteration: break sized_chunk = self.buffer[:size] if size is None: ...
def read(self, size=None): """Read bytes from an iterator.""" while size is None or len(self.buffer) < size: try: self.buffer += next(self.data_stream) except StopIteration: break sized_chunk = self.buffer[:size] if size is None: ...
[ "Read", "bytes", "from", "an", "iterator", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/stream_tools.py#L133-L146
[ "def", "read", "(", "self", ",", "size", "=", "None", ")", ":", "while", "size", "is", "None", "or", "len", "(", "self", ".", "buffer", ")", "<", "size", ":", "try", ":", "self", ".", "buffer", "+=", "next", "(", "self", ".", "data_stream", ")", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
ExtServer.handle_error
Handle an error gracefully. May be overridden. The default is to _logger.info a traceback and continue.
wsgidav/server/ext_wsgiutils_server.py
def handle_error(self, request, client_address): """Handle an error gracefully. May be overridden. The default is to _logger.info a traceback and continue. """ ei = sys.exc_info() e = ei[1] # Suppress stack trace when client aborts connection disgracefully: # 1...
def handle_error(self, request, client_address): """Handle an error gracefully. May be overridden. The default is to _logger.info a traceback and continue. """ ei = sys.exc_info() e = ei[1] # Suppress stack trace when client aborts connection disgracefully: # 1...
[ "Handle", "an", "error", "gracefully", ".", "May", "be", "overridden", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/server/ext_wsgiutils_server.py#L302-L327
[ "def", "handle_error", "(", "self", ",", "request", ",", "client_address", ")", ":", "ei", "=", "sys", ".", "exc_info", "(", ")", "e", "=", "ei", "[", "1", "]", "# Suppress stack trace when client aborts connection disgracefully:", "# 10053: Software caused connection...
cec0d84222fc24bea01be1cea91729001963f172
valid
ExtServer.stop_serve_forever
Stop serve_forever_stoppable().
wsgidav/server/ext_wsgiutils_server.py
def stop_serve_forever(self): """Stop serve_forever_stoppable().""" assert hasattr( self, "stop_request" ), "serve_forever_stoppable() must be called before" assert not self.stop_request, "stop_serve_forever() must only be called once" # # Flag stop request ...
def stop_serve_forever(self): """Stop serve_forever_stoppable().""" assert hasattr( self, "stop_request" ), "serve_forever_stoppable() must be called before" assert not self.stop_request, "stop_serve_forever() must only be called once" # # Flag stop request ...
[ "Stop", "serve_forever_stoppable", "()", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/server/ext_wsgiutils_server.py#L331-L367
[ "def", "stop_serve_forever", "(", "self", ")", ":", "assert", "hasattr", "(", "self", ",", "\"stop_request\"", ")", ",", "\"serve_forever_stoppable() must be called before\"", "assert", "not", "self", ".", "stop_request", ",", "\"stop_serve_forever() must only be called onc...
cec0d84222fc24bea01be1cea91729001963f172
valid
ExtServer.serve_forever_stoppable
Handle one request at a time until stop_serve_forever(). http://code.activestate.com/recipes/336012/
wsgidav/server/ext_wsgiutils_server.py
def serve_forever_stoppable(self): """Handle one request at a time until stop_serve_forever(). http://code.activestate.com/recipes/336012/ """ self.stop_request = False self.stopped = False while not self.stop_request: self.handle_request() # ...
def serve_forever_stoppable(self): """Handle one request at a time until stop_serve_forever(). http://code.activestate.com/recipes/336012/ """ self.stop_request = False self.stopped = False while not self.stop_request: self.handle_request() # ...
[ "Handle", "one", "request", "at", "a", "time", "until", "stop_serve_forever", "()", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/server/ext_wsgiutils_server.py#L369-L381
[ "def", "serve_forever_stoppable", "(", "self", ")", ":", "self", ".", "stop_request", "=", "False", "self", ".", "stopped", "=", "False", "while", "not", "self", ".", "stop_request", ":", "self", ".", "handle_request", "(", ")", "# _logger.info \"serve_fo...
cec0d84222fc24bea01be1cea91729001963f172
valid
HgResource.get_property_names
Return list of supported property names in Clark Notation. See DAVResource.get_property_names()
wsgidav/samples/hg_dav_provider.py
def get_property_names(self, is_allprop): """Return list of supported property names in Clark Notation. See DAVResource.get_property_names() """ # Let base class implementation add supported live and dead properties propNameList = super(HgResource, self).get_property_names(is_al...
def get_property_names(self, is_allprop): """Return list of supported property names in Clark Notation. See DAVResource.get_property_names() """ # Let base class implementation add supported live and dead properties propNameList = super(HgResource, self).get_property_names(is_al...
[ "Return", "list", "of", "supported", "property", "names", "in", "Clark", "Notation", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/hg_dav_provider.py#L223-L242
[ "def", "get_property_names", "(", "self", ",", "is_allprop", ")", ":", "# Let base class implementation add supported live and dead properties", "propNameList", "=", "super", "(", "HgResource", ",", "self", ")", ".", "get_property_names", "(", "is_allprop", ")", "# Add cu...
cec0d84222fc24bea01be1cea91729001963f172
valid
HgResource.get_property_value
Return the value of a property. See get_property_value()
wsgidav/samples/hg_dav_provider.py
def get_property_value(self, name): """Return the value of a property. See get_property_value() """ # Supported custom live properties if name == "{hg:}branch": return self.fctx.branch() elif name == "{hg:}date": # (secs, tz-ofs) retur...
def get_property_value(self, name): """Return the value of a property. See get_property_value() """ # Supported custom live properties if name == "{hg:}branch": return self.fctx.branch() elif name == "{hg:}date": # (secs, tz-ofs) retur...
[ "Return", "the", "value", "of", "a", "property", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/hg_dav_provider.py#L244-L265
[ "def", "get_property_value", "(", "self", ",", "name", ")", ":", "# Supported custom live properties", "if", "name", "==", "\"{hg:}branch\"", ":", "return", "self", ".", "fctx", ".", "branch", "(", ")", "elif", "name", "==", "\"{hg:}date\"", ":", "# (secs, tz-of...
cec0d84222fc24bea01be1cea91729001963f172
valid
HgResource.create_empty_resource
Create and return an empty (length-0) resource as member of self. See DAVResource.create_empty_resource()
wsgidav/samples/hg_dav_provider.py
def create_empty_resource(self, name): """Create and return an empty (length-0) resource as member of self. See DAVResource.create_empty_resource() """ assert self.is_collection self._check_write_access() filepath = self._getFilePath(name) f = open(filepath, "w")...
def create_empty_resource(self, name): """Create and return an empty (length-0) resource as member of self. See DAVResource.create_empty_resource() """ assert self.is_collection self._check_write_access() filepath = self._getFilePath(name) f = open(filepath, "w")...
[ "Create", "and", "return", "an", "empty", "(", "length", "-", "0", ")", "resource", "as", "member", "of", "self", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/hg_dav_provider.py#L284-L303
[ "def", "create_empty_resource", "(", "self", ",", "name", ")", ":", "assert", "self", ".", "is_collection", "self", ".", "_check_write_access", "(", ")", "filepath", "=", "self", ".", "_getFilePath", "(", "name", ")", "f", "=", "open", "(", "filepath", ","...
cec0d84222fc24bea01be1cea91729001963f172
valid
HgResource.create_collection
Create a new collection as member of self. A dummy member is created, because Mercurial doesn't handle folders.
wsgidav/samples/hg_dav_provider.py
def create_collection(self, name): """Create a new collection as member of self. A dummy member is created, because Mercurial doesn't handle folders. """ assert self.is_collection self._check_write_access() collpath = self._getFilePath(name) os.mkdir(collpath) ...
def create_collection(self, name): """Create a new collection as member of self. A dummy member is created, because Mercurial doesn't handle folders. """ assert self.is_collection self._check_write_access() collpath = self._getFilePath(name) os.mkdir(collpath) ...
[ "Create", "a", "new", "collection", "as", "member", "of", "self", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/hg_dav_provider.py#L305-L318
[ "def", "create_collection", "(", "self", ",", "name", ")", ":", "assert", "self", ".", "is_collection", "self", ".", "_check_write_access", "(", ")", "collpath", "=", "self", ".", "_getFilePath", "(", "name", ")", "os", ".", "mkdir", "(", "collpath", ")", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
HgResource.get_content
Open content as a stream for reading. See DAVResource.get_content()
wsgidav/samples/hg_dav_provider.py
def get_content(self): """Open content as a stream for reading. See DAVResource.get_content() """ assert not self.is_collection d = self.fctx.data() return compat.StringIO(d)
def get_content(self): """Open content as a stream for reading. See DAVResource.get_content() """ assert not self.is_collection d = self.fctx.data() return compat.StringIO(d)
[ "Open", "content", "as", "a", "stream", "for", "reading", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/hg_dav_provider.py#L320-L327
[ "def", "get_content", "(", "self", ")", ":", "assert", "not", "self", ".", "is_collection", "d", "=", "self", ".", "fctx", ".", "data", "(", ")", "return", "compat", ".", "StringIO", "(", "d", ")" ]
cec0d84222fc24bea01be1cea91729001963f172
valid
HgResource.begin_write
Open content as a stream for writing. See DAVResource.begin_write()
wsgidav/samples/hg_dav_provider.py
def begin_write(self, content_type=None): """Open content as a stream for writing. See DAVResource.begin_write() """ assert not self.is_collection self._check_write_access() mode = "wb" # GC issue 57: always store as binary # if contentType and con...
def begin_write(self, content_type=None): """Open content as a stream for writing. See DAVResource.begin_write() """ assert not self.is_collection self._check_write_access() mode = "wb" # GC issue 57: always store as binary # if contentType and con...
[ "Open", "content", "as", "a", "stream", "for", "writing", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/hg_dav_provider.py#L329-L340
[ "def", "begin_write", "(", "self", ",", "content_type", "=", "None", ")", ":", "assert", "not", "self", ".", "is_collection", "self", ".", "_check_write_access", "(", ")", "mode", "=", "\"wb\"", "# GC issue 57: always store as binary", "# if contentType and con...
cec0d84222fc24bea01be1cea91729001963f172
valid
HgResource.end_write
Called when PUT has finished writing. See DAVResource.end_write()
wsgidav/samples/hg_dav_provider.py
def end_write(self, with_errors): """Called when PUT has finished writing. See DAVResource.end_write() """ if not with_errors: commands.add(self.provider.ui, self.provider.repo, self.localHgPath)
def end_write(self, with_errors): """Called when PUT has finished writing. See DAVResource.end_write() """ if not with_errors: commands.add(self.provider.ui, self.provider.repo, self.localHgPath)
[ "Called", "when", "PUT", "has", "finished", "writing", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/hg_dav_provider.py#L342-L348
[ "def", "end_write", "(", "self", ",", "with_errors", ")", ":", "if", "not", "with_errors", ":", "commands", ".", "add", "(", "self", ".", "provider", ".", "ui", ",", "self", ".", "provider", ".", "repo", ",", "self", ".", "localHgPath", ")" ]
cec0d84222fc24bea01be1cea91729001963f172
valid
HgResource.delete
Remove this resource (recursive).
wsgidav/samples/hg_dav_provider.py
def delete(self): """Remove this resource (recursive).""" self._check_write_access() filepath = self._getFilePath() commands.remove(self.provider.ui, self.provider.repo, filepath, force=True)
def delete(self): """Remove this resource (recursive).""" self._check_write_access() filepath = self._getFilePath() commands.remove(self.provider.ui, self.provider.repo, filepath, force=True)
[ "Remove", "this", "resource", "(", "recursive", ")", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/hg_dav_provider.py#L362-L366
[ "def", "delete", "(", "self", ")", ":", "self", ".", "_check_write_access", "(", ")", "filepath", "=", "self", ".", "_getFilePath", "(", ")", "commands", ".", "remove", "(", "self", ".", "provider", ".", "ui", ",", "self", ".", "provider", ".", "repo",...
cec0d84222fc24bea01be1cea91729001963f172
valid
HgResource.handle_copy
Handle a COPY request natively.
wsgidav/samples/hg_dav_provider.py
def handle_copy(self, dest_path, depth_infinity): """Handle a COPY request natively. """ destType, destHgPath = util.pop_path(dest_path) destHgPath = destHgPath.strip("/") ui = self.provider.ui repo = self.provider.repo _logger.info("handle_copy %s -> %s" % (self...
def handle_copy(self, dest_path, depth_infinity): """Handle a COPY request natively. """ destType, destHgPath = util.pop_path(dest_path) destHgPath = destHgPath.strip("/") ui = self.provider.ui repo = self.provider.repo _logger.info("handle_copy %s -> %s" % (self...
[ "Handle", "a", "COPY", "request", "natively", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/hg_dav_provider.py#L368-L387
[ "def", "handle_copy", "(", "self", ",", "dest_path", ",", "depth_infinity", ")", ":", "destType", ",", "destHgPath", "=", "util", ".", "pop_path", "(", "dest_path", ")", "destHgPath", "=", "destHgPath", ".", "strip", "(", "\"/\"", ")", "ui", "=", "self", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
HgResourceProvider._get_log
Read log entries into a list of dictionaries.
wsgidav/samples/hg_dav_provider.py
def _get_log(self, limit=None): """Read log entries into a list of dictionaries.""" self.ui.pushbuffer() commands.log(self.ui, self.repo, limit=limit, date=None, rev=None, user=None) res = self.ui.popbuffer().strip() logList = [] for logentry in res.split("\n\n"): ...
def _get_log(self, limit=None): """Read log entries into a list of dictionaries.""" self.ui.pushbuffer() commands.log(self.ui, self.repo, limit=limit, date=None, rev=None, user=None) res = self.ui.popbuffer().strip() logList = [] for logentry in res.split("\n\n"): ...
[ "Read", "log", "entries", "into", "a", "list", "of", "dictionaries", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/hg_dav_provider.py#L466-L485
[ "def", "_get_log", "(", "self", ",", "limit", "=", "None", ")", ":", "self", ".", "ui", ".", "pushbuffer", "(", ")", "commands", ".", "log", "(", "self", ".", "ui", ",", "self", ".", "repo", ",", "limit", "=", "limit", ",", "date", "=", "None", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
HgResourceProvider._get_repo_info
Return a dictionary containing all files under source control. dirinfos: Dictionary containing direct members for every collection. {folderpath: (collectionlist, filelist), ...} files: Sorted list of all file paths in the manifest. filedict: Dicti...
wsgidav/samples/hg_dav_provider.py
def _get_repo_info(self, environ, rev, reload=False): """Return a dictionary containing all files under source control. dirinfos: Dictionary containing direct members for every collection. {folderpath: (collectionlist, filelist), ...} files: Sorted list of al...
def _get_repo_info(self, environ, rev, reload=False): """Return a dictionary containing all files under source control. dirinfos: Dictionary containing direct members for every collection. {folderpath: (collectionlist, filelist), ...} files: Sorted list of al...
[ "Return", "a", "dictionary", "containing", "all", "files", "under", "source", "control", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/hg_dav_provider.py#L487-L564
[ "def", "_get_repo_info", "(", "self", ",", "environ", ",", "rev", ",", "reload", "=", "False", ")", ":", "caches", "=", "environ", ".", "setdefault", "(", "\"wsgidav.hg.cache\"", ",", "{", "}", ")", "if", "caches", ".", "get", "(", "compat", ".", "to_n...
cec0d84222fc24bea01be1cea91729001963f172
valid
HgResourceProvider.get_resource_inst
Return HgResource object for path. See DAVProvider.get_resource_inst()
wsgidav/samples/hg_dav_provider.py
def get_resource_inst(self, path, environ): """Return HgResource object for path. See DAVProvider.get_resource_inst() """ self._count_get_resource_inst += 1 # HG expects the resource paths without leading '/' localHgPath = path.strip("/") rev = None cmd,...
def get_resource_inst(self, path, environ): """Return HgResource object for path. See DAVProvider.get_resource_inst() """ self._count_get_resource_inst += 1 # HG expects the resource paths without leading '/' localHgPath = path.strip("/") rev = None cmd,...
[ "Return", "HgResource", "object", "for", "path", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/samples/hg_dav_provider.py#L579-L629
[ "def", "get_resource_inst", "(", "self", ",", "path", ",", "environ", ")", ":", "self", ".", "_count_get_resource_inst", "+=", "1", "# HG expects the resource paths without leading '/'", "localHgPath", "=", "path", ".", "strip", "(", "\"/\"", ")", "rev", "=", "Non...
cec0d84222fc24bea01be1cea91729001963f172
valid
_DAVResource.get_display_info
Return additional info dictionary for displaying (optional). This information is not part of the DAV specification, but meant for use by the dir browser middleware. This default implementation returns ``{'type': '...'}``
wsgidav/dav_provider.py
def get_display_info(self): """Return additional info dictionary for displaying (optional). This information is not part of the DAV specification, but meant for use by the dir browser middleware. This default implementation returns ``{'type': '...'}`` """ if self.is_col...
def get_display_info(self): """Return additional info dictionary for displaying (optional). This information is not part of the DAV specification, but meant for use by the dir browser middleware. This default implementation returns ``{'type': '...'}`` """ if self.is_col...
[ "Return", "additional", "info", "dictionary", "for", "displaying", "(", "optional", ")", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_provider.py#L250-L264
[ "def", "get_display_info", "(", "self", ")", ":", "if", "self", ".", "is_collection", ":", "return", "{", "\"type\"", ":", "\"Directory\"", "}", "elif", "os", ".", "extsep", "in", "self", ".", "name", ":", "ext", "=", "self", ".", "name", ".", "split",...
cec0d84222fc24bea01be1cea91729001963f172
valid
_DAVResource.get_preferred_path
Return preferred mapping for a resource mapping. Different URLs may map to the same resource, e.g.: '/a/b' == '/A/b' == '/a/b/' get_preferred_path() returns the same value for all these variants, e.g.: '/a/b/' (assuming resource names considered case insensitive) @par...
wsgidav/dav_provider.py
def get_preferred_path(self): """Return preferred mapping for a resource mapping. Different URLs may map to the same resource, e.g.: '/a/b' == '/A/b' == '/a/b/' get_preferred_path() returns the same value for all these variants, e.g.: '/a/b/' (assuming resource names c...
def get_preferred_path(self): """Return preferred mapping for a resource mapping. Different URLs may map to the same resource, e.g.: '/a/b' == '/A/b' == '/a/b/' get_preferred_path() returns the same value for all these variants, e.g.: '/a/b/' (assuming resource names c...
[ "Return", "preferred", "mapping", "for", "a", "resource", "mapping", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_provider.py#L323-L344
[ "def", "get_preferred_path", "(", "self", ")", ":", "if", "self", ".", "path", "in", "(", "\"\"", ",", "\"/\"", ")", ":", "return", "\"/\"", "# Append '/' for collections", "if", "self", ".", "is_collection", "and", "not", "self", ".", "path", ".", "endswi...
cec0d84222fc24bea01be1cea91729001963f172
valid
_DAVResource.get_href
Convert path to a URL that can be passed to XML responses. Byte string, UTF-8 encoded, quoted. See http://www.webdav.org/specs/rfc4918.html#rfc.section.8.3 We are using the path-absolute option. i.e. starting with '/'. URI ; See section 3.2.1 of [RFC2068]
wsgidav/dav_provider.py
def get_href(self): """Convert path to a URL that can be passed to XML responses. Byte string, UTF-8 encoded, quoted. See http://www.webdav.org/specs/rfc4918.html#rfc.section.8.3 We are using the path-absolute option. i.e. starting with '/'. URI ; See section 3.2.1 of [RFC2068]...
def get_href(self): """Convert path to a URL that can be passed to XML responses. Byte string, UTF-8 encoded, quoted. See http://www.webdav.org/specs/rfc4918.html#rfc.section.8.3 We are using the path-absolute option. i.e. starting with '/'. URI ; See section 3.2.1 of [RFC2068]...
[ "Convert", "path", "to", "a", "URL", "that", "can", "be", "passed", "to", "XML", "responses", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_provider.py#L380-L397
[ "def", "get_href", "(", "self", ")", ":", "# Nautilus chokes, if href encodes '(' as '%28'", "# So we don't encode 'extra' and 'safe' characters (see rfc2068 3.2.1)", "safe", "=", "\"/\"", "+", "\"!*'(),\"", "+", "\"$-_|.\"", "return", "compat", ".", "quote", "(", "self", "...
cec0d84222fc24bea01be1cea91729001963f172
valid
_DAVResource.get_member_list
Return a list of direct members (_DAVResource or derived objects). This default implementation calls self.get_member_names() and self.get_member() for each of them. A provider COULD overwrite this for performance reasons.
wsgidav/dav_provider.py
def get_member_list(self): """Return a list of direct members (_DAVResource or derived objects). This default implementation calls self.get_member_names() and self.get_member() for each of them. A provider COULD overwrite this for performance reasons. """ if not self.is_...
def get_member_list(self): """Return a list of direct members (_DAVResource or derived objects). This default implementation calls self.get_member_names() and self.get_member() for each of them. A provider COULD overwrite this for performance reasons. """ if not self.is_...
[ "Return", "a", "list", "of", "direct", "members", "(", "_DAVResource", "or", "derived", "objects", ")", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_provider.py#L409-L423
[ "def", "get_member_list", "(", "self", ")", ":", "if", "not", "self", ".", "is_collection", ":", "raise", "NotImplementedError", "memberList", "=", "[", "]", "for", "name", "in", "self", ".", "get_member_names", "(", ")", ":", "member", "=", "self", ".", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
_DAVResource.get_descendants
Return a list _DAVResource objects of a collection (children, grand-children, ...). This default implementation calls self.get_member_list() recursively. This function may also be called for non-collections (with add_self=True). :Parameters: depth_first : bool ...
wsgidav/dav_provider.py
def get_descendants( self, collections=True, resources=True, depth_first=False, depth="infinity", add_self=False, ): """Return a list _DAVResource objects of a collection (children, grand-children, ...). This default implementation calls self....
def get_descendants( self, collections=True, resources=True, depth_first=False, depth="infinity", add_self=False, ): """Return a list _DAVResource objects of a collection (children, grand-children, ...). This default implementation calls self....
[ "Return", "a", "list", "_DAVResource", "objects", "of", "a", "collection", "(", "children", "grand", "-", "children", "...", ")", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_provider.py#L432-L479
[ "def", "get_descendants", "(", "self", ",", "collections", "=", "True", ",", "resources", "=", "True", ",", "depth_first", "=", "False", ",", "depth", "=", "\"infinity\"", ",", "add_self", "=", "False", ",", ")", ":", "assert", "depth", "in", "(", "\"0\"...
cec0d84222fc24bea01be1cea91729001963f172
valid
_DAVResource.get_property_names
Return list of supported property names in Clark Notation. Note that 'allprop', despite its name, which remains for backward-compatibility, does not return every property, but only dead properties and the live properties defined in RFC4918. This default implementation returns a combina...
wsgidav/dav_provider.py
def get_property_names(self, is_allprop): """Return list of supported property names in Clark Notation. Note that 'allprop', despite its name, which remains for backward-compatibility, does not return every property, but only dead properties and the live properties defined in RFC4918. ...
def get_property_names(self, is_allprop): """Return list of supported property names in Clark Notation. Note that 'allprop', despite its name, which remains for backward-compatibility, does not return every property, but only dead properties and the live properties defined in RFC4918. ...
[ "Return", "list", "of", "supported", "property", "names", "in", "Clark", "Notation", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_provider.py#L483-L532
[ "def", "get_property_names", "(", "self", ",", "is_allprop", ")", ":", "# Live properties", "propNameList", "=", "[", "]", "propNameList", ".", "append", "(", "\"{DAV:}resourcetype\"", ")", "if", "self", ".", "get_creation_date", "(", ")", "is", "not", "None", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
_DAVResource.get_properties
Return properties as list of 2-tuples (name, value). If mode is 'name', then None is returned for the value. name the property name in Clark notation. value may have different types, depending on the status: - string or unicode: for standard property values....
wsgidav/dav_provider.py
def get_properties(self, mode, name_list=None): """Return properties as list of 2-tuples (name, value). If mode is 'name', then None is returned for the value. name the property name in Clark notation. value may have different types, depending on the status: ...
def get_properties(self, mode, name_list=None): """Return properties as list of 2-tuples (name, value). If mode is 'name', then None is returned for the value. name the property name in Clark notation. value may have different types, depending on the status: ...
[ "Return", "properties", "as", "list", "of", "2", "-", "tuples", "(", "name", "value", ")", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_provider.py#L534-L580
[ "def", "get_properties", "(", "self", ",", "mode", ",", "name_list", "=", "None", ")", ":", "assert", "mode", "in", "(", "\"allprop\"", ",", "\"name\"", ",", "\"named\"", ")", "if", "mode", "in", "(", "\"allprop\"", ",", "\"name\"", ")", ":", "# TODO: 'a...
cec0d84222fc24bea01be1cea91729001963f172
valid
_DAVResource.get_property_value
Return the value of a property. name: the property name in Clark notation. return value: may have different types, depending on the status: - string or unicode: for standard property values. - lxml.etree.Element: for complex values. If the p...
wsgidav/dav_provider.py
def get_property_value(self, name): """Return the value of a property. name: the property name in Clark notation. return value: may have different types, depending on the status: - string or unicode: for standard property values. - lxml.etree.Ele...
def get_property_value(self, name): """Return the value of a property. name: the property name in Clark notation. return value: may have different types, depending on the status: - string or unicode: for standard property values. - lxml.etree.Ele...
[ "Return", "the", "value", "of", "a", "property", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_provider.py#L582-L716
[ "def", "get_property_value", "(", "self", ",", "name", ")", ":", "refUrl", "=", "self", ".", "get_ref_url", "(", ")", "# lock properties", "lm", "=", "self", ".", "provider", ".", "lock_manager", "if", "lm", "and", "name", "==", "\"{DAV:}lockdiscovery\"", ":...
cec0d84222fc24bea01be1cea91729001963f172
valid
_DAVResource.set_property_value
Set a property value or remove a property. value == None means 'remove property'. Raise HTTP_FORBIDDEN if property is read-only, or not supported. When dry_run is True, this function should raise errors, as in a real run, but MUST NOT change any data. This default implementati...
wsgidav/dav_provider.py
def set_property_value(self, name, value, dry_run=False): """Set a property value or remove a property. value == None means 'remove property'. Raise HTTP_FORBIDDEN if property is read-only, or not supported. When dry_run is True, this function should raise errors, as in a real ...
def set_property_value(self, name, value, dry_run=False): """Set a property value or remove a property. value == None means 'remove property'. Raise HTTP_FORBIDDEN if property is read-only, or not supported. When dry_run is True, this function should raise errors, as in a real ...
[ "Set", "a", "property", "value", "or", "remove", "a", "property", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_provider.py#L718-L807
[ "def", "set_property_value", "(", "self", ",", "name", ",", "value", ",", "dry_run", "=", "False", ")", ":", "assert", "value", "is", "None", "or", "xml_tools", ".", "is_etree_element", "(", "value", ")", "if", "name", "in", "_lockPropertyNames", ":", "# L...
cec0d84222fc24bea01be1cea91729001963f172
valid
_DAVResource.remove_all_properties
Remove all associated dead properties.
wsgidav/dav_provider.py
def remove_all_properties(self, recursive): """Remove all associated dead properties.""" if self.provider.prop_manager: self.provider.prop_manager.remove_properties( self.get_ref_url(), self.environ )
def remove_all_properties(self, recursive): """Remove all associated dead properties.""" if self.provider.prop_manager: self.provider.prop_manager.remove_properties( self.get_ref_url(), self.environ )
[ "Remove", "all", "associated", "dead", "properties", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_provider.py#L809-L814
[ "def", "remove_all_properties", "(", "self", ",", "recursive", ")", ":", "if", "self", ".", "provider", ".", "prop_manager", ":", "self", ".", "provider", ".", "prop_manager", ".", "remove_properties", "(", "self", ".", "get_ref_url", "(", ")", ",", "self", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
_DAVResource.is_locked
Return True, if URI is locked.
wsgidav/dav_provider.py
def is_locked(self): """Return True, if URI is locked.""" if self.provider.lock_manager is None: return False return self.provider.lock_manager.is_url_locked(self.get_ref_url())
def is_locked(self): """Return True, if URI is locked.""" if self.provider.lock_manager is None: return False return self.provider.lock_manager.is_url_locked(self.get_ref_url())
[ "Return", "True", "if", "URI", "is", "locked", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_provider.py#L827-L831
[ "def", "is_locked", "(", "self", ")", ":", "if", "self", ".", "provider", ".", "lock_manager", "is", "None", ":", "return", "False", "return", "self", ".", "provider", ".", "lock_manager", ".", "is_url_locked", "(", "self", ".", "get_ref_url", "(", ")", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
DAVCollection.resolve
Return a _DAVResource object for the path (None, if not found). `path_info`: is a URL relative to this object.
wsgidav/dav_provider.py
def resolve(self, script_name, path_info): """Return a _DAVResource object for the path (None, if not found). `path_info`: is a URL relative to this object. """ if path_info in ("", "/"): return self assert path_info.startswith("/") name, rest = util.pop_path...
def resolve(self, script_name, path_info): """Return a _DAVResource object for the path (None, if not found). `path_info`: is a URL relative to this object. """ if path_info in ("", "/"): return self assert path_info.startswith("/") name, rest = util.pop_path...
[ "Return", "a", "_DAVResource", "object", "for", "the", "path", "(", "None", "if", "not", "found", ")", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_provider.py#L1393-L1405
[ "def", "resolve", "(", "self", ",", "script_name", ",", "path_info", ")", ":", "if", "path_info", "in", "(", "\"\"", ",", "\"/\"", ")", ":", "return", "self", "assert", "path_info", ".", "startswith", "(", "\"/\"", ")", "name", ",", "rest", "=", "util"...
cec0d84222fc24bea01be1cea91729001963f172
valid
DAVProvider.set_share_path
Set application location for this resource provider. @param share_path: a UTF-8 encoded, unquoted byte string.
wsgidav/dav_provider.py
def set_share_path(self, share_path): """Set application location for this resource provider. @param share_path: a UTF-8 encoded, unquoted byte string. """ # if isinstance(share_path, unicode): # share_path = share_path.encode("utf8") assert share_path == "" or share...
def set_share_path(self, share_path): """Set application location for this resource provider. @param share_path: a UTF-8 encoded, unquoted byte string. """ # if isinstance(share_path, unicode): # share_path = share_path.encode("utf8") assert share_path == "" or share...
[ "Set", "application", "location", "for", "this", "resource", "provider", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_provider.py#L1445-L1456
[ "def", "set_share_path", "(", "self", ",", "share_path", ")", ":", "# if isinstance(share_path, unicode):", "# share_path = share_path.encode(\"utf8\")", "assert", "share_path", "==", "\"\"", "or", "share_path", ".", "startswith", "(", "\"/\"", ")", "if", "share_path"...
cec0d84222fc24bea01be1cea91729001963f172
valid
DAVProvider.ref_url_to_path
Convert a refUrl to a path, by stripping the share prefix. Used to calculate the <path> from a storage key by inverting get_ref_url().
wsgidav/dav_provider.py
def ref_url_to_path(self, ref_url): """Convert a refUrl to a path, by stripping the share prefix. Used to calculate the <path> from a storage key by inverting get_ref_url(). """ return "/" + compat.unquote(util.lstripstr(ref_url, self.share_path)).lstrip( "/" )
def ref_url_to_path(self, ref_url): """Convert a refUrl to a path, by stripping the share prefix. Used to calculate the <path> from a storage key by inverting get_ref_url(). """ return "/" + compat.unquote(util.lstripstr(ref_url, self.share_path)).lstrip( "/" )
[ "Convert", "a", "refUrl", "to", "a", "path", "by", "stripping", "the", "share", "prefix", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_provider.py#L1470-L1477
[ "def", "ref_url_to_path", "(", "self", ",", "ref_url", ")", ":", "return", "\"/\"", "+", "compat", ".", "unquote", "(", "util", ".", "lstripstr", "(", "ref_url", ",", "self", ".", "share_path", ")", ")", ".", "lstrip", "(", "\"/\"", ")" ]
cec0d84222fc24bea01be1cea91729001963f172
valid
DAVProvider.is_collection
Return True, if path maps to an existing collection resource. This method should only be used, if no other information is queried for <path>. Otherwise a _DAVResource should be created first.
wsgidav/dav_provider.py
def is_collection(self, path, environ): """Return True, if path maps to an existing collection resource. This method should only be used, if no other information is queried for <path>. Otherwise a _DAVResource should be created first. """ res = self.get_resource_inst(path, envir...
def is_collection(self, path, environ): """Return True, if path maps to an existing collection resource. This method should only be used, if no other information is queried for <path>. Otherwise a _DAVResource should be created first. """ res = self.get_resource_inst(path, envir...
[ "Return", "True", "if", "path", "maps", "to", "an", "existing", "collection", "resource", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dav_provider.py#L1507-L1514
[ "def", "is_collection", "(", "self", ",", "path", ",", "environ", ")", ":", "res", "=", "self", ".", "get_resource_inst", "(", "path", ",", "environ", ")", "return", "res", "and", "res", ".", "is_collection" ]
cec0d84222fc24bea01be1cea91729001963f172
valid
string_to_xml
Convert XML string into etree.Element.
wsgidav/xml_tools.py
def string_to_xml(text): """Convert XML string into etree.Element.""" try: return etree.XML(text) except Exception: # TODO: # ExpatError: reference to invalid character number: line 1, column 62 # litmus fails, when xml is used instead of lxml # 18. propget..............
def string_to_xml(text): """Convert XML string into etree.Element.""" try: return etree.XML(text) except Exception: # TODO: # ExpatError: reference to invalid character number: line 1, column 62 # litmus fails, when xml is used instead of lxml # 18. propget..............
[ "Convert", "XML", "string", "into", "etree", ".", "Element", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/xml_tools.py#L54-L74
[ "def", "string_to_xml", "(", "text", ")", ":", "try", ":", "return", "etree", ".", "XML", "(", "text", ")", "except", "Exception", ":", "# TODO:", "# ExpatError: reference to invalid character number: line 1, column 62", "# litmus fails, when xml is used instead of lxml", "...
cec0d84222fc24bea01be1cea91729001963f172
valid
xml_to_bytes
Wrapper for etree.tostring, that takes care of unsupported pretty_print option and prepends an encoding header.
wsgidav/xml_tools.py
def xml_to_bytes(element, pretty_print=False): """Wrapper for etree.tostring, that takes care of unsupported pretty_print option and prepends an encoding header.""" if use_lxml: xml = etree.tostring( element, encoding="UTF-8", xml_declaration=True, pretty_print=pretty_print ) ...
def xml_to_bytes(element, pretty_print=False): """Wrapper for etree.tostring, that takes care of unsupported pretty_print option and prepends an encoding header.""" if use_lxml: xml = etree.tostring( element, encoding="UTF-8", xml_declaration=True, pretty_print=pretty_print ) ...
[ "Wrapper", "for", "etree", ".", "tostring", "that", "takes", "care", "of", "unsupported", "pretty_print", "option", "and", "prepends", "an", "encoding", "header", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/xml_tools.py#L77-L90
[ "def", "xml_to_bytes", "(", "element", ",", "pretty_print", "=", "False", ")", ":", "if", "use_lxml", ":", "xml", "=", "etree", ".", "tostring", "(", "element", ",", "encoding", "=", "\"UTF-8\"", ",", "xml_declaration", "=", "True", ",", "pretty_print", "=...
cec0d84222fc24bea01be1cea91729001963f172
valid
make_sub_element
Wrapper for etree.SubElement, that takes care of unsupported nsmap option.
wsgidav/xml_tools.py
def make_sub_element(parent, tag, nsmap=None): """Wrapper for etree.SubElement, that takes care of unsupported nsmap option.""" if use_lxml: return etree.SubElement(parent, tag, nsmap=nsmap) return etree.SubElement(parent, tag)
def make_sub_element(parent, tag, nsmap=None): """Wrapper for etree.SubElement, that takes care of unsupported nsmap option.""" if use_lxml: return etree.SubElement(parent, tag, nsmap=nsmap) return etree.SubElement(parent, tag)
[ "Wrapper", "for", "etree", ".", "SubElement", "that", "takes", "care", "of", "unsupported", "nsmap", "option", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/xml_tools.py#L107-L111
[ "def", "make_sub_element", "(", "parent", ",", "tag", ",", "nsmap", "=", "None", ")", ":", "if", "use_lxml", ":", "return", "etree", ".", "SubElement", "(", "parent", ",", "tag", ",", "nsmap", "=", "nsmap", ")", "return", "etree", ".", "SubElement", "(...
cec0d84222fc24bea01be1cea91729001963f172
valid
element_content_as_string
Serialize etree.Element. Note: element may contain more than one child or only text (i.e. no child at all). Therefore the resulting string may raise an exception, when passed back to etree.XML().
wsgidav/xml_tools.py
def element_content_as_string(element): """Serialize etree.Element. Note: element may contain more than one child or only text (i.e. no child at all). Therefore the resulting string may raise an exception, when passed back to etree.XML(). """ if len(element) == 0: return ele...
def element_content_as_string(element): """Serialize etree.Element. Note: element may contain more than one child or only text (i.e. no child at all). Therefore the resulting string may raise an exception, when passed back to etree.XML(). """ if len(element) == 0: return ele...
[ "Serialize", "etree", ".", "Element", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/xml_tools.py#L114-L129
[ "def", "element_content_as_string", "(", "element", ")", ":", "if", "len", "(", "element", ")", "==", "0", ":", "return", "element", ".", "text", "or", "\"\"", "# Make sure, None is returned as ''", "stream", "=", "compat", ".", "StringIO", "(", ")", "for", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
_get_checked_path
Convert path to absolute if not None.
wsgidav/server/server_cli.py
def _get_checked_path(path, config, must_exist=True, allow_none=True): """Convert path to absolute if not None.""" if path in (None, ""): if allow_none: return None raise ValueError("Invalid path {!r}".format(path)) # Evaluate path relative to the folder of the config file (if an...
def _get_checked_path(path, config, must_exist=True, allow_none=True): """Convert path to absolute if not None.""" if path in (None, ""): if allow_none: return None raise ValueError("Invalid path {!r}".format(path)) # Evaluate path relative to the folder of the config file (if an...
[ "Convert", "path", "to", "absolute", "if", "not", "None", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/server/server_cli.py#L65-L79
[ "def", "_get_checked_path", "(", "path", ",", "config", ",", "must_exist", "=", "True", ",", "allow_none", "=", "True", ")", ":", "if", "path", "in", "(", "None", ",", "\"\"", ")", ":", "if", "allow_none", ":", "return", "None", "raise", "ValueError", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
_init_command_line_options
Parse command line options into a dictionary.
wsgidav/server/server_cli.py
def _init_command_line_options(): """Parse command line options into a dictionary.""" description = """\ Run a WEBDAV server to share file system folders. Examples: Share filesystem folder '/temp' for anonymous access (no config file used): wsgidav --port=80 --host=0.0.0.0 --root=/temp --auth=anonymou...
def _init_command_line_options(): """Parse command line options into a dictionary.""" description = """\ Run a WEBDAV server to share file system folders. Examples: Share filesystem folder '/temp' for anonymous access (no config file used): wsgidav --port=80 --host=0.0.0.0 --root=/temp --auth=anonymou...
[ "Parse", "command", "line", "options", "into", "a", "dictionary", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/server/server_cli.py#L90-L255
[ "def", "_init_command_line_options", "(", ")", ":", "description", "=", "\"\"\"\\\n\nRun a WEBDAV server to share file system folders.\n\nExamples:\n\n Share filesystem folder '/temp' for anonymous access (no config file used):\n wsgidav --port=80 --host=0.0.0.0 --root=/temp --auth=anonymous\n\n ...
cec0d84222fc24bea01be1cea91729001963f172
valid
_read_config_file
Read configuration file options into a dictionary.
wsgidav/server/server_cli.py
def _read_config_file(config_file, verbose): """Read configuration file options into a dictionary.""" config_file = os.path.abspath(config_file) if not os.path.exists(config_file): raise RuntimeError("Couldn't open configuration file '{}'.".format(config_file)) if config_file.endswith(".json"...
def _read_config_file(config_file, verbose): """Read configuration file options into a dictionary.""" config_file = os.path.abspath(config_file) if not os.path.exists(config_file): raise RuntimeError("Couldn't open configuration file '{}'.".format(config_file)) if config_file.endswith(".json"...
[ "Read", "configuration", "file", "options", "into", "a", "dictionary", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/server/server_cli.py#L258-L303
[ "def", "_read_config_file", "(", "config_file", ",", "verbose", ")", ":", "config_file", "=", "os", ".", "path", ".", "abspath", "(", "config_file", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "config_file", ")", ":", "raise", "RuntimeError", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
_init_config
Setup configuration dictionary from default, command line and configuration file.
wsgidav/server/server_cli.py
def _init_config(): """Setup configuration dictionary from default, command line and configuration file.""" cli_opts, parser = _init_command_line_options() cli_verbose = cli_opts["verbose"] # Set config defaults config = copy.deepcopy(DEFAULT_CONFIG) # Configuration file overrides defaults ...
def _init_config(): """Setup configuration dictionary from default, command line and configuration file.""" cli_opts, parser = _init_command_line_options() cli_verbose = cli_opts["verbose"] # Set config defaults config = copy.deepcopy(DEFAULT_CONFIG) # Configuration file overrides defaults ...
[ "Setup", "configuration", "dictionary", "from", "default", "command", "line", "and", "configuration", "file", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/server/server_cli.py#L306-L422
[ "def", "_init_config", "(", ")", ":", "cli_opts", ",", "parser", "=", "_init_command_line_options", "(", ")", "cli_verbose", "=", "cli_opts", "[", "\"verbose\"", "]", "# Set config defaults", "config", "=", "copy", ".", "deepcopy", "(", "DEFAULT_CONFIG", ")", "#...
cec0d84222fc24bea01be1cea91729001963f172
valid
_run_paste
Run WsgiDAV using paste.httpserver, if Paste is installed. See http://pythonpaste.org/modules/httpserver.html for more options
wsgidav/server/server_cli.py
def _run_paste(app, config, mode): """Run WsgiDAV using paste.httpserver, if Paste is installed. See http://pythonpaste.org/modules/httpserver.html for more options """ from paste import httpserver version = "WsgiDAV/{} {} Python {}".format( __version__, httpserver.WSGIHandler.server_versi...
def _run_paste(app, config, mode): """Run WsgiDAV using paste.httpserver, if Paste is installed. See http://pythonpaste.org/modules/httpserver.html for more options """ from paste import httpserver version = "WsgiDAV/{} {} Python {}".format( __version__, httpserver.WSGIHandler.server_versi...
[ "Run", "WsgiDAV", "using", "paste", ".", "httpserver", "if", "Paste", "is", "installed", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/server/server_cli.py#L425-L480
[ "def", "_run_paste", "(", "app", ",", "config", ",", "mode", ")", ":", "from", "paste", "import", "httpserver", "version", "=", "\"WsgiDAV/{} {} Python {}\"", ".", "format", "(", "__version__", ",", "httpserver", ".", "WSGIHandler", ".", "server_version", ",", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
_run_gevent
Run WsgiDAV using gevent if gevent is installed. See https://github.com/gevent/gevent/blob/master/src/gevent/pywsgi.py#L1356 https://github.com/gevent/gevent/blob/master/src/gevent/server.py#L38 for more options
wsgidav/server/server_cli.py
def _run_gevent(app, config, mode): """Run WsgiDAV using gevent if gevent is installed. See https://github.com/gevent/gevent/blob/master/src/gevent/pywsgi.py#L1356 https://github.com/gevent/gevent/blob/master/src/gevent/server.py#L38 for more options """ import gevent import gevent...
def _run_gevent(app, config, mode): """Run WsgiDAV using gevent if gevent is installed. See https://github.com/gevent/gevent/blob/master/src/gevent/pywsgi.py#L1356 https://github.com/gevent/gevent/blob/master/src/gevent/server.py#L38 for more options """ import gevent import gevent...
[ "Run", "WsgiDAV", "using", "gevent", "if", "gevent", "is", "installed", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/server/server_cli.py#L483-L517
[ "def", "_run_gevent", "(", "app", ",", "config", ",", "mode", ")", ":", "import", "gevent", "import", "gevent", ".", "monkey", "gevent", ".", "monkey", ".", "patch_all", "(", ")", "from", "gevent", ".", "pywsgi", "import", "WSGIServer", "server_args", "=",...
cec0d84222fc24bea01be1cea91729001963f172
valid
_run__cherrypy
Run WsgiDAV using cherrypy.wsgiserver if CherryPy is installed.
wsgidav/server/server_cli.py
def _run__cherrypy(app, config, mode): """Run WsgiDAV using cherrypy.wsgiserver if CherryPy is installed.""" assert mode == "cherrypy-wsgiserver" try: from cherrypy import wsgiserver from cherrypy.wsgiserver.ssl_builtin import BuiltinSSLAdapter _logger.warning("WARNING: cherrypy.ws...
def _run__cherrypy(app, config, mode): """Run WsgiDAV using cherrypy.wsgiserver if CherryPy is installed.""" assert mode == "cherrypy-wsgiserver" try: from cherrypy import wsgiserver from cherrypy.wsgiserver.ssl_builtin import BuiltinSSLAdapter _logger.warning("WARNING: cherrypy.ws...
[ "Run", "WsgiDAV", "using", "cherrypy", ".", "wsgiserver", "if", "CherryPy", "is", "installed", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/server/server_cli.py#L520-L603
[ "def", "_run__cherrypy", "(", "app", ",", "config", ",", "mode", ")", ":", "assert", "mode", "==", "\"cherrypy-wsgiserver\"", "try", ":", "from", "cherrypy", "import", "wsgiserver", "from", "cherrypy", ".", "wsgiserver", ".", "ssl_builtin", "import", "BuiltinSSL...
cec0d84222fc24bea01be1cea91729001963f172
valid
_run_cheroot
Run WsgiDAV using cheroot.server if Cheroot is installed.
wsgidav/server/server_cli.py
def _run_cheroot(app, config, mode): """Run WsgiDAV using cheroot.server if Cheroot is installed.""" assert mode == "cheroot" try: from cheroot import server, wsgi # from cheroot.ssl.builtin import BuiltinSSLAdapter # import cheroot.ssl.pyopenssl except ImportError: ...
def _run_cheroot(app, config, mode): """Run WsgiDAV using cheroot.server if Cheroot is installed.""" assert mode == "cheroot" try: from cheroot import server, wsgi # from cheroot.ssl.builtin import BuiltinSSLAdapter # import cheroot.ssl.pyopenssl except ImportError: ...
[ "Run", "WsgiDAV", "using", "cheroot", ".", "server", "if", "Cheroot", "is", "installed", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/server/server_cli.py#L606-L685
[ "def", "_run_cheroot", "(", "app", ",", "config", ",", "mode", ")", ":", "assert", "mode", "==", "\"cheroot\"", "try", ":", "from", "cheroot", "import", "server", ",", "wsgi", "# from cheroot.ssl.builtin import BuiltinSSLAdapter", "# import cheroot.ssl.p...
cec0d84222fc24bea01be1cea91729001963f172
valid
_run_flup
Run WsgiDAV using flup.server.fcgi if Flup is installed.
wsgidav/server/server_cli.py
def _run_flup(app, config, mode): """Run WsgiDAV using flup.server.fcgi if Flup is installed.""" # http://trac.saddi.com/flup/wiki/FlupServers if mode == "flup-fcgi": from flup.server.fcgi import WSGIServer, __version__ as flupver elif mode == "flup-fcgi-fork": from flup.server.fcgi_fork...
def _run_flup(app, config, mode): """Run WsgiDAV using flup.server.fcgi if Flup is installed.""" # http://trac.saddi.com/flup/wiki/FlupServers if mode == "flup-fcgi": from flup.server.fcgi import WSGIServer, __version__ as flupver elif mode == "flup-fcgi-fork": from flup.server.fcgi_fork...
[ "Run", "WsgiDAV", "using", "flup", ".", "server", ".", "fcgi", "if", "Flup", "is", "installed", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/server/server_cli.py#L688-L712
[ "def", "_run_flup", "(", "app", ",", "config", ",", "mode", ")", ":", "# http://trac.saddi.com/flup/wiki/FlupServers", "if", "mode", "==", "\"flup-fcgi\"", ":", "from", "flup", ".", "server", ".", "fcgi", "import", "WSGIServer", ",", "__version__", "as", "flupve...
cec0d84222fc24bea01be1cea91729001963f172
valid
_run_wsgiref
Run WsgiDAV using wsgiref.simple_server, on Python 2.5+.
wsgidav/server/server_cli.py
def _run_wsgiref(app, config, mode): """Run WsgiDAV using wsgiref.simple_server, on Python 2.5+.""" # http://www.python.org/doc/2.5.2/lib/module-wsgiref.html from wsgiref.simple_server import make_server, software_version version = "WsgiDAV/{} {}".format(__version__, software_version) _logger.info(...
def _run_wsgiref(app, config, mode): """Run WsgiDAV using wsgiref.simple_server, on Python 2.5+.""" # http://www.python.org/doc/2.5.2/lib/module-wsgiref.html from wsgiref.simple_server import make_server, software_version version = "WsgiDAV/{} {}".format(__version__, software_version) _logger.info(...
[ "Run", "WsgiDAV", "using", "wsgiref", ".", "simple_server", "on", "Python", "2", ".", "5", "+", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/server/server_cli.py#L715-L730
[ "def", "_run_wsgiref", "(", "app", ",", "config", ",", "mode", ")", ":", "# http://www.python.org/doc/2.5.2/lib/module-wsgiref.html", "from", "wsgiref", ".", "simple_server", "import", "make_server", ",", "software_version", "version", "=", "\"WsgiDAV/{} {}\"", ".", "fo...
cec0d84222fc24bea01be1cea91729001963f172
valid
_run_ext_wsgiutils
Run WsgiDAV using ext_wsgiutils_server from the wsgidav package.
wsgidav/server/server_cli.py
def _run_ext_wsgiutils(app, config, mode): """Run WsgiDAV using ext_wsgiutils_server from the wsgidav package.""" from wsgidav.server import ext_wsgiutils_server _logger.info( "Running WsgiDAV {} on wsgidav.ext_wsgiutils_server...".format(__version__) ) _logger.warning( "WARNING: Th...
def _run_ext_wsgiutils(app, config, mode): """Run WsgiDAV using ext_wsgiutils_server from the wsgidav package.""" from wsgidav.server import ext_wsgiutils_server _logger.info( "Running WsgiDAV {} on wsgidav.ext_wsgiutils_server...".format(__version__) ) _logger.warning( "WARNING: Th...
[ "Run", "WsgiDAV", "using", "ext_wsgiutils_server", "from", "the", "wsgidav", "package", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/server/server_cli.py#L733-L747
[ "def", "_run_ext_wsgiutils", "(", "app", ",", "config", ",", "mode", ")", ":", "from", "wsgidav", ".", "server", "import", "ext_wsgiutils_server", "_logger", ".", "info", "(", "\"Running WsgiDAV {} on wsgidav.ext_wsgiutils_server...\"", ".", "format", "(", "__version_...
cec0d84222fc24bea01be1cea91729001963f172
valid
RequestServer._fail
Wrapper to raise (and log) DAVError.
wsgidav/request_server.py
def _fail(self, value, context_info=None, src_exception=None, err_condition=None): """Wrapper to raise (and log) DAVError.""" util.fail(value, context_info, src_exception, err_condition)
def _fail(self, value, context_info=None, src_exception=None, err_condition=None): """Wrapper to raise (and log) DAVError.""" util.fail(value, context_info, src_exception, err_condition)
[ "Wrapper", "to", "raise", "(", "and", "log", ")", "DAVError", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/request_server.py#L148-L150
[ "def", "_fail", "(", "self", ",", "value", ",", "context_info", "=", "None", ",", "src_exception", "=", "None", ",", "err_condition", "=", "None", ")", ":", "util", ".", "fail", "(", "value", ",", "context_info", ",", "src_exception", ",", "err_condition",...
cec0d84222fc24bea01be1cea91729001963f172
valid
RequestServer._send_response
Send WSGI response (single or multistatus). - If error_list is None or [], then <success_code> is send as response. - If error_list contains a single error with a URL that matches root_res, then this error is returned. - If error_list contains more than one error, then '207 Multi-Stat...
wsgidav/request_server.py
def _send_response( self, environ, start_response, root_res, success_code, error_list ): """Send WSGI response (single or multistatus). - If error_list is None or [], then <success_code> is send as response. - If error_list contains a single error with a URL that matches root_res, ...
def _send_response( self, environ, start_response, root_res, success_code, error_list ): """Send WSGI response (single or multistatus). - If error_list is None or [], then <success_code> is send as response. - If error_list contains a single error with a URL that matches root_res, ...
[ "Send", "WSGI", "response", "(", "single", "or", "multistatus", ")", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/request_server.py#L152-L184
[ "def", "_send_response", "(", "self", ",", "environ", ",", "start_response", ",", "root_res", ",", "success_code", ",", "error_list", ")", ":", "assert", "success_code", "in", "(", "HTTP_CREATED", ",", "HTTP_NO_CONTENT", ",", "HTTP_OK", ")", "if", "not", "erro...
cec0d84222fc24bea01be1cea91729001963f172
valid
RequestServer._check_write_permission
Raise DAVError(HTTP_LOCKED), if res is locked. If depth=='infinity', we also raise when child resources are locked.
wsgidav/request_server.py
def _check_write_permission(self, res, depth, environ): """Raise DAVError(HTTP_LOCKED), if res is locked. If depth=='infinity', we also raise when child resources are locked. """ lockMan = self._davProvider.lock_manager if lockMan is None or res is None: return True ...
def _check_write_permission(self, res, depth, environ): """Raise DAVError(HTTP_LOCKED), if res is locked. If depth=='infinity', we also raise when child resources are locked. """ lockMan = self._davProvider.lock_manager if lockMan is None or res is None: return True ...
[ "Raise", "DAVError", "(", "HTTP_LOCKED", ")", "if", "res", "is", "locked", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/request_server.py#L186-L206
[ "def", "_check_write_permission", "(", "self", ",", "res", ",", "depth", ",", "environ", ")", ":", "lockMan", "=", "self", ".", "_davProvider", ".", "lock_manager", "if", "lockMan", "is", "None", "or", "res", "is", "None", ":", "return", "True", "refUrl", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
RequestServer._evaluate_if_headers
Apply HTTP headers on <path>, raising DAVError if conditions fail. Add environ['wsgidav.conditions.if'] and environ['wsgidav.ifLockTokenList']. Handle these headers: - If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since: Raising HTTP_PRECONDITION_FAILED or HTTP_NOT_MO...
wsgidav/request_server.py
def _evaluate_if_headers(self, res, environ): """Apply HTTP headers on <path>, raising DAVError if conditions fail. Add environ['wsgidav.conditions.if'] and environ['wsgidav.ifLockTokenList']. Handle these headers: - If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since: ...
def _evaluate_if_headers(self, res, environ): """Apply HTTP headers on <path>, raising DAVError if conditions fail. Add environ['wsgidav.conditions.if'] and environ['wsgidav.ifLockTokenList']. Handle these headers: - If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since: ...
[ "Apply", "HTTP", "headers", "on", "<path", ">", "raising", "DAVError", "if", "conditions", "fail", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/request_server.py#L208-L270
[ "def", "_evaluate_if_headers", "(", "self", ",", "res", ",", "environ", ")", ":", "# Add parsed If header to environ", "if", "\"wsgidav.conditions.if\"", "not", "in", "environ", ":", "util", ".", "parse_if_header_dict", "(", "environ", ")", "# Bail out, if res does not ...
cec0d84222fc24bea01be1cea91729001963f172
valid
RequestServer.do_PROPFIND
TODO: does not yet support If and If HTTP Conditions @see http://www.webdav.org/specs/rfc4918.html#METHOD_PROPFIND
wsgidav/request_server.py
def do_PROPFIND(self, environ, start_response): """ TODO: does not yet support If and If HTTP Conditions @see http://www.webdav.org/specs/rfc4918.html#METHOD_PROPFIND """ path = environ["PATH_INFO"] res = self._davProvider.get_resource_inst(path, environ) # RFC: ...
def do_PROPFIND(self, environ, start_response): """ TODO: does not yet support If and If HTTP Conditions @see http://www.webdav.org/specs/rfc4918.html#METHOD_PROPFIND """ path = environ["PATH_INFO"] res = self._davProvider.get_resource_inst(path, environ) # RFC: ...
[ "TODO", ":", "does", "not", "yet", "support", "If", "and", "If", "HTTP", "Conditions" ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/request_server.py#L272-L369
[ "def", "do_PROPFIND", "(", "self", ",", "environ", ",", "start_response", ")", ":", "path", "=", "environ", "[", "\"PATH_INFO\"", "]", "res", "=", "self", ".", "_davProvider", ".", "get_resource_inst", "(", "path", ",", "environ", ")", "# RFC: By default, the ...
cec0d84222fc24bea01be1cea91729001963f172
valid
RequestServer.do_PROPPATCH
Handle PROPPATCH request to set or remove a property. @see http://www.webdav.org/specs/rfc4918.html#METHOD_PROPPATCH
wsgidav/request_server.py
def do_PROPPATCH(self, environ, start_response): """Handle PROPPATCH request to set or remove a property. @see http://www.webdav.org/specs/rfc4918.html#METHOD_PROPPATCH """ path = environ["PATH_INFO"] res = self._davProvider.get_resource_inst(path, environ) # Only accep...
def do_PROPPATCH(self, environ, start_response): """Handle PROPPATCH request to set or remove a property. @see http://www.webdav.org/specs/rfc4918.html#METHOD_PROPPATCH """ path = environ["PATH_INFO"] res = self._davProvider.get_resource_inst(path, environ) # Only accep...
[ "Handle", "PROPPATCH", "request", "to", "set", "or", "remove", "a", "property", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/request_server.py#L371-L484
[ "def", "do_PROPPATCH", "(", "self", ",", "environ", ",", "start_response", ")", ":", "path", "=", "environ", "[", "\"PATH_INFO\"", "]", "res", "=", "self", ".", "_davProvider", ".", "get_resource_inst", "(", "path", ",", "environ", ")", "# Only accept Depth: 0...
cec0d84222fc24bea01be1cea91729001963f172
valid
RequestServer.do_MKCOL
Handle MKCOL request to create a new collection. @see http://www.webdav.org/specs/rfc4918.html#METHOD_MKCOL
wsgidav/request_server.py
def do_MKCOL(self, environ, start_response): """Handle MKCOL request to create a new collection. @see http://www.webdav.org/specs/rfc4918.html#METHOD_MKCOL """ path = environ["PATH_INFO"] provider = self._davProvider # res = provider.get_resource_inst(path, enviro...
def do_MKCOL(self, environ, start_response): """Handle MKCOL request to create a new collection. @see http://www.webdav.org/specs/rfc4918.html#METHOD_MKCOL """ path = environ["PATH_INFO"] provider = self._davProvider # res = provider.get_resource_inst(path, enviro...
[ "Handle", "MKCOL", "request", "to", "create", "a", "new", "collection", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/request_server.py#L486-L523
[ "def", "do_MKCOL", "(", "self", ",", "environ", ",", "start_response", ")", ":", "path", "=", "environ", "[", "\"PATH_INFO\"", "]", "provider", "=", "self", ".", "_davProvider", "# res = provider.get_resource_inst(path, environ)", "# Do not understand ANY request b...
cec0d84222fc24bea01be1cea91729001963f172
valid
RequestServer._stream_data_chunked
Get the data from a chunked transfer.
wsgidav/request_server.py
def _stream_data_chunked(self, environ, block_size): """Get the data from a chunked transfer.""" # Chunked Transfer Coding # http://www.servlets.com/rfcs/rfc2616-sec3.html#sec3.6.1 if "Darwin" in environ.get("HTTP_USER_AGENT", "") and environ.get( "HTTP_X_EXPECTED_ENTITY_LEN...
def _stream_data_chunked(self, environ, block_size): """Get the data from a chunked transfer.""" # Chunked Transfer Coding # http://www.servlets.com/rfcs/rfc2616-sec3.html#sec3.6.1 if "Darwin" in environ.get("HTTP_USER_AGENT", "") and environ.get( "HTTP_X_EXPECTED_ENTITY_LEN...
[ "Get", "the", "data", "from", "a", "chunked", "transfer", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/request_server.py#L658-L699
[ "def", "_stream_data_chunked", "(", "self", ",", "environ", ",", "block_size", ")", ":", "# Chunked Transfer Coding", "# http://www.servlets.com/rfcs/rfc2616-sec3.html#sec3.6.1", "if", "\"Darwin\"", "in", "environ", ".", "get", "(", "\"HTTP_USER_AGENT\"", ",", "\"\"", ")"...
cec0d84222fc24bea01be1cea91729001963f172
valid
RequestServer._stream_data
Get the data from a non-chunked transfer.
wsgidav/request_server.py
def _stream_data(self, environ, content_length, block_size): """Get the data from a non-chunked transfer.""" if content_length == 0: # TODO: review this # XP and Vista MiniRedir submit PUT with Content-Length 0, # before LOCK and the real PUT. So we have to accept thi...
def _stream_data(self, environ, content_length, block_size): """Get the data from a non-chunked transfer.""" if content_length == 0: # TODO: review this # XP and Vista MiniRedir submit PUT with Content-Length 0, # before LOCK and the real PUT. So we have to accept thi...
[ "Get", "the", "data", "from", "a", "non", "-", "chunked", "transfer", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/request_server.py#L701-L743
[ "def", "_stream_data", "(", "self", ",", "environ", ",", "content_length", ",", "block_size", ")", ":", "if", "content_length", "==", "0", ":", "# TODO: review this", "# XP and Vista MiniRedir submit PUT with Content-Length 0,", "# before LOCK and the real PUT. So we have to ac...
cec0d84222fc24bea01be1cea91729001963f172
valid
RequestServer._send_resource
If-Range If the entity is unchanged, send me the part(s) that I am missing; otherwise, send me the entire new entity If-Range: "737060cd8c284d8af7ad3082f209582d" @see: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.27
wsgidav/request_server.py
def _send_resource(self, environ, start_response, is_head_method): """ If-Range If the entity is unchanged, send me the part(s) that I am missing; otherwise, send me the entire new entity If-Range: "737060cd8c284d8af7ad3082f209582d" @see: http://www.w3.org/Pr...
def _send_resource(self, environ, start_response, is_head_method): """ If-Range If the entity is unchanged, send me the part(s) that I am missing; otherwise, send me the entire new entity If-Range: "737060cd8c284d8af7ad3082f209582d" @see: http://www.w3.org/Pr...
[ "If", "-", "Range", "If", "the", "entity", "is", "unchanged", "send", "me", "the", "part", "(", "s", ")", "that", "I", "am", "missing", ";", "otherwise", "send", "me", "the", "entire", "new", "entity", "If", "-", "Range", ":", "737060cd8c284d8af7ad3082f2...
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/request_server.py#L1493-L1635
[ "def", "_send_resource", "(", "self", ",", "environ", ",", "start_response", ",", "is_head_method", ")", ":", "path", "=", "environ", "[", "\"PATH_INFO\"", "]", "res", "=", "self", ".", "_davProvider", ".", "get_resource_inst", "(", "path", ",", "environ", "...
cec0d84222fc24bea01be1cea91729001963f172
valid
CouchPropertyManager._find
Return properties document for path.
wsgidav/prop_man/couch_property_manager.py
def _find(self, url): """Return properties document for path.""" # Query the permanent view to find a url vr = self.db.view("properties/by_url", key=url, include_docs=True) _logger.debug("find(%r) returned %s" % (url, len(vr))) assert len(vr) <= 1, "Found multiple matches for %r"...
def _find(self, url): """Return properties document for path.""" # Query the permanent view to find a url vr = self.db.view("properties/by_url", key=url, include_docs=True) _logger.debug("find(%r) returned %s" % (url, len(vr))) assert len(vr) <= 1, "Found multiple matches for %r"...
[ "Return", "properties", "document", "for", "path", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/prop_man/couch_property_manager.py#L115-L124
[ "def", "_find", "(", "self", ",", "url", ")", ":", "# Query the permanent view to find a url", "vr", "=", "self", ".", "db", ".", "view", "(", "\"properties/by_url\"", ",", "key", "=", "url", ",", "include_docs", "=", "True", ")", "_logger", ".", "debug", ...
cec0d84222fc24bea01be1cea91729001963f172
valid
CouchPropertyManager._find_descendents
Return properties document for url and all children.
wsgidav/prop_man/couch_property_manager.py
def _find_descendents(self, url): """Return properties document for url and all children.""" # Ad-hoc query for URL starting with a prefix map_fun = """function(doc) { var url = doc.url + "/"; if(doc.type === 'properties' && url.indexOf('%s') === 0) { ...
def _find_descendents(self, url): """Return properties document for url and all children.""" # Ad-hoc query for URL starting with a prefix map_fun = """function(doc) { var url = doc.url + "/"; if(doc.type === 'properties' && url.indexOf('%s') === 0) { ...
[ "Return", "properties", "document", "for", "url", "and", "all", "children", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/prop_man/couch_property_manager.py#L126-L140
[ "def", "_find_descendents", "(", "self", ",", "url", ")", ":", "# Ad-hoc query for URL starting with a prefix", "map_fun", "=", "\"\"\"function(doc) {\n var url = doc.url + \"/\";\n if(doc.type === 'properties' && url.indexOf('%s') === 0) {\n em...
cec0d84222fc24bea01be1cea91729001963f172
valid
SimpleDomainController._get_realm_entry
Return the matching user_map entry (falling back to default '*' if any).
wsgidav/dc/simple_dc.py
def _get_realm_entry(self, realm, user_name=None): """Return the matching user_map entry (falling back to default '*' if any).""" realm_entry = self.user_map.get(realm) if realm_entry is None: realm_entry = self.user_map.get("*") if user_name is None or realm_entry is None: ...
def _get_realm_entry(self, realm, user_name=None): """Return the matching user_map entry (falling back to default '*' if any).""" realm_entry = self.user_map.get(realm) if realm_entry is None: realm_entry = self.user_map.get("*") if user_name is None or realm_entry is None: ...
[ "Return", "the", "matching", "user_map", "entry", "(", "falling", "back", "to", "default", "*", "if", "any", ")", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dc/simple_dc.py#L95-L102
[ "def", "_get_realm_entry", "(", "self", ",", "realm", ",", "user_name", "=", "None", ")", ":", "realm_entry", "=", "self", ".", "user_map", ".", "get", "(", "realm", ")", "if", "realm_entry", "is", "None", ":", "realm_entry", "=", "self", ".", "user_map"...
cec0d84222fc24bea01be1cea91729001963f172
valid
SimpleDomainController.get_domain_realm
Resolve a relative url to the appropriate realm name.
wsgidav/dc/simple_dc.py
def get_domain_realm(self, path_info, environ): """Resolve a relative url to the appropriate realm name.""" realm = self._calc_realm_from_path_provider(path_info, environ) return realm
def get_domain_realm(self, path_info, environ): """Resolve a relative url to the appropriate realm name.""" realm = self._calc_realm_from_path_provider(path_info, environ) return realm
[ "Resolve", "a", "relative", "url", "to", "the", "appropriate", "realm", "name", "." ]
mar10/wsgidav
python
https://github.com/mar10/wsgidav/blob/cec0d84222fc24bea01be1cea91729001963f172/wsgidav/dc/simple_dc.py#L104-L107
[ "def", "get_domain_realm", "(", "self", ",", "path_info", ",", "environ", ")", ":", "realm", "=", "self", ".", "_calc_realm_from_path_provider", "(", "path_info", ",", "environ", ")", "return", "realm" ]
cec0d84222fc24bea01be1cea91729001963f172