Пример #1
0
def librarize(key):
  s3.add('macros', key, s3.getImg('potentialmacros', key))
  s3.delete('potentialmacros', key)
  pim = PotentialImageMacro.objects.get(key = key)
  pim.active = False
  im = ImageMacro.objects.create(key = key, name = name(pim.fullSizeLink))
  m = Meme.objects.get(threadLink = pim.threadLink)
  m.classification = im
  m.topDist = 0
  m.save()
Пример #2
0
def merge(macro, target):
  macroimg = s3.getImg('macros', macro.key)
  backedby = Meme.objects.filter(classification = macro).distinct().count()
  compute.merge(macroimg, target, backedby)
  s3.replace('macros', macro.key, macroimg)