mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-09 17:00:12 +01:00
Add 640 dpi icons dir
This commit is contained in:
parent
3ecf0e4373
commit
242de2368a
@ -36,14 +36,11 @@ from PIL import Image
|
|||||||
|
|
||||||
|
|
||||||
def get_densities():
|
def get_densities():
|
||||||
return ['480', '320', '240', '160', '120']
|
return ['640', '480', '320', '240', '160', '120']
|
||||||
|
|
||||||
def launcher_size(density):
|
def launcher_size(density):
|
||||||
return (int(density) * 48) / 160
|
return (int(density) * 48) / 160
|
||||||
|
|
||||||
def icon_dens_label(density):
|
|
||||||
return "icon-%s" % density
|
|
||||||
|
|
||||||
def get_icon_dir(repodir, density):
|
def get_icon_dir(repodir, density):
|
||||||
if density is None:
|
if density is None:
|
||||||
return os.path.join(repodir, "icons")
|
return os.path.join(repodir, "icons")
|
||||||
@ -454,11 +451,12 @@ def scan_apks(apps, apkcache, repodir, knownapks):
|
|||||||
densities = get_densities()
|
densities = get_densities()
|
||||||
empty_densities = []
|
empty_densities = []
|
||||||
for density in densities:
|
for density in densities:
|
||||||
label = icon_dens_label(density)
|
|
||||||
if density not in thisinfo['icons_src']:
|
if density not in thisinfo['icons_src']:
|
||||||
empty_densities.append(density)
|
empty_densities.append(density)
|
||||||
continue
|
continue
|
||||||
apk = zipfile.ZipFile(apkfile, 'r')
|
apk = zipfile.ZipFile(apkfile, 'r')
|
||||||
|
if 'icons' not in thisinfo:
|
||||||
|
thisinfo['icons'] = {}
|
||||||
iconsrc = thisinfo['icons_src'][density]
|
iconsrc = thisinfo['icons_src'][density]
|
||||||
icon_dir = get_icon_dir(repodir, density)
|
icon_dir = get_icon_dir(repodir, density)
|
||||||
icondest = os.path.join(icon_dir, iconfilename)
|
icondest = os.path.join(icon_dir, iconfilename)
|
||||||
@ -467,11 +465,11 @@ def scan_apks(apps, apkcache, repodir, knownapks):
|
|||||||
iconfile = open(icondest, 'wb')
|
iconfile = open(icondest, 'wb')
|
||||||
iconfile.write(apk.read(iconsrc))
|
iconfile.write(apk.read(iconsrc))
|
||||||
iconfile.close()
|
iconfile.close()
|
||||||
thisinfo[label] = iconfilename
|
thisinfo['icons'][density] = iconfilename
|
||||||
|
|
||||||
except:
|
except:
|
||||||
print "WARNING: Error retrieving icon file"
|
print "WARNING: Error retrieving icon file"
|
||||||
del thisinfo[label]
|
del thisinfo['icons'][density]
|
||||||
del thisinfo['icons_src'][density]
|
del thisinfo['icons_src'][density]
|
||||||
empty_densities.append(density)
|
empty_densities.append(density)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user