gnome-schedule r1115 - in branches/x-output-support: . src



Author: gauteh
Date: Fri Dec 12 19:34:29 2008
New Revision: 1115
URL: http://svn.gnome.org/viewvc/gnome-schedule?rev=1115&view=rev

Log:
still broken: crontab x-support almost finished

Added:
   branches/x-output-support/src/xwrapper.py
      - copied, changed from r1114, /branches/x-output-support/src/xwrapper.py.in
Removed:
   branches/x-output-support/src/xwrapper.py.in
Modified:
   branches/x-output-support/ChangeLog
   branches/x-output-support/configure.ac
   branches/x-output-support/src/Makefile.am
   branches/x-output-support/src/at.py
   branches/x-output-support/src/config.py.in
   branches/x-output-support/src/crontab.py
   branches/x-output-support/src/crontabEditor.py
   branches/x-output-support/src/mainWindow.py

Modified: branches/x-output-support/configure.ac
==============================================================================
--- branches/x-output-support/configure.ac	(original)
+++ branches/x-output-support/configure.ac	Fri Dec 12 19:34:29 2008
@@ -121,7 +121,6 @@
 src/config.py
 src/Makefile
 src/gnome-schedule
-src/xwrapper.py
 icons/Makefile
 po/Makefile.in
 desktop/Makefile

Modified: branches/x-output-support/src/Makefile.am
==============================================================================
--- branches/x-output-support/src/Makefile.am	(original)
+++ branches/x-output-support/src/Makefile.am	Fri Dec 12 19:34:29 2008
@@ -32,8 +32,7 @@
 	config.py \
 	gnome-schedule.glade.bak \
 	gnome-schedule.gladep.bak \
-	gnome-schedule.gladep \
-	xwrapper.py
+	gnome-schedule.gladep 
 
 EXTRA_DIST =  \
 	$(bin_SCRIPTS) \

Modified: branches/x-output-support/src/at.py
==============================================================================
--- branches/x-output-support/src/at.py	(original)
+++ branches/x-output-support/src/at.py	Fri Dec 12 19:34:29 2008
@@ -139,7 +139,7 @@
 					class_id = m.groups ()[6]
 					user = m.groups ()[7]
 						
-					success, title, desc, manual_poscorrect, xoutput, display = self.get_job_data (int (job_id))
+					success, title, desc, manual_poscorrect = self.get_job_data (int (job_id))
 					# manual_poscorrect is only used during preparation of script
 
 					execute = config.getAtbin() + " -c " + job_id
@@ -162,7 +162,7 @@
 						else:
 							done = 1
 
-					return job_id, date, time, class_id, user, script, title, prelen, dangerous, xoutput, display
+					return job_id, date, time, class_id, user, script, title, prelen, dangerous
 					
 		elif (output == False):
 			if len (line) > 1 and line[0] != '#':
@@ -212,28 +212,15 @@
 					manual_poscorrect_b = True
 				elif manual_poscorrect == "false":
 					manual_poscorrect_b = False
-
-			if ver >= 4:
-				xoutput_str = d[8:d.find ("\n")]
-				if (xoutput_str == "0") or (xoutput_str == "1"):
-					xoutput = int (xoutput_str)
-					d = d[d.find ("\n") + 1:]
-				else:
-					xoutput = 0
-				
-				display = d[8:d.find ("\n")]
-				d = d[d.find ("\n") + 1:]
-				if (len (display) < 1) or (xoutput == 0):
-					display = ""
 			
 			fh.close ()
 			
-			return True, title, desc, manual_poscorrect_b, xoutput, display
+			return True, title, desc, manual_poscorrect_b
 			
 		else: 
 			return False, "", "", False, 0, ""
 			
-	def write_job_data (self, job_id, title, desc, xoutput, display):
+	def write_job_data (self, job_id, title, desc):
 		# Create and write data file
 		f = os.path.join (self.atdata, str(job_id))
 		#print f
@@ -249,8 +236,6 @@
 			fh.write ("manual_poscorrect=true\n")
 		else:
 			fh.write ("manual_poscorrect=false\n")
-		fh.write ("xoutput=" + str(xoutput) + "\n")
-		fh.write ("display=" + display + "\n")
 		fh.close ()
 		os.chown (f, self.uid, self.gid)
 		os.chmod (f, 0600)
@@ -380,7 +365,7 @@
 		return True, "ok"
 
 		
-	def append (self, runat, command, title, xoutput, display):
+	def append (self, runat, command, title):
 		tmpfile = tempfile.mkstemp ()
 		fd, path = tmpfile
 		tmp = os.fdopen(fd, 'w')
@@ -416,12 +401,12 @@
 		#print job_id
 		
 		desc = ""
-		self.write_job_data (job_id, title, desc, xoutput, display)
+		self.write_job_data (job_id, title, desc)
 		
 		os.unlink (path)
 
 
-	def update (self, job_id, runat, command, title, xoutput, display):
+	def update (self, job_id, runat, command, title):
 		#print "update" + str (job_id) + runat + command + title
 		#remove old
 		f = os.path.join (self.atdata, str (job_id))
@@ -464,7 +449,7 @@
 		#print job_id
 		
 		desc = ""
-		self.write_job_data (job_id, title, desc, xoutput, display)
+		self.write_job_data (job_id, title, desc)
 		
 		os.unlink (path)
 		
@@ -489,7 +474,7 @@
 			array_or_false = self.parse (line)
 			#print array_or_false
 			if array_or_false != False:
-				(job_id, date, time, class_id, user, lines, title, prelen, dangerous, xoutput, display) = array_or_false
+				(job_id, date, time, class_id, user, lines, title, prelen, dangerous) = array_or_false
 
 			
 				preview = self.__make_preview__ (lines, prelen)
@@ -506,12 +491,12 @@
 				# TODO: looks like it could be one append
 				if self.root == 1:
 					if self.user == user:
-						data.append([title, timestring_show, preview, lines, int(job_id), timestring, self, None, date, class_id, user, time, _("Once"), "at", self.nooutput, timestring, xoutput, display])
+						data.append([title, timestring_show, preview, lines, int(job_id), timestring, self, None, date, class_id, user, time, _("Once"), "at", self.nooutput, timestring])
 					else: 
 						#print "Record omitted, not current user"
 						pass
 				else:
-					data.append([title, timestring_show, preview, lines, int(job_id), timestring, self, None, date, class_id, user, time, _("Once"), "at", self.nooutput, timestring, xoutput, display])
+					data.append([title, timestring_show, preview, lines, int(job_id), timestring, self, None, date, class_id, user, time, _("Once"), "at", self.nooutput, timestring])
 
 				#print _("added %(id)s") % { "id": job_id	}
 			else:

Modified: branches/x-output-support/src/config.py.in
==============================================================================
--- branches/x-output-support/src/config.py.in	(original)
+++ branches/x-output-support/src/config.py.in	Fri Dec 12 19:34:29 2008
@@ -1,6 +1,8 @@
 version = "@VERSION@"
 image_dir = "@prefix@/share/pixmaps/gnome-schedule"
-glade_dir = "@prefix@/share/gnome-schedule"
+gs_dir = "@prefix@/share/gnome-schedule"
+glade_dir = gs_dir
+xwrapper_exec = "PYTHONPATH= PYTHONPATH@/gtk-2.0/:$PYTHONPATH @PYTHON@ @prefix@/share/gnome-schedule/xwrapper.py"
 locale_dir = "@prefix@/share/locale"
 crontabbin = "@CRONTAB_CONFIG@"
 atbin = "@AT_CONFIG@"

