Index: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	(revision 171)
+++ trunk/ChangeLog	(revision 172)
@@ -21,4 +21,7 @@
 	  Implemented by: basv@sara.nl 
 
+	* Dropped support for version trac version 0.8. Removed all 0.8
+	  specific code. 
+	  Fixed by: basv@sara.nl 
 
 2007-04-27
Index: trunk/email2trac.py.in
===================================================================
--- trunk/email2trac.py.in	(revision 171)
+++ trunk/email2trac.py.in	(revision 172)
@@ -58,5 +58,5 @@
 	mailto_cc    : basv@sara.nl    # OPTIONAL, use this address as CC in mailto line
 	ticket_update: 1               # OPTIONAL, if set then check if this is an update for a ticket
-	trac_version : 0.8             # OPTIONAL, default is 0.10
+	trac_version : 0.9             # OPTIONAL, default is 0.10
 
 	[jouvin]                       # OPTIONAL project declaration, if set both fields necessary
@@ -117,8 +117,5 @@
 
 		self.VERSION = version
-		if self.VERSION == 0.8:
-			self.get_config = self.env.get_config
-		else:
-			self.get_config = self.env.config.get
+		self.get_config = self.env.config.get
 
 		if parameters.has_key('umask'):
@@ -317,8 +314,5 @@
 		# Look for email address in registered trac users
 		#
-		if self.VERSION == 0.8:
-			users = []
-		else:
-			users = [ u for (u, n, e) in self.env.get_known_users(self.db)
+		users = [ u for (u, n, e) in self.env.get_known_users(self.db)
 				if e == self.email_addr ]
 
@@ -470,6 +464,4 @@
 			return False
 
-		body_text = self.get_body_text(m)
-
 		# Must we update ticket fields
 		#
@@ -494,19 +486,18 @@
 		when = int(time.time())
 
-		if self.VERSION  == 0.8:
-			tkt = Ticket(self.db, ticket_id)
-			tkt.save_changes(self.db, self.author, body_text, when)
-		else:
-			try:
-				tkt = Ticket(self.env, ticket_id, self.db)
-			except util.TracError, detail:
-				return False
-
-			# Must we update some ticket fields properties
-			#
+		try:
+			tkt = Ticket(self.env, ticket_id, self.db)
+		except util.TracError, detail:
+			return False
+
+		# Must we update some ticket fields properties
+		#
+		if update_tkt_fields:
 			self.update_ticket_fields(tkt, update_tkt_fields)
 
-			tkt.save_changes(self.author, body_text, when)
-			tkt['id'] = ticket_id
+		body_text = self.get_body_text(m)
+
+		tkt.save_changes(self.author, body_text, when)
+		tkt['id'] = ticket_id
 
 		if self.VERSION  == 0.9:
@@ -569,9 +560,7 @@
 
 		when = int(time.time())
-		if self.VERSION == 0.8:
-			ticket_id = tkt.insert(self.db)
-		else:
-			ticket_id = tkt.insert()
-			tkt['id'] = ticket_id
+
+		ticket_id = tkt.insert()
+		tkt['id'] = ticket_id
 
 		changed = False
@@ -593,10 +582,6 @@
 
 		if changed:
-			if self.VERSION  == 0.8:
-				tkt.save_changes(self.db, self.author, comment)
-			else:
-				tkt.save_changes(self.author, comment)
-
-		#print tkt.get_changelog(self.db, when)
+			tkt.save_changes(self.author, comment)
+			#print tkt.get_changelog(self.db, when)
 
 		if self.notification:
@@ -848,12 +833,8 @@
 
 			url_filename = urllib.quote(filename)
-			if self.VERSION == 0.8:
-				dir = os.path.join(self.env.get_attachments_dir(), 'ticket', 
-				                    	urllib.quote(str(ticket['id'])))
-				if not os.path.exists(dir):
-					mkdir_p(dir, 0755)
-			else:
-				dir = '/tmp'
-
+			#
+			# Must be tuneables HvB
+			#
+			dir = '/tmp'
 			path, fd =  util.create_unique_file(os.path.join(dir, url_filename))
 			text = part.get_payload(decode=1)
@@ -879,41 +860,23 @@
 				count = count + 1
 					
-			# Insert the attachment it differs for the different TRAC versions
+			# Insert the attachment
 			# 
-			if self.VERSION == 0.8:
-				cursor = self.db.cursor()
-				try:
-					cursor.execute('INSERT INTO attachment VALUES("%s","%s","%s",%d,%d,"%s","%s","%s")' 
-						%('ticket', urllib.quote(str(ticket['id'])), filename + '?format=raw', file_size, 
-						int(time.time()),'', self.author, 'e-mail') ) 
-
-				# Attachment is already known
-				#
-				except sqlite.IntegrityError:	
-					#self.db.close()
-					return count
-
-				self.db.commit()
-
-			else:
-				fd = open(path)
-				att = attachment.Attachment(self.env, 'ticket', ticket['id'])
-
-				# This will break the ticket_update system, the body_text is vaporized
-				# ;-(
-				#
-				if not update:
-					att.author = self.author
-					att.description = self.email_to_unicode('Added by email2trac')
-
-				att.insert(url_filename, fd, file_size)
-
-				#except  util.TracError, detail:
-				#	print detail
-
-				fd.close()
+			fd = open(path)
+			att = attachment.Attachment(self.env, 'ticket', ticket['id'])
+
+			# This will break the ticket_update system, the body_text is vaporized
+			# ;-(
+			#
+			if not update:
+				att.author = self.author
+				att.description = self.email_to_unicode('Added by email2trac')
+
+			att.insert(url_filename, fd, file_size)
+			#except  util.TracError, detail:
+			#	print detail
 
 			# Remove the created temporary filename
 			#
+			fd.close()
 			os.unlink(path)
 
@@ -1020,12 +983,5 @@
 	
 	try:
-		if version == 0.8:
-			from trac.Environment import Environment
-			from trac.Ticket import Ticket
-			from trac.Notify import TicketNotifyEmail
-			from trac.Href import Href
-			from trac import util
-			import sqlite
-		elif version == 0.9:
+		if version == 0.9:
 			from trac import attachment 
 			from trac.env import Environment
