예제 #1
0
	def post(self):
		producer = BaseProducer.load_producer_by_id(self.get_argument("sched_id"))
		if not producer:
			raise APIException("internal_error", "Producer ID %s not found." % self.get_argument("sched_id"))
		db.c.update("UPDATE r4_schedule SET sched_url = %s WHERE sched_id = %s", (self.get_argument("url"), self.get_argument("sched_id")))
		if self.get_argument("url"):
			self.append_standard("success", "Producer URL changed to '%s'." % self.get_argument("url"))
		else:
			self.append_standard("success", "Producer URL removed.")
예제 #2
0
 def post(self):
     producer = BaseProducer.load_producer_by_id(
         self.get_argument("sched_id"))
     if not producer:
         raise APIException(
             "internal_error",
             "Producer ID %s not found." % self.get_argument("sched_id"))
     new_producer = producer.duplicate()
     self.append(self.return_name, new_producer.to_dict())
예제 #3
0
 def post(self):
     producer = BaseProducer.load_producer_by_id(
         self.get_argument("sched_id"))
     if not producer:
         raise APIException(
             "internal_error",
             "Producer ID %s not found." % self.get_argument("sched_id"))
     db.c.update("DELETE FROM r4_schedule WHERE sched_id = %s",
                 (self.get_argument("sched_id"), ))
     self.append_standard("success", "Producer deleted.")
예제 #4
0
 def post(self):
     producer = BaseProducer.load_producer_by_id(
         self.get_argument("sched_id"))
     if not producer:
         raise APIException(
             "internal_error",
             "Producer ID %s not found." % self.get_argument("sched_id"),
         )
     new_producer = producer.duplicate()
     new_producer.name += " Reprisal"
     start_eu = datetime.fromtimestamp(
         producer.start,
         timezone("UTC")).replace(tzinfo=timezone("Europe/London")).replace(
             hour=10, minute=0, second=0, microsecond=0) + timedelta(days=1)
     start_epoch_eu = int(
         (start_eu -
          datetime.fromtimestamp(0, timezone("UTC"))).total_seconds())
     new_producer.change_start(start_epoch_eu)
     db.c.update(
         "UPDATE r4_schedule SET sched_name = %s WHERE sched_id = %s",
         (new_producer.name, new_producer.id),
     )
     self.append(self.return_name, new_producer.to_dict())
예제 #5
0
 def post(self):
     producer = BaseProducer.load_producer_by_id(
         self.get_argument("sched_id"))
     producer.change_end(self.get_argument("utc_time"))
     self.append(self.return_name, producer.to_dict())
예제 #6
0
	def post(self):
		producer = BaseProducer.load_producer_by_id(self.get_argument("sched_id"))
		producer.change_end(self.get_argument("utc_time"))
		self.append(self.return_name, producer.to_dict())
예제 #7
0
	def post(self):
		producer = BaseProducer.load_producer_by_id(self.get_argument("sched_id"))
		if not producer:
			raise APIException("internal_error", "Producer ID %s not found." % self.get_argument("sched_id"))
		db.c.update("DELETE FROM r4_schedule WHERE sched_id = %s", (self.get_argument("sched_id"),))
		self.append_standard("success", "Producer deleted.")