| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
import sys |
| 10 |
import yaml |
| 11 |
|
| 12 |
from packaging import version |
| 13 |
import os |
| 14 |
|
| 15 |
def main(argv): |
| 16 |
if not os.path.exists(argv[0]): |
| 17 |
print("Needs to be run from top level of Li-Ri") |
| 18 |
sys.exit(1) |
| 19 |
|
| 20 |
with open("NEWS.yaml", "r", encoding="utf8") as stream: |
| 21 |
for news in yaml.safe_load_all(stream): |
| 22 |
short_version = version.Version(news['Version']) |
| 23 |
if short_version.major < 3: |
| 24 |
continue |
| 25 |
if 'Description' in news: |
| 26 |
long_version = short_version.major*10000+short_version.minor*100+short_version.micro |
| 27 |
print(long_version, news['Description']) |
| 28 |
out_file = f"fastlane/metadata/android/en-US/changelogs/{long_version}.txt" |
| 29 |
with open(out_file, 'w', encoding="utf8") as changelog_file: |
| 30 |
changelog_file.write('\n'.join(news['Description']) + '\n') |
| 31 |
|
| 32 |
|
| 33 |
if __name__ == '__main__': |
| 34 |
main(sys.argv) |