Skip to content

Commit

Permalink
Release 24.1 Android (#94)
Browse files Browse the repository at this point in the history
* Release 24.1 Android

* Change Pricing URL

* Update github checkout version from v3 to v4

---------

Co-authored-by: ivankamkin <[email protected]>
  • Loading branch information
Denis-Averin and ivankamkin committed Feb 28, 2024
1 parent 62d1d57 commit dff4865
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 33 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/check-codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -25,7 +25,7 @@ jobs:
check-urls:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -36,7 +36,7 @@ jobs:
runs-on: ubuntu-latest
needs: [check-submodules]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

Expand Down
2 changes: 1 addition & 1 deletion codegen/Templates/android/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion codegen/Templates/csharp/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion codegen/Templates/dart/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions codegen/Templates/dart/pubspec.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ environment:
dependencies:
http: '>=0.13.0 <2.0.0'
dev_dependencies:
lints: ^3.0.0
test: ^1.25.1
2 changes: 1 addition & 1 deletion codegen/Templates/go/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion codegen/Templates/java/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion codegen/Templates/python/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
57 changes: 34 additions & 23 deletions scripts/check-urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<http_code>\d+)")
CURL_STDERR_HTTP_RE = re.compile(
r"^curl: \(22\) The requested URL returned error: (?P<http_code>\d+)"
)
OK = 0
COULDNT_RESOLVE_HOST = 6
HTTP_RETURNED_ERROR = 22
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand All @@ -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):
Expand All @@ -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")

Expand All @@ -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)

Expand Down

0 comments on commit dff4865

Please sign in to comment.