From: Daniel Martí Date: Tue, 7 Jan 2014 10:16:58 +0000 (+0100) Subject: Add icon helper functions for later use X-Git-Tag: 0.1~23^2~35 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=d700b92e1da588a6de1b43324ea093c6da4f21d1;p=fdroidserver.git Add icon helper functions for later use --- diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 883bbb12..841b45b5 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -34,6 +34,23 @@ import common, metadata from metadata import MetaDataException from PIL import Image + +def get_densities(): + return [480, 320, 240, 160, 120] + +def launcher_size(density): + return (density * 48) / 160 + +def icon_dens_label(density): + return "icon-%s" % density + +def get_icon_dir(density): + return os.path.join(repodir, "icons-%s" % density) + +def get_icon_dirs(repodir): + for density in get_densities(): + yield get_icon_dir(density) + def update_wiki(apps, apks): """Update the wiki @@ -677,7 +694,7 @@ def make_index(apps, apks, repodir, archive, categories): print output # Copy the repo icon into the repo directory... - icon_dir=os.path.join(repodir ,'icons') + icon_dir = os.path.join(repodir ,'icons') iconfilename = os.path.join(icon_dir, os.path.basename(config['repo_icon'])) shutil.copyfile(config['repo_icon'], iconfilename)