Exemple #1
0
 def send_event(cls, category, action, label = None, value = None):
     event_string = '5(' + category + '*' + action
     if label is not None:
         event_string += '*' + label
     event_string += ')'
     if value is not None:
         event_string += '(' + value + ')'
     perm_id = Session.get_instance().get_permid()
     perm_id = hashlib.md5(perm_id).hexdigest()
     domain_hash = long('0x' + perm_id[-8:], 16)
     visitor_id = long('0x' + perm_id[:8], 16)
     domain_hash /= 10
     visitor_id /= 10
     now = time.time()
     first_visit = long(now)
     prev_visit = long(now)
     current_visit = long(now)
     visit_number = 1
     cookie_string = '__utma=' + str(domain_hash) + '.' + str(visitor_id) + '.' + str(first_visit) + '.' + str(prev_visit) + '.' + str(current_visit) + '.' + str(visit_number) + ';'
     params = {'utmwv': cls.ANALYTICS_VERSION,
      'utmn': random.randint(1, sys.maxint),
      'utmt': 'event',
      'utme': event_string,
      'utmac': cls.ACCOUNT_ID,
      'utmcc': cookie_string}
     return cls.send_request(params)
Exemple #2
0
 def __init__(self):
     from ACEStream.Core.Session import Session
     self.session = Session.get_instance()
     self.peerdb = RePEXLogDB.getInstance()
     self.downloads = {}
     self.swarmcaches = {}
     self.repexers = {}
     RePEXer.attach_observer(self)
 def __init__(self):
     from ACEStream.Core.Session import Session
     self.session = Session.get_instance()
     self.peerdb = RePEXLogDB.getInstance()
     self.downloads = {}
     self.swarmcaches = {}
     self.repexers = {}
     RePEXer.attach_observer(self)
Exemple #4
0
 def __init__(self):
     if self.__single != None:
         raise RuntimeError, 'RePEXScheduler is singleton'
     from ACEStream.Core.Session import Session
     self.session = Session.get_instance()
     self.lock = RLock()
     self.active = False
     self.current_repex = None
     self.downloads = {}
     self.last_attempts = {}
 def __init__(self):
     if self.__single != None:
         raise RuntimeError, 'RePEXScheduler is singleton'
     from ACEStream.Core.Session import Session
     self.session = Session.get_instance()
     self.lock = RLock()
     self.active = False
     self.current_repex = None
     self.downloads = {}
     self.last_attempts = {}
 def __init__(self):
     self.file = None
     self.path = os.path.join(Session.get_instance().get_state_dir(), 'udppuncture.log')
 def __init__(self):
     self.file = None
     self.path = os.path.join(Session.get_instance().get_state_dir(),
                              'udppuncture.log')