|
19 | 19 | COMMUNITY_BUNDLE_DATA = "latest_community_bundle_data.json" |
20 | 20 | COMMUNITY_BUNDLE_TAG = "latest_community_bundle_tag.json" |
21 | 21 |
|
22 | | -ADAFRUIT_BUNDLE_S3_URL = "https://adafruit-circuit-python.s3.amazonaws.com/bundles/adafruit/adafruit-circuitpython-bundle-{tag}.json" |
23 | | -COMMUNITY_BUNDLE_S3_URL = "https://adafruit-circuit-python.s3.amazonaws.com/bundles/community/circuitpython-community-bundle-{tag}.json" |
| 22 | +ADAFRUIT_BUNDLE_S3_URL = "https://adafruit-circuit-python.s3.amazonaws.com/bundles/adafruit/adafruit-circuitpython-bundle-{tag}.json" # pylint: disable=line-too-long |
| 23 | +COMMUNITY_BUNDLE_S3_URL = "https://adafruit-circuit-python.s3.amazonaws.com/bundles/community/circuitpython-community-bundle-{tag}.json" # pylint: disable=line-too-long |
24 | 24 |
|
25 | 25 | LEARN_GUIDE_REPO = os.environ.get( |
26 | 26 | "LEARN_GUIDE_REPO", "../Adafruit_Learning_System_Guides/" |
|
44 | 44 |
|
45 | 45 | def get_bundle(bundle_url, bundle_data_file): |
46 | 46 | """Download the Adafruit and Community bundles data""" |
47 | | - #url = f"https://adafruit-circuit-python.s3.amazonaws.com/bundles/adafruit/adafruit-circuitpython-bundle-{tag}.json" # pylint: disable=line-too-long |
48 | 47 | print(f"get bundle metadata from {bundle_url}") |
49 | 48 | r = requests.get(bundle_url) |
50 | 49 | with open(bundle_data_file, "wb") as bundle_file: |
@@ -113,17 +112,23 @@ def ensure_latest_bundle(bundle_url, bundle_s3_url, bundle_tag_file, bundle_data |
113 | 112 | print(f"Current library bundle up to date {tag}") |
114 | 113 |
|
115 | 114 |
|
116 | | -ensure_latest_bundle("https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/latest", |
117 | | - ADAFRUIT_BUNDLE_S3_URL, |
118 | | - ADAFRUIT_BUNDLE_TAG, ADAFRUIT_BUNDLE_DATA) |
119 | | -ensure_latest_bundle("https://github.com/adafruit/CircuitPython_Community_Bundle/releases/latest", |
120 | | - COMMUNITY_BUNDLE_S3_URL, |
121 | | - COMMUNITY_BUNDLE_TAG, COMMUNITY_BUNDLE_DATA) |
| 115 | +ensure_latest_bundle( |
| 116 | + "https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/latest", |
| 117 | + ADAFRUIT_BUNDLE_S3_URL, |
| 118 | + ADAFRUIT_BUNDLE_TAG, |
| 119 | + ADAFRUIT_BUNDLE_DATA, |
| 120 | +) |
| 121 | +ensure_latest_bundle( |
| 122 | + "https://github.com/adafruit/CircuitPython_Community_Bundle/releases/latest", |
| 123 | + COMMUNITY_BUNDLE_S3_URL, |
| 124 | + COMMUNITY_BUNDLE_TAG, |
| 125 | + COMMUNITY_BUNDLE_DATA, |
| 126 | +) |
122 | 127 |
|
123 | 128 | with open(ADAFRUIT_BUNDLE_DATA, "r", encoding="utf-8") as f: |
124 | 129 | bundle_data = json.load(f) |
125 | 130 |
|
126 | | -with open(COMMUNITY_BUNDLE_DATA, "r") as f: |
| 131 | +with open(COMMUNITY_BUNDLE_DATA, "r", encoding="utf-8") as f: |
127 | 132 | community_bundle_data = json.load(f) |
128 | 133 |
|
129 | 134 |
|
|
0 commit comments