home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2012 January / maximum-cd-2012-01.iso / DiscContents / digsby_setup.exe / lib / plugins / digsby_achievements / thresholds.pyo (.txt) < prev   
Encoding:
Python Compiled Bytecode  |  2011-10-05  |  1.5 KB  |  49 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  3.  
  4.  
  5. def static_threshold(threshold):
  6.     
  7.     def calc(i, v, r):
  8.         if threshold < threshold:
  9.             pass
  10.         elif threshold <= r:
  11.             return (threshold, True, None)
  12.         if r < threshold:
  13.             return (None, True, threshold)
  14.  
  15.     return calc
  16.  
  17.  
  18. def interval_threshold(threshold):
  19.     
  20.     def calc(i, v, r):
  21.         i = int(i / threshold)
  22.         r = int(r / threshold)
  23.         if i < r:
  24.             return (r * threshold, True, (r + 1) * threshold)
  25.         return (None, True, (r + 1) * threshold)
  26.  
  27.     return calc
  28.  
  29. interaction_thresholds = [
  30.     interval_threshold(50)]
  31. im_sent_thresholds = [
  32.     interval_threshold(500)]
  33. photo_thresholds = [ static_threshold(x) for x in [
  34.     50] ] + [
  35.     interval_threshold(100)]
  36. search_threshold = [
  37.     interval_threshold(3)]
  38. THRESHOLDS = {
  39.     'face_comment': interaction_thresholds,
  40.     'face_like': interaction_thresholds,
  41.     'face_post': interaction_thresholds,
  42.     'face_photo': photo_thresholds,
  43.     'mysp_post': interaction_thresholds,
  44.     'mysp_photo': photo_thresholds,
  45.     'twit_post': photo_thresholds,
  46.     'link_post': interaction_thresholds,
  47.     'im_sent': im_sent_thresholds,
  48.     'buddylist.search': search_threshold }
  49.