mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-09 17:00:12 +01:00
Add icon helper functions for later use
This commit is contained in:
parent
d94d67cd5b
commit
b5c0db9ecc
@ -34,6 +34,23 @@ import common, metadata
|
|||||||
from metadata import MetaDataException
|
from metadata import MetaDataException
|
||||||
from PIL import Image
|
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):
|
def update_wiki(apps, apks):
|
||||||
"""Update the wiki
|
"""Update the wiki
|
||||||
|
|
||||||
@ -677,7 +694,7 @@ def make_index(apps, apks, repodir, archive, categories):
|
|||||||
print output
|
print output
|
||||||
|
|
||||||
# Copy the repo icon into the repo directory...
|
# 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']))
|
iconfilename = os.path.join(icon_dir, os.path.basename(config['repo_icon']))
|
||||||
shutil.copyfile(config['repo_icon'], iconfilename)
|
shutil.copyfile(config['repo_icon'], iconfilename)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user