コード例 #1
0
 def deleteCutFile(self, confirm):
     if confirm:
         file = self.service.getPath() + ".cuts"
         emcTasker.shellExecute('rm -f "' + file + '"')
         movieFileCache.delPathFromCache(
             os.path.dirname(self.service.getPath()))
     self.close("reload")
コード例 #2
0
	def remRogueFilesCB(self, confirmed):
		if confirmed:
			movieFileCache.delPathFromCache(self.currentPath)
			check = RogueFileCheck(self.currentPath)
			path = config.EMC.movie_trashcan_enable.value and config.EMC.movie_trashcan_path.value
			emcTasker.shellExecute( check.getScript(path) )
			self.session.open(MessageBox, check.getStatistics(), MessageBox.TYPE_INFO)
		self.close(None)
コード例 #3
0
	def deleteCutFile(self, confirm):
		if confirm:
			if os.path.isdir(self.service.getPath()):
				emcTasker.shellExecute('find ' + '"' + self.service.getPath() + '" -name "*.cuts" -exec rm -f \'{}\' +')
			else:
				file = self.service.getPath() + ".cuts"
				emcTasker.shellExecute('rm -f "' + file + '"')
				movieFileCache.delPathFromCache(os.path.dirname(self.service.getPath()))
		self.close("reload")
コード例 #4
0
	def addDirToEMCBookmarks(self, path):
		if path and self.addEMCBookmark( path ) \
			and (config.EMC.bookmarks.value == "Both" or config.EMC.bookmarks.value == "EMC") \
			and path == config.EMC.movie_homepath.value:
			#TODO Avoid reload
			# If the custom entry has sortingkeys, maybe an addService will do it
			movieFileCache.delPathFromCache(path)
			self.close("reload")
		else:
			self.close(None)
コード例 #5
0
	def removeDirFromEMCBookmarksConfirmed(self, path, confirm):
		if confirm \
			and path and self.removeEMCBookmark(path) \
			and (config.EMC.bookmarks.value == "Both" or config.EMC.bookmarks.value == "EMC") \
			and path == config.EMC.movie_homepath.value:
			#TODO Avoid reload
			# Just a remove service will do the job
			movieFileCache.delPathFromCache(path)
			self.close("reload")
		else:
			self.close(None)
コード例 #6
0
	def createDirCB(self, currentPath, name):
		if name is not None:
			name = os.path.join(currentPath, name)
			if os.path.exists(name):
				self.session.open(MessageBox, _("Directory %s already exists!") % (name), MessageBox.TYPE_ERROR)
			else:
				try:
					os.mkdir(name)
					movieFileCache.delPathFromCache(currentPath)
				except Exception, e:
					emcDebugOut("[EMCMM] createDir exception:\n" + str(e))
				self.close("reload")
コード例 #7
0
	def createLinkCB(self, currentPath, linkPath):
		if currentPath == linkPath or linkPath == None:
			self.close(None)
		else:
			try:
				movieFileCache.delPathFromCache(currentPath)
				movieFileCache.delPathFromCache(linkPath)
				name = os.path.basename(linkPath)
				cmd = 'ln -s "'+ linkPath +'" "'+ os.path.join(currentPath, name) +'"'
				if cmd != "":
					association = []
					association.append((self.mselection.reloadList))	# Force list reload after creating the link
					emcTasker.shellExecute(cmd, association)
			except Exception, e:
				emcDebugOut("[EMCMM] createLink exception:\n" + str(e))
			self.close(None)
コード例 #8
0
	def lockDirConfirmed(self, currentPath, locked, confirmed):
		if not locked:
			if confirmed:
				emcTasker.shellExecute('touch "' + currentPath + '/dir.lock"')
				movieFileCache.delPathFromCache(currentPath)
				for root, dirs, files in os.walk(currentPath):
					for dir in dirs:
						movieFileCache.delPathFromCache(root + '/' + dir)
						emcTasker.shellExecute('touch "' + root + '/' + dir +  '/dir.lock"')
		else:
			if confirmed:
				emcTasker.shellExecute('rm -f "' + currentPath + '/dir.lock"')
				movieFileCache.delPathFromCache(currentPath)
				for root, dirs, files in os.walk(currentPath):
					for dir in dirs:
						movieFileCache.delPathFromCache(root + '/' + dir)
						emcTasker.shellExecute('rm -rf "' + root + '/' + dir +  '/dir.lock"')
コード例 #9
0
	def deleteCutFile(self, confirm):
		if confirm:
			file = self.service.getPath() + ".cuts"
			emcTasker.shellExecute('rm -f "' + file + '"')		
			movieFileCache.delPathFromCache(os.path.dirname(self.service.getPath()))
		self.close("reload")