Ejemplo n.º 1
0
	def _filter_expired(self, model, tree_iter, _):
		if self.gobjects['checkbutton_show_expired'].get_active():
			return True
		expiration_ts = model[tree_iter][6]
		if not expiration_ts:
			return True
		if utilities.parse_datetime(expiration_ts) > datetime.datetime.now():
			return True
		return False
Ejemplo n.º 2
0
 def _filter_campaigns(self, model, tree_iter, _):
     expiration_ts = model[tree_iter][7]
     campaign_owner = model[tree_iter][5]
     username = self.config['server_username']
     if not self.filter_menu_items['your_campaigns'].get_active():
         if username == campaign_owner:
             return False
     if not self.filter_menu_items['other_campaigns'].get_active():
         if username != campaign_owner:
             return False
     if expiration_ts is None:
         return True
     if utilities.parse_datetime(expiration_ts) < datetime.datetime.now():
         if not self.filter_menu_items['expired_campaigns'].get_active():
             return False
     return True
Ejemplo n.º 3
0
	def _filter_campaigns(self, model, tree_iter, _):
		expiration_ts = model[tree_iter][7]
		campaign_owner = model[tree_iter][5]
		username = self.config['server_username']
		if not self.filter_menu_items['your_campaigns'].get_active():
			if username == campaign_owner:
				return False
		if not self.filter_menu_items['other_campaigns'].get_active():
			if username != campaign_owner:
				return False
		if expiration_ts is None:
			return True
		if utilities.parse_datetime(expiration_ts) < datetime.datetime.now():
			if not self.filter_menu_items['expired_campaigns'].get_active():
				return False
		return True