mirror of
https://github.com/offa/android-foss.git
synced 2026-07-21 17:35:38 +02:00
Merge pull request #463 from Ammar64/master
Make it work for older python versions
This commit is contained in:
@@ -30,6 +30,8 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
name: Ensure sorted
|
name: Ensure sorted
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@main
|
||||||
- name: Ensure sorted
|
- name: Ensure sorted
|
||||||
run: python3 ensure_sorted.py
|
run: python3 ensure_sorted.py
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -74,7 +74,7 @@ def main():
|
|||||||
categories.append(category)
|
categories.append(category)
|
||||||
# This is also a category
|
# This is also a category
|
||||||
elif lines[i].startswith("## –"):
|
elif lines[i].startswith("## –"):
|
||||||
category_name = re.findall("(?<=##\s–\s).*?(?=\s–)", lines[i])[0]
|
category_name = re.findall("(?<=##\\s–\\s).*?(?=\\s–)", lines[i])[0]
|
||||||
category = Category(category_name)
|
category = Category(category_name)
|
||||||
categories.append(category)
|
categories.append(category)
|
||||||
# This is an app
|
# This is an app
|
||||||
@@ -93,7 +93,7 @@ def main():
|
|||||||
longest_str = len(max(unsorted, key=len))
|
longest_str = len(max(unsorted, key=len))
|
||||||
for j in range(len(sorted)):
|
for j in range(len(sorted)):
|
||||||
color = sorted[j] != unsorted[j]
|
color = sorted[j] != unsorted[j]
|
||||||
print(f' {bcolors.RED if color else ''}{unsorted[j]}{bcolors.ENDC if color else ''}{((longest_str-len(unsorted[j]))+2) * ' '}{bcolors.GREEN if color else ''}{sorted[j]}{bcolors.ENDC if color else ''}')
|
print(f' {bcolors.RED if color else ""}{unsorted[j]}{bcolors.ENDC if color else ""}{((longest_str-len(unsorted[j]))+2) * " "}{bcolors.GREEN if color else ""}{sorted[j]}{bcolors.ENDC if color else ""}')
|
||||||
all_sorted = False
|
all_sorted = False
|
||||||
|
|
||||||
if not all_sorted:
|
if not all_sorted:
|
||||||
|
|||||||
Reference in New Issue
Block a user