import sys

try:
    import requests
    pass
except ImportError:
    print('Vous devez installer le package requests pour faire fonctionner ce programme:\n')
    print('   pip3 install requests')
    exit(1)

if '--update' in sys.argv:
    print("Updating 📑")
    r = requests.get('https://git.unistra.fr/-/snippets/132/raw', timeout=6)
    with open(__file__, 'w') as f:
        f.write(r.text)
        print("Done 🎉")

    exit(0)
else:
    print('Please update this program by running: '+str(sys.argv[0]+' --update'))
    exit(1)