tool: add datetime to scraped bluetooth_* files

This commit is contained in:
Matthias Ringwald 2018-03-09 13:03:35 +01:00
parent 6104991b22
commit b436f1776a
4 changed files with 11 additions and 7 deletions

View File

@ -21,7 +21,8 @@ Copyright 2017, BlueKitchen GmbH
header = '''
/**
* bluetooth_company_id.h generated from Bluetooth SIG website for BTstack
* bluetooth_company_id.h generated from Bluetooth SIG website for BTstack by tool/bluetooth_company_id.py
* {datetime}
*/
#ifndef __BLUETOOTH_COMPANY_ID_H
@ -109,4 +110,4 @@ with open(gen_path, 'wt') as fout:
scrape_page(fout, 'https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers')
fout.write(trailer)
print('Scraping successful!\n')
print('Scraping successful!\n')

View File

@ -17,8 +17,9 @@ Copyright 2016, BlueKitchen GmbH
'''
header = '''/**
* bluetooth_data_types.h generated from Bluetooth SIG website for BTstack
* bluetooth_data_types.h generated from Bluetooth SIG website for BTstack by tool/bluetooth_data_types.py
* {url}
* {datetime}
*/
#ifndef __BLUETOOTH_DATA_TYPES_H

View File

@ -17,7 +17,8 @@ Copyright 2016, BlueKitchen GmbH
header = '''
/**
* bluetooth_gatt.h generated from Bluetooth SIG website for BTstack
* bluetooth_gatt.h generated from Bluetooth SIG website for BTstack tool/bluetooth_gatt.py
* {datetime}
*/
#ifndef __BLUETOOTH_GATT_H
@ -63,4 +64,4 @@ with open(gen_path, 'wt') as fout:
scrape_page(fout, 'https://www.bluetooth.com/specifications/gatt/descriptors')
fout.write(trailer)
print('Scraping successful!\n')
print('Scraping successful!\n')

View File

@ -20,6 +20,7 @@ Copyright 2017, BlueKitchen GmbH
header = '''/**
* bluetooth_sdp.h generated from Bluetooth SIG website for BTstack by tool/bluetooth_sdp.py
* {page}
* {datetime}
*/
#ifndef __BLUETOOTH_SDP_H
@ -93,7 +94,7 @@ def scrape_attributes(fout, tree, table_name):
def scrape_page(fout, url):
print("Parsing %s" % url)
fout.write(header.format(page=url))
fout.write(header.format(page=url,datetime=str(datetime.datetime.now())))
# get from web
r = requests.get(url)
@ -175,4 +176,4 @@ with open(gen_path, 'wt') as fout:
scrape_page(fout, 'https://www.bluetooth.com/specifications/assigned-numbers/service-discovery')
fout.write(trailer)
print('Scraping successful!\n')
print('Scraping successful!\n')