From a3d2885bbd9eb6d25c7f2e0cd701c67a1d2c7587 Mon Sep 17 00:00:00 2001 From: Denis Malinovskiy Date: Mon, 20 Jul 2015 14:03:48 -0700 Subject: [PATCH 1/4] Update to BeatifulSoup4 latest version --- python_webdav/parse.py | 6 +++--- requirements.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python_webdav/parse.py b/python_webdav/parse.py index 20c7208..aeb329e 100644 --- a/python_webdav/parse.py +++ b/python_webdav/parse.py @@ -4,7 +4,7 @@ import re from lxml.etree import ElementTree, HTML -from BeautifulSoup import BeautifulStoneSoup +from bs4 import BeautifulSoup class Response(object): @@ -129,8 +129,8 @@ def parse(self, data): :return: self.response_objects """ - data_elements = BeautifulStoneSoup(data) - all_response_elements = data_elements.findAll( + data_elements = BeautifulSoup(data, 'xml') + all_response_elements = data_elements.find_all( re.compile(r'(?i)[a-z0-9]:response')) for response in all_response_elements: diff --git a/requirements.txt b/requirements.txt index f34c536..2d0837d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ requests==0.11.1 mock -BeautifulSoup==3.2.1 +BeautifulSoup4==4.4.0 From dc157df44623a077a7bc0ee26529930c7623647e Mon Sep 17 00:00:00 2001 From: Denis Malinovskiy Date: Mon, 20 Jul 2015 14:25:00 -0700 Subject: [PATCH 2/4] Add send_streaming_get method to allow get large files --- python_webdav/connection.py | 19 +++++++++++++++++++ requirements.txt | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/python_webdav/connection.py b/python_webdav/connection.py index 6bfd927..7f1c4ed 100644 --- a/python_webdav/connection.py +++ b/python_webdav/connection.py @@ -109,6 +109,25 @@ def send_get(self, path, headers=None, callback=False): except requests.ConnectionError: raise + def send_streaming_get(self, path, headers=None): + """ Send a streaming GET request, useful for uploading large files + It returns iterator over the content. + :see http://docs.python-requests.org/en/latest/api/#requests.Response.iter_content + + :param path: The path (without host) to the resource to get + :type path: String + + :param headers: Additional headers for the request should be added here + :type headers: Dict + """ + if not headers: + headers = {} + + uri = "%s/%s" % (self.host.rstrip('/'), path.lstrip('/')) + resp = self.httpcon.get(uri, headers=headers, stream=True) + + return resp, resp.iter_content() + def send_put(self, path, body, headers=None): """ This PUT request will put data files onto a webdav server. However, please note that due to the way in which httplib2 sends diff --git a/requirements.txt b/requirements.txt index 2d0837d..7bd2561 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -requests==0.11.1 +requests>=1.0 mock BeautifulSoup4==4.4.0 From 906b513d046cbf1817fba06e22499991f4fb3fdc Mon Sep 17 00:00:00 2001 From: Denis Malinovskiy Date: Mon, 20 Jul 2015 17:50:33 -0700 Subject: [PATCH 3/4] Set a better chunk_size default (instead of 1 byte) --- python_webdav/connection.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python_webdav/connection.py b/python_webdav/connection.py index 7f1c4ed..b86ffb3 100644 --- a/python_webdav/connection.py +++ b/python_webdav/connection.py @@ -109,7 +109,7 @@ def send_get(self, path, headers=None, callback=False): except requests.ConnectionError: raise - def send_streaming_get(self, path, headers=None): + def send_streaming_get(self, path, headers=None, chunk_size=102400): """ Send a streaming GET request, useful for uploading large files It returns iterator over the content. :see http://docs.python-requests.org/en/latest/api/#requests.Response.iter_content @@ -119,6 +119,10 @@ def send_streaming_get(self, path, headers=None): :param headers: Additional headers for the request should be added here :type headers: Dict + + :param chunk_size: The size of the chunk to be returned by the + iterator, default is 100K + :type chunk_size: Int """ if not headers: headers = {} @@ -126,7 +130,7 @@ def send_streaming_get(self, path, headers=None): uri = "%s/%s" % (self.host.rstrip('/'), path.lstrip('/')) resp = self.httpcon.get(uri, headers=headers, stream=True) - return resp, resp.iter_content() + return resp, resp.iter_content(chunk_size=chunk_size) def send_put(self, path, body, headers=None): """ This PUT request will put data files onto a webdav server. From b9dfffd300eeb4d6cdc2b1a2d92dc4fbe07395a5 Mon Sep 17 00:00:00 2001 From: firech13f <49689953+firech13f@users.noreply.github.com> Date: Tue, 11 Feb 2025 00:08:49 -0500 Subject: [PATCH 4/4] Metadata Ingestion for IdP! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds a file to this repository, to ingest metadata, making it officially part of the EverHealth IdP. 🚀 🔧 What's inside? ✅ Metadata ingestion file ✅ Integration with EverHealth IdP ✅ One step closer to a unified catalog! --- catalog-info.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 catalog-info.yaml diff --git a/catalog-info.yaml b/catalog-info.yaml new file mode 100644 index 0000000..d6108e4 --- /dev/null +++ b/catalog-info.yaml @@ -0,0 +1,16 @@ +apiVersion: backstage.io/v1alpha1 +kind: Component +metadata: + name: python-webdav + description: python-webdav is a client webdav library for Python + annotations: + business-unit: EverHealth + github.com/project-slug: drchrono/python-webdav + product: DRC +spec: + type: service + lifecycle: production + owner: EverHealth + implementation: + languages: + - Python