<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def edit(self):
 		""" 		Edit the file 		"""

		self.changed = False
		with self:
			editor = self.get_editor()
			cmd = [editor, self.name]
			try:
				res = subprocess.call(cmd)
			except Exception as e:
				print("Error launching editor %(editor)s" % locals())
				print(e)
				return
			if res != 0:
				msg = '%(editor)s returned error status %(res)d' % locals()
				raise EditProcessException(msg)
			new_data = self.read()
			if new_data != self.data:
				self.changed = self._save_diff(self.data, new_data)
				self.data = new_data