From dff4865b1b9a4830b6a868a4b427bc7aed6eca36 Mon Sep 17 00:00:00 2001 From: Denis Averin <59285247+Denis-Averin@users.noreply.github.com> Date: Wed, 28 Feb 2024 16:55:23 +0700 Subject: [PATCH] Release 24.1 Android (#94) * Release 24.1 Android * Change Pricing URL * Update github checkout version from v3 to v4 --------- Co-authored-by: ivankamkin <109517020+ivankamkin@users.noreply.github.com> --- .github/workflows/check-codegen.yml | 6 +-- codegen/Templates/android/README.mustache | 2 +- codegen/Templates/csharp/README.mustache | 2 +- codegen/Templates/dart/README.mustache | 2 +- codegen/Templates/dart/pubspec.mustache | 1 + codegen/Templates/go/README.mustache | 2 +- codegen/Templates/java/README.mustache | 2 +- codegen/Templates/python/README.mustache | 2 +- scripts/check-urls.py | 57 ++++++++++++++--------- submodules/android | 2 +- 10 files changed, 45 insertions(+), 33 deletions(-) diff --git a/.github/workflows/check-codegen.yml b/.github/workflows/check-codegen.yml index 7bd1877..0d73f3c 100644 --- a/.github/workflows/check-codegen.yml +++ b/.github/workflows/check-codegen.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive @@ -25,7 +25,7 @@ jobs: check-urls: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive @@ -36,7 +36,7 @@ jobs: runs-on: ubuntu-latest needs: [check-submodules] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive diff --git a/codegen/Templates/android/README.mustache b/codegen/Templates/android/README.mustache index 89ca636..a23a948 100644 --- a/codegen/Templates/android/README.mustache +++ b/codegen/Templates/android/README.mustache @@ -66,7 +66,7 @@ Postnet, Planet, USPS OneCode, Australia Post, Deutsche Post Identcode, Deutsche ## Prerequisites -To use Aspose Barcode Cloud for Android you need to register an account with [Aspose Cloud](https://www.aspose.cloud) and lookup/create Client Secret and SID at [Cloud Dashboard](https://dashboard.aspose.cloud/applications). There is free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/pricing). +To use Aspose Barcode Cloud for Android you need to register an account with [Aspose Cloud](https://www.aspose.cloud) and lookup/create Client Secret and SID at [Cloud Dashboard](https://dashboard.aspose.cloud/applications). There is free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/). ## Getting Started diff --git a/codegen/Templates/csharp/README.mustache b/codegen/Templates/csharp/README.mustache index ecd0308..1259a86 100644 --- a/codegen/Templates/csharp/README.mustache +++ b/codegen/Templates/csharp/README.mustache @@ -35,7 +35,7 @@ The complete source code is available in this repository folder. You can either ## Prerequisites -To use Aspose.BarCode Cloud SDK for .NET you need to register an account with [Aspose Cloud](https://www.aspose.cloud) and lookup/create Client Secret and Client Id at [Cloud Dashboard](https://dashboard.aspose.cloud/applications). There is free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/pricing). +To use Aspose.BarCode Cloud SDK for .NET you need to register an account with [Aspose Cloud](https://www.aspose.cloud) and lookup/create Client Secret and Client Id at [Cloud Dashboard](https://dashboard.aspose.cloud/applications). There is free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/). ## Installation diff --git a/codegen/Templates/dart/README.mustache b/codegen/Templates/dart/README.mustache index 0a03dab..51b6a37 100644 --- a/codegen/Templates/dart/README.mustache +++ b/codegen/Templates/dart/README.mustache @@ -23,7 +23,7 @@ To use these SDKs, you will need Client Id and Client Secret which can be looked ## Prerequisites -To use Aspose.BarCode Cloud SDK for Dart you need to register an account with [Aspose Cloud](https://www.aspose.cloud) and lookup/create Client Secret and SID at [Cloud Dashboard](https://dashboard.aspose.cloud/applications). There is a free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/pricing). +To use Aspose.BarCode Cloud SDK for Dart you need to register an account with [Aspose Cloud](https://www.aspose.cloud) and lookup/create Client Secret and SID at [Cloud Dashboard](https://dashboard.aspose.cloud/applications). There is a free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/). ## Requirements diff --git a/codegen/Templates/dart/pubspec.mustache b/codegen/Templates/dart/pubspec.mustache index 2161159..e264f47 100644 --- a/codegen/Templates/dart/pubspec.mustache +++ b/codegen/Templates/dart/pubspec.mustache @@ -15,6 +15,7 @@ environment: dependencies: http: '>=0.13.0 <2.0.0' + dev_dependencies: lints: ^3.0.0 test: ^1.25.1 diff --git a/codegen/Templates/go/README.mustache b/codegen/Templates/go/README.mustache index 06a0c1e..29e8c13 100644 --- a/codegen/Templates/go/README.mustache +++ b/codegen/Templates/go/README.mustache @@ -23,7 +23,7 @@ To use these SDKs, you will need Client Id and Client Secret which can be looked ## Prerequisites -To use Aspose.BarCode Cloud SDK for Go you need to register an account with [Aspose Cloud](https://www.aspose.cloud) and lookup/create Client Secret and SID at [Cloud Dashboard](https://dashboard.aspose.cloud/applications). There is a free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/pricing). +To use Aspose.BarCode Cloud SDK for Go you need to register an account with [Aspose Cloud](https://www.aspose.cloud) and lookup/create Client Secret and SID at [Cloud Dashboard](https://dashboard.aspose.cloud/applications). There is a free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/). ## Installation diff --git a/codegen/Templates/java/README.mustache b/codegen/Templates/java/README.mustache index 734165b..bf2f752 100644 --- a/codegen/Templates/java/README.mustache +++ b/codegen/Templates/java/README.mustache @@ -28,7 +28,7 @@ Building the API client library requires: ## Prerequisites -To use Aspose.BarCode Cloud SDK for Java you need to register an account with [Aspose Cloud](https://www.aspose.cloud) and lookup/create Client Id and Client Secret at [Cloud Dashboard](https://dashboard.aspose.cloud/applications). There is free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/pricing). +To use Aspose.BarCode Cloud SDK for Java you need to register an account with [Aspose Cloud](https://www.aspose.cloud) and lookup/create Client Id and Client Secret at [Cloud Dashboard](https://dashboard.aspose.cloud/applications). There is free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/). ## Installation diff --git a/codegen/Templates/python/README.mustache b/codegen/Templates/python/README.mustache index c759fa9..4c785e3 100644 --- a/codegen/Templates/python/README.mustache +++ b/codegen/Templates/python/README.mustache @@ -31,7 +31,7 @@ The complete source code is available in this repository folder. You can either ## Prerequisites -To use Aspose.BarCode Cloud SDK for Python you need to register an account with [Aspose Cloud](https://www.aspose.cloud) and lookup/create Client Secret and Client Id at [Cloud Dashboard](https://dashboard.aspose.cloud/applications). There is free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/pricing). +To use Aspose.BarCode Cloud SDK for Python you need to register an account with [Aspose Cloud](https://www.aspose.cloud) and lookup/create Client Secret and Client Id at [Cloud Dashboard](https://dashboard.aspose.cloud/applications). There is free quota available. For more details, see [Aspose Cloud Pricing](https://purchase.aspose.cloud/). ## Installation diff --git a/scripts/check-urls.py b/scripts/check-urls.py index a635f12..f22e725 100644 --- a/scripts/check-urls.py +++ b/scripts/check-urls.py @@ -21,7 +21,9 @@ class Curl: See: https://curl.se/libcurl/c/libcurl-errors.html """ - CURL_STDERR_HTTP_RE = re.compile(r"^curl: \(22\) The requested URL returned error: (?P\d+)") + CURL_STDERR_HTTP_RE = re.compile( + r"^curl: \(22\) The requested URL returned error: (?P\d+)" + ) OK = 0 COULDNT_RESOLVE_HOST = 6 HTTP_RETURNED_ERROR = 22 @@ -68,18 +70,18 @@ class Curl: # print(URL_RE_PATTERN) URL_REGEX = re.compile(URL_RE_PATTERN, re.MULTILINE) - BROKEN_URLS = collections.defaultdict(list) - -EXTRACTED_URLS = set(URLS_TO_IGNORE) +EXTRACTED_URLS_WITH_FILES = {k: [] for k in URLS_TO_IGNORE} -def url_extractor(text): +def url_extractor(text, filename): for url in URL_REGEX.findall(text): - if url not in EXTRACTED_URLS: - EXTRACTED_URLS.add(url) + if url not in EXTRACTED_URLS_WITH_FILES: + EXTRACTED_URLS_WITH_FILES[url] = [filename] yield url + else: + EXTRACTED_URLS_WITH_FILES[url].append(filename) FILES_TO_IGNORE = frozenset( @@ -107,9 +109,8 @@ class Task: # To avoid 403 responses USER_AGENT = "Googlebot/2.1 (+http://www.google.com/bot.html)" - def __init__(self, url, filename): + def __init__(self, url): self.url = url - self.filename = filename self._proc = subprocess.Popen( [ "curl", @@ -147,14 +148,16 @@ def age(self) -> float: return time.time() - self._started -def create_new_task(url, filename) -> Task: - # print("Create task:", url, filename) - return Task(url, filename) +def create_new_task(url) -> Task: + # print("Create task:", url) + return Task(url) def process_finished_task(task) -> None: # print("Finish task:", task.url) - expected_ret_code, expected_http_code = CURL_EXIT_CODES_AND_HTTP_CODES.get(task.url, (0, None)) + expected_ret_code, expected_http_code = CURL_EXIT_CODES_AND_HTTP_CODES.get( + task.url, (0, None) + ) if task.ret_code == expected_ret_code: print("OK:", "'%s' %.2fs" % (task.url, task.age)) return @@ -169,13 +172,14 @@ def process_finished_task(task) -> None: return print( - "Expected %d got %d for '%s': %s" % (expected_ret_code, task.ret_code, task.url, task.stderr), + "Expected %d got %d for '%s': %s" + % (expected_ret_code, task.ret_code, task.url, task.stderr), file=sys.stderr, ) - BROKEN_URLS[task.url].append(task.filename) + BROKEN_URLS[task.url] = EXTRACTED_URLS_WITH_FILES[task.url] -queue = SimpleQueue() +WORKER_QUEUE = SimpleQueue() def url_checker(num_workers=8): @@ -195,13 +199,13 @@ def url_checker(num_workers=8): if not queue_is_empty: for i in (i for (i, w) in enumerate(workers) if w is None): - item = queue.get() + item = WORKER_QUEUE.get() if item is None: queue_is_empty = True print("Stop queue") break - (url, filename) = item - workers[i] = create_new_task(url, filename) + url = item + workers[i] = create_new_task(url) time.sleep(0.2) print("Worker finished") @@ -211,14 +215,21 @@ def main(files): checker.start() for filename, text in text_extractor(files): - for url in url_extractor(text): + for url in url_extractor(text, filename): # print("In:", url) - queue.put_nowait((url, filename)) - queue.put_nowait(None) + WORKER_QUEUE.put_nowait((url)) + WORKER_QUEUE.put_nowait(None) checker.join() + if BROKEN_URLS: + print("Errors:", file=sys.stdout, flush=True) for url, files in BROKEN_URLS.items(): - print("BROKEN URL: '%s' in files: %s" % (url, ", ".join(files)), file=sys.stderr) + print( + "BROKEN URL: '%s' in files: %s" + % (url, ", ".join("'%s'" % f for f in files)), + file=sys.stderr, + flush=True, + ) if BROKEN_URLS: exit(1) diff --git a/submodules/android b/submodules/android index 3f6178c..f01860a 160000 --- a/submodules/android +++ b/submodules/android @@ -1 +1 @@ -Subproject commit 3f6178cee03055bec7d0455166bc7711a2968bde +Subproject commit f01860a5067661dd6e1335c9953f838c1ad72f84