Also lints the tools/ folder

Thanks to #454 the `tools/` folder only holds code we own so we can lint it
This commit is contained in:
Andre Miras 2020-05-06 17:01:36 +02:00
parent 7385cdfca8
commit 7e13a07f57
2 changed files with 322 additions and 324 deletions

View file

@ -14,299 +14,299 @@ from os.path import join, exists
from os import makedirs from os import makedirs
appicon_json = { appicon_json = {
"images" : [ "images": [ # noqa: E121
{ {
"idiom" : "iphone", "idiom": "iphone",
"size" : "20x20", "size": "20x20",
"scale" : "2x", "scale": "2x",
"filename": "Icon40.png" "filename": "Icon40.png"
}, },
{ {
"idiom" : "iphone", "idiom": "iphone",
"size" : "20x20", "size": "20x20",
"scale" : "3x", "scale": "3x",
"filename": "Icon60.png" "filename": "Icon60.png"
}, },
{ {
"size" : "29x29", "size": "29x29",
"idiom" : "iphone", "idiom": "iphone",
"filename" : "Icon29.png", "filename": "Icon29.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"size" : "29x29", "size": "29x29",
"idiom" : "iphone", "idiom": "iphone",
"filename" : "Icon58.png", "filename": "Icon58.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "29x29", "size": "29x29",
"idiom" : "iphone", "idiom": "iphone",
"filename" : "Icon87.png", "filename": "Icon87.png",
"scale" : "3x" "scale": "3x"
}, },
{ {
"size" : "40x40", "size": "40x40",
"idiom" : "iphone", "idiom": "iphone",
"filename" : "Icon80.png", "filename": "Icon80.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "40x40", "size": "40x40",
"idiom" : "iphone", "idiom": "iphone",
"filename" : "Icon120.png", "filename": "Icon120.png",
"scale" : "3x" "scale": "3x"
}, },
{ {
"size" : "57x57", "size": "57x57",
"idiom" : "iphone", "idiom": "iphone",
"filename" : "Icon57.png", "filename": "Icon57.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"size" : "57x57", "size": "57x57",
"idiom" : "iphone", "idiom": "iphone",
"filename" : "Icon114.png", "filename": "Icon114.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "60x60", "size": "60x60",
"idiom" : "iphone", "idiom": "iphone",
"filename" : "Icon120.png", "filename": "Icon120.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "60x60", "size": "60x60",
"idiom" : "iphone", "idiom": "iphone",
"filename" : "Icon180.png", "filename": "Icon180.png",
"scale" : "3x" "scale": "3x"
}, },
{ {
"idiom" : "ipad", "idiom": "ipad",
"size" : "20x20", "size": "20x20",
"filename" : "Icon20.png", "filename": "Icon20.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"idiom" : "ipad", "idiom": "ipad",
"size" : "20x20", "size": "20x20",
"filename" : "Icon40.png", "filename": "Icon40.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "29x29", "size": "29x29",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "Icon29.png", "filename": "Icon29.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"size" : "29x29", "size": "29x29",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "Icon58.png", "filename": "Icon58.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "40x40", "size": "40x40",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "Icon40.png", "filename": "Icon40.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"size" : "40x40", "size": "40x40",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "Icon80.png", "filename": "Icon80.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "50x50", "size": "50x50",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "Icon50.png", "filename": "Icon50.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"size" : "50x50", "size": "50x50",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "Icon100.png", "filename": "Icon100.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "72x72", "size": "72x72",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "Icon72.png", "filename": "Icon72.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"size" : "72x72", "size": "72x72",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "Icon144.png", "filename": "Icon144.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "76x76", "size": "76x76",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "Icon76.png", "filename": "Icon76.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"size" : "76x76", "size": "76x76",
"idiom" : "ipad", "idiom": "ipad",
"filename" : "Icon152.png", "filename": "Icon152.png",
"scale" : "2x" "scale": "2x"
}, },
# If activated, we got a submission error: # If activated, we got a submission error:
# "Error ITMS-9000: Invalid Image Path - No image found at the path # "Error ITMS-9000: Invalid Image Path - No image found at the path
# referenced under key 'CFBundleIcons': 'AppIcon120x120'" # referenced under key 'CFBundleIcons': 'AppIcon120x120'"
# { # {
# "size" : "120x120", # "size": "120x120",
# "idiom" : "car", # "idiom": "car",
# "filename" : "Icon120.png", # "filename": "Icon120.png",
# "scale" : "1x" # "scale": "1x"
# }, # },
{ {
"size" : "24x24", "size": "24x24",
"idiom" : "watch", "idiom": "watch",
"scale" : "2x", "scale": "2x",
"filename" : "Icon48.png", "filename": "Icon48.png",
"role" : "notificationCenter", "role": "notificationCenter",
"subtype" : "38mm" "subtype": "38mm"
}, },
{ {
"size" : "27.5x27.5", "size": "27.5x27.5",
"idiom" : "watch", "idiom": "watch",
"scale" : "2x", "scale": "2x",
"filename" : "Icon55.png", "filename": "Icon55.png",
"role" : "notificationCenter", "role": "notificationCenter",
"subtype" : "42mm" "subtype": "42mm"
}, },
{ {
"size" : "29x29", "size": "29x29",
"idiom" : "watch", "idiom": "watch",
"filename" : "Icon58.png", "filename": "Icon58.png",
"role" : "companionSettings", "role": "companionSettings",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "29x29", "size": "29x29",
"idiom" : "watch", "idiom": "watch",
"filename" : "Icon87.png", "filename": "Icon87.png",
"role" : "companionSettings", "role": "companionSettings",
"scale" : "3x" "scale": "3x"
}, },
{ {
"size" : "40x40", "size": "40x40",
"idiom" : "watch", "idiom": "watch",
"scale" : "2x", "scale": "2x",
"filename" : "Icon80.png", "filename": "Icon80.png",
"role" : "appLauncher", "role": "appLauncher",
"subtype" : "38mm" "subtype": "38mm"
}, },
{ {
"size" : "44x44", "size": "44x44",
"idiom" : "watch", "idiom": "watch",
"scale" : "2x", "scale": "2x",
"filename" : "Icon88.png", "filename": "Icon88.png",
"role" : "longLook", "role": "longLook",
"subtype" : "42mm" "subtype": "42mm"
}, },
{ {
"size" : "86x86", "size": "86x86",
"idiom" : "watch", "idiom": "watch",
"scale" : "2x", "scale": "2x",
"filename" : "Icon172.png", "filename": "Icon172.png",
"role" : "quickLook", "role": "quickLook",
"subtype" : "38mm" "subtype": "38mm"
}, },
{ {
"size" : "44x44", "size": "44x44",
"idiom" : "watch", "idiom": "watch",
"scale" : "2x", "scale": "2x",
"filename" : "Icon88.png", "filename": "Icon88.png",
"role" : "appLauncher", "role": "appLauncher",
"subtype" : "40mm" "subtype": "40mm"
}, },
{ {
"size" : "50x50", "size": "50x50",
"idiom" : "watch", "idiom": "watch",
"scale" : "2x", "scale": "2x",
"filename" : "Icon100.png", "filename": "Icon100.png",
"role" : "appLauncher", "role": "appLauncher",
"subtype" : "44mm" "subtype": "44mm"
}, },
{ {
"size" : "98x98", "size": "98x98",
"idiom" : "watch", "idiom": "watch",
"scale" : "2x", "scale": "2x",
"filename" : "Icon196.png", "filename": "Icon196.png",
"role" : "quickLook", "role": "quickLook",
"subtype" : "42mm" "subtype": "42mm"
}, },
{ {
"size" : "108x108", "size": "108x108",
"idiom" : "watch", "idiom": "watch",
"scale" : "2x", "scale": "2x",
"filename" : "Icon216.png", "filename": "Icon216.png",
"role" : "quickLook", "role": "quickLook",
"subtype" : "44mm" "subtype": "44mm"
}, },
{ {
"size" : "16x16", "size": "16x16",
"idiom" : "mac", "idiom": "mac",
"filename" : "Icon16.png", "filename": "Icon16.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"size" : "16x16", "size": "16x16",
"idiom" : "mac", "idiom": "mac",
"filename" : "Icon32.png", "filename": "Icon32.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "32x32", "size": "32x32",
"idiom" : "mac", "idiom": "mac",
"filename" : "Icon32.png", "filename": "Icon32.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"size" : "32x32", "size": "32x32",
"idiom" : "mac", "idiom": "mac",
"filename" : "Icon64.png", "filename": "Icon64.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "128x128", "size": "128x128",
"idiom" : "mac", "idiom": "mac",
"filename" : "Icon128.png", "filename": "Icon128.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"size" : "128x128", "size": "128x128",
"idiom" : "mac", "idiom": "mac",
"filename" : "Icon256.png", "filename": "Icon256.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "256x256", "size": "256x256",
"idiom" : "mac", "idiom": "mac",
"filename" : "Icon256.png", "filename": "Icon256.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"size" : "256x256", "size": "256x256",
"idiom" : "mac", "idiom": "mac",
"filename" : "Icon512.png", "filename": "Icon512.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size" : "512x512", "size": "512x512",
"idiom" : "mac", "idiom": "mac",
"filename" : "Icon512.png", "filename": "Icon512.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"size" : "512x512", "size": "512x512",
"idiom" : "mac", "idiom": "mac",
"filename" : "Icon1024.png", "filename": "Icon1024.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"size": "83.5x83.5", "size": "83.5x83.5",
@ -315,160 +315,160 @@ appicon_json = {
"scale": "2x" "scale": "2x"
}, },
{ {
"idiom" : "ios-marketing", "idiom": "ios-marketing",
"size" : "1024x1024", "size": "1024x1024",
"scale" : "1x", "scale": "1x",
"filename": "Icon1024.png" "filename": "Icon1024.png"
}, },
{ {
"idiom" : "watch-marketing", "idiom": "watch-marketing",
"size" : "1024x1024", "size": "1024x1024",
"scale" : "1x", "scale": "1x",
"filename": "Icon1024.png" "filename": "Icon1024.png"
}, },
], ],
"info" : { "info": {
"version" : 1, "version": 1,
"author" : "xcode" "author": "xcode"
}, },
# "properties" : { # "properties": {
# "pre-rendered" : True # "pre-rendered": True
# } # }
} }
launchimage_json = { launchimage_json = {
"images" : [ "images": [ # noqa: E121
{ {
"extent" : "full-screen", "extent": "full-screen",
"idiom" : "iphone", "idiom": "iphone",
"subtype" : "736h", "subtype": "736h",
"filename" : "Default1242x2208.png", "filename": "Default1242x2208.png",
"minimum-system-version" : "8.0", "minimum-system-version": "8.0",
"orientation" : "portrait", "orientation": "portrait",
"scale" : "3x" "scale": "3x"
}, },
{ {
"extent" : "full-screen", "extent": "full-screen",
"idiom" : "iphone", "idiom": "iphone",
"subtype" : "736h", "subtype": "736h",
"filename" : "Default2208x1242.png", "filename": "Default2208x1242.png",
"minimum-system-version" : "8.0", "minimum-system-version": "8.0",
"orientation" : "landscape", "orientation": "landscape",
"scale" : "3x" "scale": "3x"
}, },
{ {
"extent" : "full-screen", "extent": "full-screen",
"idiom" : "iphone", "idiom": "iphone",
"subtype" : "667h", "subtype": "667h",
"filename" : "Default750x1334.png", "filename": "Default750x1334.png",
"minimum-system-version" : "8.0", "minimum-system-version": "8.0",
"orientation" : "portrait", "orientation": "portrait",
"scale" : "2x" "scale": "2x"
}, },
{ {
"orientation" : "portrait", "orientation": "portrait",
"idiom" : "iphone", "idiom": "iphone",
"extent" : "full-screen", "extent": "full-screen",
"minimum-system-version" : "7.0", "minimum-system-version": "7.0",
"filename" : "Default640x960.png", "filename": "Default640x960.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"extent" : "full-screen", "extent": "full-screen",
"idiom" : "iphone", "idiom": "iphone",
"subtype" : "retina4", "subtype": "retina4",
"filename" : "Default640x1136.png", "filename": "Default640x1136.png",
"minimum-system-version" : "7.0", "minimum-system-version": "7.0",
"orientation" : "portrait", "orientation": "portrait",
"scale" : "2x" "scale": "2x"
}, },
{ {
"orientation" : "portrait", "orientation": "portrait",
"idiom" : "ipad", "idiom": "ipad",
"extent" : "full-screen", "extent": "full-screen",
"minimum-system-version" : "7.0", "minimum-system-version": "7.0",
"filename" : "Default768x1024.png", "filename": "Default768x1024.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"orientation" : "landscape", "orientation": "landscape",
"idiom" : "ipad", "idiom": "ipad",
"extent" : "full-screen", "extent": "full-screen",
"minimum-system-version" : "7.0", "minimum-system-version": "7.0",
"filename" : "Default1024x768.png", "filename": "Default1024x768.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"orientation" : "portrait", "orientation": "portrait",
"idiom" : "ipad", "idiom": "ipad",
"extent" : "full-screen", "extent": "full-screen",
"minimum-system-version" : "7.0", "minimum-system-version": "7.0",
"filename" : "Default1536x2048.png", "filename": "Default1536x2048.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"orientation" : "landscape", "orientation": "landscape",
"idiom" : "ipad", "idiom": "ipad",
"extent" : "full-screen", "extent": "full-screen",
"minimum-system-version" : "7.0", "minimum-system-version": "7.0",
"filename" : "Default2048x1536.png", "filename": "Default2048x1536.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"orientation" : "portrait", "orientation": "portrait",
"idiom" : "iphone", "idiom": "iphone",
"extent" : "full-screen", "extent": "full-screen",
"filename" : "Default320x480.png", "filename": "Default320x480.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"orientation" : "portrait", "orientation": "portrait",
"idiom" : "iphone", "idiom": "iphone",
"extent" : "full-screen", "extent": "full-screen",
"filename" : "Default640x960.png", "filename": "Default640x960.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"orientation" : "portrait", "orientation": "portrait",
"idiom" : "iphone", "idiom": "iphone",
"extent" : "full-screen", "extent": "full-screen",
"filename" : "Default640x1136.png", "filename": "Default640x1136.png",
"subtype" : "retina4", "subtype": "retina4",
"scale" : "2x" "scale": "2x"
}, },
{ {
"orientation" : "portrait", "orientation": "portrait",
"idiom" : "ipad", "idiom": "ipad",
"extent" : "full-screen", "extent": "full-screen",
"filename" : "Default768x1024.png", "filename": "Default768x1024.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"orientation" : "landscape", "orientation": "landscape",
"idiom" : "ipad", "idiom": "ipad",
"extent" : "full-screen", "extent": "full-screen",
"filename" : "Default1024x768.png", "filename": "Default1024x768.png",
"scale" : "1x" "scale": "1x"
}, },
{ {
"orientation" : "portrait", "orientation": "portrait",
"idiom" : "ipad", "idiom": "ipad",
"extent" : "full-screen", "extent": "full-screen",
"filename" : "Default1536x2048.png", "filename": "Default1536x2048.png",
"scale" : "2x" "scale": "2x"
}, },
{ {
"orientation" : "landscape", "orientation": "landscape",
"idiom" : "ipad", "idiom": "ipad",
"extent" : "full-screen", "extent": "full-screen",
"filename" : "Default2048x1536.png", "filename": "Default2048x1536.png",
"scale" : "2x" "scale": "2x"
}, },
], ],
"info" : { "info": {
"version" : 1, "version": 1,
"author" : "xcode" "author": "xcode"
} }
} }
@ -512,7 +512,7 @@ def icon(image_xcassets, image_fn):
# App - iOS 7,8 # App - iOS 7,8
# 60pt 2x,3x # 60pt 2x,3x
("180", None, "Icon180.png"), ("180", None, "Icon180.png"),
#("120", None, "Icon120.png # duplicate"), # ("120", None, "Icon120.png # duplicate"),
# iPad # iPad
# Notifications # Notifications
@ -522,13 +522,13 @@ def icon(image_xcassets, image_fn):
# iPad # iPad
# Settings iOS 5-8 # Settings iOS 5-8
#("58", None, "Icon58.png # duplicate"), # ("58", None, "Icon58.png # duplicate"),
#("29", "Icon58.png", "Icon29.png # duplicate"), # ("29", "Icon58.png", "Icon29.png # duplicate"),
# iPad # iPad
# Spotlight iOS 7,8 # Spotlight iOS 7,8
# 40pt 1x,2x # 40pt 1x,2x
#("80", None, "Icon80.png # duplicate"), # ("80", None, "Icon80.png # duplicate"),
("40", "Icon80.png", "Icon40.png"), ("40", "Icon80.png", "Icon40.png"),
# iPad # iPad
@ -558,7 +558,7 @@ def icon(image_xcassets, image_fn):
# CarPlay # CarPlay
# App iOS 8 # App iOS 8
# 120pt 1x # 120pt 1x
#("120", None, "Icon120.png # duplicate"), # ("120", None, "Icon120.png # duplicate"),
# Apple Watch # Apple Watch
@ -570,13 +570,13 @@ def icon(image_xcassets, image_fn):
# Apple Watch # Apple Watch
# Companion Settings # Companion Settings
# 29pt 2x,3x # 29pt 2x,3x
#("58", None, "Icon58.png # duplicate"), # ("58", None, "Icon58.png # duplicate"),
#("87", None, "Icon87.png # duplicate"), # ("87", None, "Icon87.png # duplicate"),
# Apple Watch # Apple Watch
# Home Screen (All) # Home Screen (All)
# Long Look (38mm) # Long Look (38mm)
#("80", None, "Icon80.png # duplicate"), # ("80", None, "Icon80.png # duplicate"),
# Apple Watch # Apple Watch
# Long Look (42mm) # Long Look (42mm)
@ -597,12 +597,12 @@ def icon(image_xcassets, image_fn):
# OS X # OS X
# 256pt 1x,2x # 256pt 1x,2x
#("512", "Icon1024.png", "Icon512.png # duplicate"), # ("512", "Icon1024.png", "Icon512.png # duplicate"),
("256", "Icon512.png", "Icon256.png"), ("256", "Icon512.png", "Icon256.png"),
# OS X # OS X
# 128pt 1x,2x # 128pt 1x,2x
#("256", "Icon512.png", "Icon256.png # duplicate"), # ("256", "Icon512.png", "Icon256.png # duplicate"),
("128", "Icon256.png", "Icon128.png"), ("128", "Icon256.png", "Icon128.png"),
# OS X # OS X
@ -612,7 +612,7 @@ def icon(image_xcassets, image_fn):
# OS X # OS X
# 16pt 1x,2x # 16pt 1x,2x
#("32", "Icon64.png", "Icon32.png # duplicate"), # ("32", "Icon64.png", "Icon32.png # duplicate"),
("16", "Icon32.png", "Icon16.png")) ("16", "Icon32.png", "Icon16.png"))
_generate("AppIcon.appiconset", image_xcassets, image_fn, options, icon=True) _generate("AppIcon.appiconset", image_xcassets, image_fn, options, icon=True)
@ -662,9 +662,9 @@ def _buildimage(in_fn, out_fn, size, padcolor=None):
# ensure the image fit in the destination size # ensure the image fit in the destination size
if im.size[0] > size[0] or im.size[1] > size[1]: if im.size[0] > size[0] or im.size[1] > size[1]:
f = max(im.size[0] / size[0], im.size[1] / size[1]) f = max(im.size[0] / size[0], im.size[1] / size[1])
newsize = int(im.size[0] / f), int(im.size[1] / f) newsize = int(im.size[0] / f), int(im.size[1] / f)
im = im.resize(newsize) im = im.resize(newsize)
# create final image # create final image
outim = Image.new("RGB", size, bgcolor[:3]) outim = Image.new("RGB", size, bgcolor[:3])

View file

@ -14,8 +14,6 @@ commands = flake8 kivy_ios/ tests/ .ci/ setup.py toolchain.py
[flake8] [flake8]
exclude = kivy_ios/tools/external/
ignore = ignore =
E123, # Closing bracket does not match indentation of opening bracket's line E123, # Closing bracket does not match indentation of opening bracket's line
E124, # Closing bracket does not match visual indentation E124, # Closing bracket does not match visual indentation