Skip to content

Commit a4b771f

Browse files
hellcpjwise
authored andcommitted
Allow flint to populate the appstore
1 parent 6b19dc6 commit a4b771f

File tree

5 files changed

+21
-16
lines changed

5 files changed

+21
-16
lines changed

appstore/commands.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def import_apps(app_type):
170170
done = set()
171171
for platform in (app_obj.releases[0].compatibility
172172
if len(app_obj.releases) > 0
173-
else ['aplite', 'basalt', 'chalk', 'diorite', 'emery']):
173+
else ['aplite', 'basalt', 'chalk', 'diorite', 'emery', 'flint']):
174174
r = requests.get(f"https://api2.getpebble.com/v2/apps/id/{app_obj.id}?hardware={platform}")
175175
r.raise_for_status()
176176
data = r.json()['data'][0]
@@ -186,7 +186,7 @@ def import_apps(app_type):
186186
db.session.add(collection)
187187

188188
if filename:
189-
for platform in ['aplite', 'basalt', 'chalk', 'diorite', 'emery']:
189+
for platform in ['aplite', 'basalt', 'chalk', 'diorite', 'emery', 'flint']:
190190
pbw = PBW(filename, platform)
191191
if not pbw.has_platform:
192192
continue
@@ -324,7 +324,7 @@ def import_app_from_locker(locker_app):
324324
is_published=True,
325325
)
326326
db.session.add(release_obj)
327-
for platform in ['aplite', 'basalt', 'chalk', 'diorite', 'emery']:
327+
for platform in ['aplite', 'basalt', 'chalk', 'diorite', 'emery', 'flint']:
328328
pbw = PBW(filename, platform)
329329
if not pbw.has_platform:
330330
continue
@@ -510,7 +510,7 @@ def path(base):
510510
release_notes = params['release_notes'],
511511
published_date = datetime.datetime.utcnow(),
512512
version = appinfo['versionLabel'],
513-
compatibility = appinfo.get('targetPlatforms', [ 'aplite', 'basalt', 'diorite', 'emery' ]))
513+
compatibility = appinfo.get('targetPlatforms', [ 'aplite', 'basalt', 'diorite', 'emery', 'flint' ]))
514514
print(f"Created release {release.id}")
515515
upload_pbw(release, path(pbw_file))
516516
db.session.commit()

appstore/developer_portal_api.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def submit_new_app():
8888
"chalk": [],
8989
"diorite": [],
9090
"emery": [],
91+
"flint": [],
9192
}
9293

9394
try:
@@ -187,7 +188,7 @@ def submit_new_app():
187188
release_notes=params['release_notes'],
188189
published_date=datetime.datetime.utcnow(),
189190
version=appinfo['versionLabel'],
190-
compatibility=appinfo.get('targetPlatforms', ['aplite', 'basalt', 'diorite', 'emery']))
191+
compatibility=appinfo.get('targetPlatforms', ['aplite', 'basalt', 'diorite', 'emery', 'flint']))
191192
print(f"Created release {release.id}")
192193
upload_pbw(release, request.files['pbw'])
193194
db.session.commit()
@@ -319,7 +320,7 @@ def submit_new_release(app_id):
319320
release_notes=data["release_notes"],
320321
published_date=datetime.datetime.utcnow(),
321322
version=version,
322-
compatibility=appinfo.get('targetPlatforms', ['aplite', 'basalt', 'diorite', 'emery']))
323+
compatibility=appinfo.get('targetPlatforms', ['aplite', 'basalt', 'diorite', 'emery', 'flint']))
323324

324325
upload_pbw(release_new, request.files['pbw'])
325326
db.session.commit()

