mirror of
https://github.com/offa/android-foss.git
synced 2025-11-07 01:54:53 +05:30
Merge pull request #463 from Ammar64/master
Make it work for older python versions
This commit is contained in:
commit
6d5ea073d5
2 changed files with 5 additions and 3 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -30,6 +30,8 @@ jobs:
|
|||
contents: read
|
||||
name: Ensure sorted
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@main
|
||||
- name: Ensure sorted
|
||||
run: python3 ensure_sorted.py
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ def main():
|
|||
categories.append(category)
|
||||
# This is also a category
|
||||
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)
|
||||
categories.append(category)
|
||||
# This is an app
|
||||
|
|
@ -93,7 +93,7 @@ def main():
|
|||
longest_str = len(max(unsorted, key=len))
|
||||
for j in range(len(sorted)):
|
||||
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
|
||||
|
||||
if not all_sorted:
|
||||
|
|
@ -101,4 +101,4 @@ def main():
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue