2020-09-28 13:57:21 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
import requests
|
|
|
|
|
2021-10-18 13:06:43 +02:00
|
|
|
from lookyloo.default import get_homedir
|
2020-09-28 13:57:21 +02:00
|
|
|
|
2023-01-20 12:47:45 +01:00
|
|
|
d3js_version = '7.8.2'
|
2022-12-22 00:23:35 +01:00
|
|
|
jquery_version = "3.6.3"
|
2022-11-18 11:40:43 +01:00
|
|
|
datatables_version = "1.13.1"
|
2020-09-28 13:57:21 +02:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
dest_dir = get_homedir() / 'website' / 'web' / 'static'
|
|
|
|
|
2023-01-20 12:47:45 +01:00
|
|
|
d3 = requests.get(f'https://cdn.jsdelivr.net/npm/d3@{d3js_version}/dist/d3.min.js')
|
|
|
|
with (dest_dir / 'd3.min.js').open('wb') as f:
|
2020-09-28 13:57:21 +02:00
|
|
|
f.write(d3.content)
|
|
|
|
print(f'Downloaded d3js v{d3js_version}.')
|
|
|
|
|
2022-01-14 15:58:06 +01:00
|
|
|
jquery = requests.get(f'https://code.jquery.com/jquery-{jquery_version}.min.js')
|
2022-11-18 11:40:43 +01:00
|
|
|
with (dest_dir / 'jquery.min.js').open('wb') as f:
|
2022-01-14 15:58:06 +01:00
|
|
|
f.write(jquery.content)
|
|
|
|
print(f'Downloaded jquery v{jquery_version}.')
|
|
|
|
|
2020-09-28 14:24:06 +02:00
|
|
|
datatables_js = requests.get(f'https://cdn.datatables.net/v/bs4/dt-{datatables_version}/datatables.min.js')
|
2020-09-28 13:57:21 +02:00
|
|
|
with (dest_dir / 'datatables.min.js').open('wb') as f:
|
2020-09-28 14:24:06 +02:00
|
|
|
f.write(datatables_js.content)
|
2020-09-28 13:57:21 +02:00
|
|
|
print(f'Downloaded datatables js v{datatables_version}.')
|
|
|
|
|
2020-09-28 14:24:06 +02:00
|
|
|
datatables_css = requests.get(f'https://cdn.datatables.net/v/bs4/dt-{datatables_version}/datatables.min.css')
|
2020-09-28 13:57:21 +02:00
|
|
|
with (dest_dir / 'datatables.min.css').open('wb') as f:
|
2020-09-28 14:24:06 +02:00
|
|
|
f.write(datatables_css.content)
|
2020-09-28 13:57:21 +02:00
|
|
|
print(f'Downloaded datatables_css v{datatables_version}.')
|
|
|
|
|
|
|
|
print('All 3rd party modules for the website were downloaded.')
|