appstore/locker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ def jsonify_locker_app(entry):
6060
},
6161
**{
6262
x: {
63-
'supported': x in (release.compatibility if release and release.compatibility else ['aplite', 'basalt', 'diorite', 'emery']),
63+
'supported': x in (release.compatibility if release and release.compatibility else ['aplite', 'basalt', 'diorite', 'emery', 'flint']),
6464
'firmware': {'major': 3}
65-
} for x in ['aplite', 'basalt', 'chalk', 'diorite', 'emery']
65+
} for x in ['aplite', 'basalt', 'chalk', 'diorite', 'emery', 'flint']
6666
},
6767
},
6868
'companions': {

appstore/pbw.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from .models import Binary, App, Release, db
1313
from .utils import id_generator
1414

15-
PLATFORMS = ['aplite', 'basalt', 'chalk', 'diorite', 'emery']
15+
PLATFORMS = ['aplite', 'basalt', 'chalk', 'diorite', 'emery', 'flint']
1616
GENERATED_ID_PREFIX = "13371337"
1717

1818
class PBW(object):
@@ -42,6 +42,7 @@ class PBW(object):
4242
'chalk': ('chalk/',),
4343
'diorite': ('diorite/',),
4444
'emery': ('emery/',),
45+
'flint': ('flint/',),
4546
}
4647

4748
def __init__(self, pbw, platform):

appstore/utils.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,16 @@ def __init__(self, message="Failed to validate new app", e_code="generic.error")
4444
'chalk': (180, 180),
4545
'diorite': (144, 168),
4646
'emery': (200, 228),
47+
'flint': (144, 168),
4748
}
4849

4950
valid_platforms = [
5051
"aplite",
5152
"basalt",
5253
"chalk",
5354
"diorite",
54-
"emery"
55+
"emery",
56+
"flint"
5557
]
5658

5759
permitted_image_types = [
@@ -85,9 +87,9 @@ def _jsonify_common(app: App, target_hw: str) -> dict:
8587
},
8688
**{
8789
x: {
88-
'supported': x in (release.compatibility if release and release.compatibility else ['aplite', 'basalt', 'diorite', 'emery']),
90+
'supported': x in (release.compatibility if release and release.compatibility else ['aplite', 'basalt', 'diorite', 'emery', 'flint']),
8991
'firmware': {'major': 3}
90-
} for x in ['aplite', 'basalt', 'chalk', 'diorite', 'emery']
92+
} for x in ['aplite', 'basalt', 'chalk', 'diorite', 'emery', 'flint']
9193
},
9294
},
9395
'description': assets.description,
@@ -171,7 +173,7 @@ def algolia_app(app: App) -> dict:
171173
if release:
172174
tags.extend(release.compatibility or [])
173175
else:
174-
tags.extend(['aplite', 'basalt', 'chalk', 'diorite', 'emery'])
176+
tags.extend(['aplite', 'basalt', 'chalk', 'diorite', 'emery', 'flint'])
175177
tags.append('companion-app')
176178
if len(app.companions) == 0:
177179
tags.extend(['android', 'ios'])
@@ -212,11 +214,12 @@ def asset_fallback(collections: Dict[str, AssetCollection], target_hw='basalt')
212214
# 13 Aug 25 - WM - Apparently we are getting a lot of requests with 'unknown' as the target_hw.
213215
# Anyone failing to identify will be presumed to be diorite.
214216
fallbacks = {
215-
'aplite': ['aplite', 'diorite', 'basalt'],
217+
'aplite': ['aplite', 'diorite', 'flint', 'basalt'],
216218
'basalt': ['basalt', 'aplite'],
217219
'chalk': ['chalk', 'basalt'],
218-
'diorite': ['diorite', 'aplite', 'basalt'],
219-
'emery': ['emery', 'basalt', 'diorite', 'aplite']
220+
'diorite': ['diorite', 'flint', 'aplite', 'basalt'],
221+
'emery': ['emery', 'basalt', 'diorite', 'aplite'],
222+
'flint': ['flint', 'diorite', 'aplite', 'basalt']
220223
}
221224
fallback = fallbacks[target_hw] if target_hw in fallbacks else fallbacks['diorite']
222225
for hw in fallback:

0 commit comments

Comments
 (0)