Exemplo n.º 1
0
 def save_resource_edit_store_path(self, path):
     date = self.builder.get_object('calendar1').get_date()
     dated_for = calendar_to_datetime(date)
     line = self.day_detail_store[path]
     resource_id = line[0]
     subject = line[1]
     contact_id = line[2]
     tag_id = line[4]
     if contact_id == 0:
         contact_id = None
     if tag_id == 0:
         tag_id = None
     if resource_id == 0:
         self.cursor.execute(
             "INSERT INTO resources "
             "(subject, contact_id, tag_id, "
             "date_created, dated_for) "
             "VALUES (%s, %s, %s, %s, %s)",
             (subject, contact_id, tag_id, datetime.today(), dated_for))
     else:
         self.cursor.execute(
             "UPDATE resources "
             "SET (subject, contact_id, tag_id) = "
             "(%s, %s, %s) WHERE id = %s",
             (subject, contact_id, tag_id, resource_id))
     self.db.commit()
     self.builder.get_object('calendar1').emit('day-selected')
Exemplo n.º 2
0
	def calendar_day_selected (self, calendar):
		date_tuple = calendar.get_date()
		self.datetime = calendar_to_datetime(date_tuple)
		day_text = datetime_to_text(self.datetime)
		self.builder.get_object('entry8').set_text(day_text)
		morrow = self.datetime + timedelta(days = 1)
		morrow_string = str(morrow)[0:10]
		struct_time = time.strptime(morrow_string,"%Y-%m-%d")
		self.stop_time = time.mktime(struct_time)
		self.populate_employee_statistics ()
Exemplo n.º 3
0
 def day_selected(self, calendar):
     self.date_time = calendar_to_datetime(calendar.get_date())
     self.populate_day_detail_store()
Exemplo n.º 4
0
 def day_selected(self, calendar):
     self.date_time = calendar_to_datetime(calendar.get_date())
     date_formatted = datetime.strftime(self.date_time, "%B %Y")
     self.builder.get_object('date_label').set_text(date_formatted)
     self.populate_day_detail_store()
     self.populate_day_statistics()