Exemple #1
0
	def add_source(self, source, target):
		source = os.path.normpath(source)
		target = os.path.normpath(target)
		
		print "Adding %s to %s..." % (source, target)
		
		if not os.path.isdir(source):
			print "Wrong source %s." % source
			return
		
		if not os.path.isdir(target):
			print "Wrong target %s." % target
			return
		
		if source in self.backuplist.get_sources():
			print "The source %s already exists." % source
			return
		
		self.backuplist.add(source, target)
		backupsource = BackUpSource(source, target)
		backupsource.create()
		
		print "Completed."