Modified: branches/x-output-support/src/crontab.py
==============================================================================
--- branches/x-output-support/src/crontab.py	(original)
+++ branches/x-output-support/src/crontab.py	Fri Dec 12 19:34:29 2008
@@ -36,7 +36,12 @@
 		self.set_rights(user,uid,gid, user_home_dir)
 		self.user_home_dir = user_home_dir
 		
-		self.nooutputtag = ">/dev/null 2>&1"
+		self.output = ["",
+						">/dev/null 2>&1",
+						config.gs_dir + "/xwrapper.py",
+						">/dev/null 2>&1",
+					  ]
+
 		self.crontabRecordRegex = re.compile('([^\s]+)\s([^\s]+)\s([^\s]+)\s([^\s]+)\s([^\s]+)\s([^#\n$]*)(\s#\s([^\n$]*)|$)')
 		self.__setup_timespec__()
 		self.env_vars = [ ]
@@ -224,22 +229,14 @@
 					raise ValueError("fixed", self.timenames[type], _("Must be between %(min)s and %(max)s") % { "min": min(timerange), "max": max(timerange) } )
 	
 
-	def update (self, minute, hour, day, month, weekday, command, linenumber, parentiter, nooutput, job_id, comment, title, desc, xoutput = 0, display = ""):
+	def update (self, minute, hour, day, month, weekday, command, linenumber, parentiter, output, job_id, comment, title, desc):
 		if self.check_command (command) == False:
 			return False
 			
 		# update crontab
-		if minute == "@reboot":
-			record = "@reboot " + command
-		else:
-			record = minute + " " + hour + " " + day + " " + month + " " + weekday + " " + command
-		#print "crontab:update:record=" + record
 		
 		easystring = self.__easy__ (minute, hour, day, month, weekday)
 
-		if nooutput:
-			record = record + " " + self.nooutputtag
-		
 		if comment:
 			record = record + " #" + comment
 		
@@ -270,8 +267,29 @@
 			os.chown (f, self.uid, self.gid)
 			os.chmod (f, 0600)					
 			
-			record = record + " # JOB_ID_" + str (job_id)
-			
+		record = command
+		display = "0"
+		if output == 1:
+			space = " "
+			if record[len(record)-1] == " ":
+				space = ""
+			record = record + space + self.output[1]
+		elif (output == 2) or (output == 3):
+			display = os.getenv ('DISPLAY')
+			if output == 3:
+				space = " " 
+				if record[len (record) - 1] == " ":
+					space = ""
+				record = record + space + self.output [3]
+
+			record = config.xwrapper_exec + " c " + str (job_id) + " " + record
+
+		if minute == "@reboot":
+			record = "@reboot " + record 
+		else:
+			record = minute + " " + hour + " " + day + " " + month + " " + weekday + " " + record 
+
+		record = record + " # JOB_ID_" + str (job_id)
 			
 		if title == None:
 			title = _("Untitled")
@@ -284,11 +302,7 @@
 		fh.write ("ver=" + str(self.crontabdatafileversion) + "\n")
 		fh.write ("title=" + title + "\n")
 		fh.write ("desc=" + desc + "\n")
-		if nooutput:
-			fh.write ("nooutput=1\n")
-		else:
-			fh.write ("nooutput=0\n")
-		fh.write ("xoutput=" + str(xoutput) + "\n")
+		fh.write ("output=" + str (output) + "\n")
 		fh.write ("display=" + display + "\n")	
 		fh.close ()	
 		os.chown (f, self.uid, self.gid)
@@ -318,21 +332,10 @@
 		self.__write__ ()
 		
 		
-	def append (self, minute, hour, day, month, weekday, command, nooutput, title, desc = None, xoutput = 0, display = ""):
+	def append (self, minute, hour, day, month, weekday, command, output, title, desc = None):
 		if self.check_command (command) == False:
 			return False
 			
-		if minute == "@reboot":
-			record = "@reboot " + command
-		else:
-			record = minute + " " + hour + " " + day + " " + month + " " + weekday + " " + command
-
-		if nooutput:
-			space = " "
-			if record[len(record)-1] == " ":
-				space = ""
-			record = record + space + self.nooutputtag
-			
 		if title == None:
 			title = _("Untitled")
 			
