@receiver(dbsignals.post_save, sender=Webapp, dispatch_uid='webapp.pre_generate_apk')
def pre_generate_apk(sender=None, instance=None, **kw):
 if kw.get('raw'):
  return
 if (not getattr(settings, 'PRE_GENERATE_APKS', False)):
  log.info('[Webapp:{a}] APK pre-generation is disabled.'.format(a=instance.id))
  return
 from . import tasks
 generated = False
 if (instance.status in mkt.WEBAPPS_APPROVED_STATUSES):
  app_devs = set((d.id for d in instance.device_types))
  if ((mkt.DEVICE_MOBILE.id in app_devs) or (mkt.DEVICE_TABLET.id in app_devs)):
   tasks.pre_generate_apk.delay(instance.id)
   generated = True
 log.info('[Webapp:{a}] APK pre-generated? {result}'.format(a=instance.id, result=('YES' if generated else 'NO')))

@ receiver ( dbsignals . post_save , sender = Webapp , dispatch_uid = 'webapp.pre_generate_apk' ) def pre_generate_apk ( sender = None , instance = None , ** kw ) : if kw . get ( 'raw' ) : return if ( not getattr ( settings , 'PRE_GENERATE_APKS' , False ) ) : log . info ( '[Webapp:{a}] APK pre-generation is disabled.' . format ( a = instance . id ) ) return from . import tasks generated = False if ( instance . status in mkt . WEBAPPS_APPROVED_STATUSES ) : app_devs = set ( ( d . id for d in instance . device_types ) ) if ( ( mkt . DEVICE_MOBILE . id in app_devs ) or ( mkt . DEVICE_TABLET . id in app_devs ) ) : tasks . pre_generate_apk . delay ( instance . id ) generated = True log . info ( '[Webapp:{a}] APK pre-generated? {result}' . format ( a = instance . id , result = ( 'YES' if generated else 'NO' ) ) )
pre-generate an android apk for a public app .