revbank-inflatinator/inflatinator/__main__.py
2024-07-28 14:17:35 +02:00

21 lines
465 B
Python

import revbank
import sys
import logging
def main(product_file):
logging.basicConfig(level=logging.INFO)
logging.getLogger("requests").setLevel(logging.WARNING)
logging.getLogger("urllib3").setLevel(logging.WARNING)
with open(product_file, 'r') as fd:
src = fd.read()
new_src = revbank.update_product_pricings(src)
with open(product_file, 'w') as fd:
fd.write(new_src)
if __name__ == '__main__':
main(sys.argv[1])