2024-03-25 02:30:34 +01:00
|
|
|
#! /usr/bin/env python3
|
|
|
|
|
|
|
|
"""
|
|
|
|
Super small script for github action to detect if 2 .pot files have changed for
|
|
|
|
github/workflows/auto_messages_pot.yml
|
|
|
|
"""
|
|
|
|
|
|
|
|
import sys
|
|
|
|
from babel.messages.pofile import PoFileParser
|
|
|
|
|
|
|
|
|
|
|
|
def load_pot_file(file_path):
|
|
|
|
poparser = PoFileParser({})
|
|
|
|
poparser.parse(open(file_path))
|
|
|
|
return poparser.catalog
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
file_1 = load_pot_file(sys.argv[1])
|
|
|
|
file_2 = load_pot_file(sys.argv[2])
|
|
|
|
|
|
|
|
if [x for x in file_1.keys() if x] == [x for x in file_2.keys() if x]:
|
2024-03-25 02:32:20 +01:00
|
|
|
print("false")
|
2024-03-25 02:30:34 +01:00
|
|
|
else:
|
2024-03-25 02:32:20 +01:00
|
|
|
print("true")
|
2024-03-25 02:30:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|