30 lines
616 B
Python
Executable file
30 lines
616 B
Python
Executable file
#!/usr/bin/env python3
|
|
|
|
import logging
|
|
import os
|
|
import sys
|
|
|
|
import inflatinator.revbank as revbank
|
|
|
|
|
|
def main_args(product_file):
|
|
log_level = os.environ.get('LOG_LEVEL', 'INFO').upper()
|
|
logging.basicConfig(level=log_level)
|
|
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)
|
|
|
|
|
|
def main():
|
|
main_args(sys.argv[1])
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|