@@ -365,28 +368,43 @@
 		os.chown (f, self.uid, self.gid)
 		os.chmod (f, 0600)
 		
+		record = command
+		display = "0"
+		if output == 1:
+			space = " "
+			if record[len(record)-1] == " ":
+				space = ""
+			record = record + space + self.output[1]
+		elif (output == 2) or (output == 3):
+			display = os.getenv ('DISPLAY')
+			if output == 3:
+				space = " " 
+				if record[len (record) - 1] == " ":
+					space = ""
+				record = record + space + self.output [3]
+			record = config.xwrapper_exec + " c " + str (job_id) + " " + record
+
+		if minute == "@reboot":
+			record = "@reboot " + record
+		else:
+			record = minute + " " + hour + " " + day + " " + month + " " + weekday + " " + record 
+
+		record = record + " # JOB_ID_" + str (job_id)
+
+		self.lines.append (record)
+		
 		f = os.path.join (self.crontabdata, str(job_id))
-			
 		fh = open (f, 'w')
 		fh.truncate (1)
 		fh.seek (0)
 		fh.write ("ver=" + str(self.crontabdatafileversion) + "\n")
 		fh.write ("title=" + title + "\n")
 		fh.write ("desc=" + desc + "\n")
-		if nooutput:
-			fh.write ("nooutput=1\n")
-		else:
-			fh.write ("nooutput=0\n")
-		fh.write ("xoutput=" + str(xoutput) + "\n")
+		fh.write ("output=" + str(output) + "\n")
 		fh.write ("display=" + display + "\n")		
 		fh.close ()
 		os.chown (f, self.uid, self.gid)
 		os.chmod (f, 0600)
-				
-		record = record + " # JOB_ID_" + str (job_id)
-			
-		self.lines.append (record)
-		
 		# TODO: let write trow an exception if failed
 		self.__write__ ()
 		
@@ -428,7 +446,7 @@
 			array_or_false = self.parse (line)
 			if array_or_false != False:
 				if array_or_false[0] == 2:
-					(minute, hour, day, month, weekday, command, comment, job_id, title, desc, nooutput, xoutput, display) = array_or_false[1]
+					(minute, hour, day, month, weekday, command, comment, job_id, title, desc, output, display) = array_or_false[1]
 					
 					time = minute + " " + hour + " " + day + " " + month + " " + weekday
 
@@ -437,9 +455,9 @@
 				
 					#add task to treemodel in mainWindow
 					if minute == "@reboot":
-						data.append([title, self.__easy__ (minute, hour, day, month, weekday), preview, line, linecount, time, self, None, job_id, "", "","", _("Recurrent"), "crontab", nooutput, _("At reboot"), xoutput, display])
+						data.append([title, self.__easy__ (minute, hour, day, month, weekday), preview, line, linecount, time, self, None, job_id, "", "","", _("Recurrent"), "crontab", output, _("At reboot")])
 					else:
-						data.append([title, self.__easy__ (minute, hour, day, month, weekday), preview, line, linecount, time, self, None, job_id, "", "","", _("Recurrent"), "crontab", nooutput, time, xoutput, display])
+						data.append([title, self.__easy__ (minute, hour, day, month, weekday), preview, line, linecount, time, self, None, job_id, "", "","", _("Recurrent"), "crontab", output, time])
 				
 				
 			linecount = linecount + 1	
@@ -590,37 +608,39 @@
 		# Retrive title and icon data
 		if nofile == False:
 			if job_id:
-				success, ver, title, desc, nooutput, xoutput, display = self.get_job_data (job_id)
+				success, ver, title, desc, output, display = self.get_job_data (job_id)
 			else:
 				success = True
 				ver = 1
 				title = ""
 				desc = ""
-				nooutput = 0
-				xoutput = False
+				output = 0
 				display = ""
 			
-			if nooutput != 0:
+			if (output == 0) or (output == 3):
 				# remove devnull part of command
-				# searching reverse, and only if nooutput is saved in the datafile
-				pos = command.rfind (self.nooutputtag)
+				# searching reverse, and only if output is saved in the datafile
+				pos = command.rfind (self.output[1])
 				if pos != -1:
 					command = command[:pos]
+			if output == 2:
+				s = config.xwrapper_exec + " c " + str (job_id) + " "
+				command = command[len (s):]
 			
 			# support older datafiles/entries without removing the no output tag	
 			if ver <= 1:
 				# old version, no output declaration in datafile, migration
-				pos = command.rfind (self.nooutputtag)
+				pos = command.rfind (self.output[1])
 				if pos != -1:
 					command = command[:pos]
-					nooutput = 1
+					output = 1
 				else:
-					nooutput = 0
+					output = 0
 			
 			command = command.strip ()	
 				
 				
-			return [2, [minute, hour, dom, moy, dow, command, comment, job_id, title, desc, nooutput, xoutput, display]]
+			return [2, [minute, hour, dom, moy, dow, command, comment, job_id, title, desc, output, display]]
 		else:
 			return minute, hour, dom, moy, dow, command
 		
@@ -652,36 +672,26 @@
 			if ver >= 2:
 				nooutput_str = d[9:d.find ("\n")]
 				if (nooutput_str == "0") or (nooutput_str == "1"):
-					nooutput = int (nooutput_str)
+					output = int (nooutput_str)
 					d = d[d.find ("\n") + 1:]
 				else:
-					nooutput = 0
+					output = 0
 			else:
-				nooutput = 0
+				output = 0
 				
 			if ver >= 4:
-				xoutput_str = d[8:d.find ("\n")]
-				if (xoutput_str == "0") or (xoutput_str == "1"):
-					xoutput = int (xoutput_str)
-					d = d[d.find ("\n") + 1:]
-				else:
-					xoutput = 0
-				
 				display = d[8:d.find ("\n")]
 				d = d[d.find ("\n") + 1:]
-				if (len (display) < 1) or (xoutput == 0):
+				if (len (display) < 1) or (output == 0):
 					display = ""
 			
 			fh.close ()
 
-			return True, ver, title, desc, nooutput, xoutput, display
+			return True, ver, title, desc, output, display
 			
 			
 		else: 
 			return False, "", "", "", 0, 0, ""
-			
-			
-		
 				
 	def get_exp_sec (self, line):
 		line = line.lstrip ()

Modified: branches/x-output-support/src/crontabEditor.py
==============================================================================
--- branches/x-output-support/src/crontabEditor.py	(original)
+++ branches/x-output-support/src/crontabEditor.py	Fri Dec 12 19:34:29 2008
@@ -74,19 +74,17 @@
 		self.frequency_combobox_model.append([_("At reboot"), ["", "", "", "", "", "@reboot"]])
 		self.frequency_combobox.set_model (self.frequency_combobox_model)
 		
-		#self.cb_nooutput = self.xml.get_widget("cb_nooutput")
 		self.cb_output = self.xml.get_widget ("combo_output")
-		self.cb_o_model = gtk.ListStore (gobject.TYPE_STRING)
-		self.cb_o_model.append ([""])
-		self.cb_o_model.append ([_("Supress output")])
-		self.cb_o_model.append ([_("X application")])
-		self.cb_o_model.append ([_("X application: supress output")])
+		self.cb_o_model = gtk.ListStore (gobject.TYPE_STRING, gobject.TYPE_INT)
+		self.cb_o_model.append (["", 0])
+		self.cb_o_model.append ([_("Supress output"), 1])
+		self.cb_o_model.append ([_("X application"), 2])
+		self.cb_o_model.append ([_("X application: supress output"), 3])
 		self.cb_output.set_model (self.cb_o_model)
-		self.cb_output.show ()
+		cell = gtk.CellRendererText ()
+		self.cb_output.pack_start (cell, True)
+		self.cb_output.add_attribute (cell, "text", 0)
 
-				
-		#self.help_button = self.xml.get_widget ("cron_help_button")
-		
 		self.button_cancel = self.xml.get_widget ("button_cancel")
 		self.button_apply = self.xml.get_widget ("button_apply")
 		self.button_template = self.xml.get_widget ("button_template")
@@ -238,7 +236,7 @@
 		self.record = record
 		self.job_id = job_id
 		self.__reset__ ()
-		(self.minute, self.hour, self.day, self.month, self.weekday, self.command, self.comment, self.job_id, self.title, self.desc, self.output) = self.scheduler.parse (record)[1]
+		(self.minute, self.hour, self.day, self.month, self.weekday, self.command, self.comment, self.job_id, self.title, self.desc, self.output, display) = self.scheduler.parse (record)[1]
 		self.special = ""
 		if self.minute == "@reboot":
 			self.special = "@reboot"
@@ -263,7 +261,7 @@
 			self.rb_basic.set_active (True)
 			self.frequency_combobox.set_active (i)
 
-		self.cb_outpute.set_active (self.output)		
+		self.cb_output.set_active (self.output)		
 
 	def __reset__ (self):
 		self.noevents = True
@@ -317,25 +315,6 @@
 		except ValueError, ex:
 			raise ex
 
-	#TODO: Help button?
-	"""
-	def on_cron_help_button_clicked (self, *args):
-		try:
-			gnome.help_display_with_doc_id (
-					self.ParentClass.gprogram, '',
-					'gnome-schedule.xml',
-					'myapp-adding-recurrent')
-		except gobject.GError, error:
-			dialog = gtk.MessageDialog (
-					self.widget,
-					gtk.DIALOG_DESTROY_WITH_PARENT,
-					gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE)
-			dialog.set_markup ("<b>" + _("Could not display help") + "</b>")
-			dialog.format_secondary_text ("%s" % error)
-			dialog.run ()
-			dialog.destroy ()
-
-	"""
 	def on_editmode_toggled (self, widget, *args):
 		if widget.get_active() == True:
 			if self.noevents == False:

Modified: branches/x-output-support/src/mainWindow.py
==============================================================================
--- branches/x-output-support/src/mainWindow.py	(original)
+++ branches/x-output-support/src/mainWindow.py	Fri Dec 12 19:34:29 2008
@@ -195,15 +195,15 @@
 				
 		##inittializing the treeview and treemodel
 		## somethins not rite here..:
-		## [0 Title, 1 Frequency, 2 Command, 3 Crontab record, 4 ID, 5 Time, 6 Icon, 7 scheduled instance, 8 icon path, 9 date, 10 class_id, 11 user, 12 time, 13 type, 14 crontab/at, 15 advanced time string, 16 xoutput, 17 display]
+		## [0 Title, 1 Frequency, 2 Command, 3 Crontab record, 4 ID, 5 Time, 6 Icon, 7 scheduled instance, 8 icon path, 9 date, 10 class_id, 11 user, 12 time, 13 type, 14 crontab/at, 15 advanced time string]
 		##for at this would be like: 
 		
-# ["untitled", "12:50 2004-06-25", "preview", "script", "job_id", "12:50", icon, at instance, icon_path, "2004-06-25", "a", "drzap", "at", xoutput, display]
+# ["untitled", "12:50 2004-06-25", "preview", "script", "job_id", "12:50", icon, at instance, icon_path, "2004-06-25", "a", "drzap", "at"]
 
 		##for crontab it would be: 
 		
-# ["untitled", "every hour", "ls /", "0 * * * * ls / # untitled", "5", "0 * * * *", icon, crontab instance,icon_path, 1(job_id), "", "", "crontab", xoutput, display]
-		self.treemodel = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_INT, gobject.TYPE_STRING, gtk.gdk.Pixbuf, gobject.TYPE_PYOBJECT, gobject.TYPE_STRING , gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_INT, gobject.TYPE_STRING, gobject.TYPE_INT)
+# ["untitled", "every hour", "ls /", "0 * * * * ls / # untitled", "5", "0 * * * *", icon, crontab instance,icon_path, 1(job_id), "", "", "crontab"]
+		self.treemodel = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_INT, gobject.TYPE_STRING, gtk.gdk.Pixbuf, gobject.TYPE_PYOBJECT, gobject.TYPE_STRING , gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_INT, gobject.TYPE_STRING)
 		
 		self.treeview = self.xml.get_widget("treeview")
 		
@@ -305,12 +305,12 @@
 
 
 	def __fill__ (self, records):
-		for title, timestring_show, preview, lines, job_id, timestring, scheduler, icon, date, class_id, user, time, typetext, type, nooutput, timestring_advanced, xoutput, display in records:
+		for title, timestring_show, preview, lines, job_id, timestring, scheduler, icon, date, class_id, user, time, typetext, type, output, timestring_advanced in records:
 					
 			if scheduler.get_type() == "crontab":
-				iter = self.treemodel.append([title, timestring_show, preview, lines, job_id, timestring, self.iconcrontab, scheduler, icon, date, class_id, user, time, typetext, type, nooutput, timestring_advanced, xoutput, display])
+				iter = self.treemodel.append([title, timestring_show, preview, lines, job_id, timestring, self.iconcrontab, scheduler, icon, date, class_id, user, time, typetext, type, output, timestring_advanced])
 			elif scheduler.get_type() == "at":
-				iter = self.treemodel.append([title, timestring_show, preview, lines, job_id, timestring, self.iconat, scheduler, icon, date, class_id, user, time, typetext, type, nooutput, timestring_advanced, xoutput, display])
+				iter = self.treemodel.append([title, timestring_show, preview, lines, job_id, timestring, self.iconat, scheduler, icon, date, class_id, user, time, typetext, type, output, timestring_advanced])
 
 			
 		
@@ -532,7 +532,7 @@
 				self.editor.showedit (self.widget, record, linenumber, iter)
 
 		except Exception, ex:
-			#print ex
+			print ex
 			self.dialog = gtk.MessageDialog(self.widget, gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, _("Please select a task"))
 			self.dialog.run ()
 			self.dialog.destroy ()			

Copied: branches/x-output-support/src/xwrapper.py (from r1114, /branches/x-output-support/src/xwrapper.py.in)
==============================================================================
--- /branches/x-output-support/src/xwrapper.py.in	(original)
+++ branches/x-output-support/src/xwrapper.py	Fri Dec 12 19:34:29 2008
@@ -1,4 +1,3 @@
-#! @PYTHON@
 # xwrapper.py - wrapper around X applications
 # Copyright (C) 2004 - 2008  Gaute Hope <eg at gaute dot vetsj dot com>
 
@@ -83,7 +82,7 @@
 # get data
 if job_type == 0:
 	c = crontab.Crontab (is_root, user, uid, gid, home_dir)
-	success, ver, title, desc, nooutput, xoutput, display = c.get_job_data (job_id)
+	success, ver, title, desc, output, display = c.get_job_data (job_id)
 	if success == False:
 		print _("Could not get job data, the task might have been created with an old version - try recreating the task.")
 		sys.exit ()
@@ -93,8 +92,8 @@
 		sys.exit ()
 	
 	print _("Launching %s.." % title)
-	if (xoutput == 0):
-		print _("xoutput==0: Why am I launched?")
+	if (int (output) == 0):
+		print _("output==0: Why am I launched?")
 		sys.exit ()
 	if (len (display) < 2):
 		print _("len(display)<2: No proper DISPLAY variable")



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]