mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-10-09 02:41:06 +03:00
fix PEP8 "E302 expected 2 blank lines, found 1"
This commit is contained in:
parent
2f2618e06c
commit
3f4f7a544b
16 changed files with 84 additions and 0 deletions
|
@ -37,25 +37,31 @@ import metadata
|
|||
from common import FDroidPopen
|
||||
from metadata import MetaDataException
|
||||
|
||||
|
||||
def get_densities():
|
||||
return ['640', '480', '320', '240', '160', '120']
|
||||
|
||||
|
||||
def dpi_to_px(density):
|
||||
return (int(density) * 48) / 160
|
||||
|
||||
|
||||
def px_to_dpi(px):
|
||||
return (int(px) * 160) / 48
|
||||
|
||||
|
||||
def get_icon_dir(repodir, density):
|
||||
if density is None:
|
||||
return os.path.join(repodir, "icons")
|
||||
return os.path.join(repodir, "icons-%s" % density)
|
||||
|
||||
|
||||
def get_icon_dirs(repodir):
|
||||
for density in get_densities():
|
||||
yield get_icon_dir(repodir, density)
|
||||
yield os.path.join(repodir, "icons")
|
||||
|
||||
|
||||
def update_wiki(apps, apks):
|
||||
"""Update the wiki
|
||||
|
||||
|
@ -257,6 +263,7 @@ def update_wiki(apps, apks):
|
|||
# Purge server cache to ensure counts are up to date
|
||||
site.pages['Repository Maintenance'].purge()
|
||||
|
||||
|
||||
def delete_disabled_builds(apps, apkcache, repodirs):
|
||||
"""Delete disabled build outputs.
|
||||
|
||||
|
@ -278,6 +285,7 @@ def delete_disabled_builds(apps, apkcache, repodirs):
|
|||
if apkfilename in apkcache:
|
||||
del apkcache[apkfilename]
|
||||
|
||||
|
||||
def resize_icon(iconpath, density):
|
||||
|
||||
if not os.path.isfile(iconpath):
|
||||
|
@ -300,6 +308,7 @@ def resize_icon(iconpath, density):
|
|||
except Exception, e:
|
||||
logging.error("Failed resizing {0} - {1}".format(iconpath, e))
|
||||
|
||||
|
||||
def resize_all_icons(repodirs):
|
||||
"""Resize all icons that exceed the max size
|
||||
|
||||
|
@ -312,6 +321,7 @@ def resize_all_icons(repodirs):
|
|||
for iconpath in glob.glob(icon_glob):
|
||||
resize_icon(iconpath, density)
|
||||
|
||||
|
||||
def scan_apks(apps, apkcache, repodir, knownapks):
|
||||
"""Scan the apks in the given repo directory.
|
||||
|
||||
|
@ -582,6 +592,7 @@ def scan_apks(apps, apkcache, repodir, knownapks):
|
|||
|
||||
repo_pubkey_fingerprint = None
|
||||
|
||||
|
||||
def make_index(apps, apks, repodir, archive, categories):
|
||||
"""Make a repo index.
|
||||
|
||||
|
@ -861,6 +872,7 @@ def archive_old_apks(apps, apks, archapks, repodir, archivedir, defaultkeepversi
|
|||
config = None
|
||||
options = None
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
global config, options
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue