Example #1
0
    def getDirDescription(self):
        text = _("Name:") + ' ' + self.name
        text1 = []
        if self.dir_size > -1:
            text1.append(realSize(self.dir_size, 3))
        if self.dir_count > 0:
            text1.append(str(self.dir_count) + ' ' + _("Directories"))
        if self.mov_count > 0:
            text1.append(str(self.mov_count) + ' ' + _("Movies"))

        if len(text1) > 0:
            text += "  (" + ", ".join(text1) + ")"
        text = [text]

        #mount_path = self.getmount()
        # TODO temporary disabled, performance issue on mass storage devices
        if config.AdvancedMovieSelection.show_diskusage.value and os.path.exists(
                self.dir_path):
            total, used, free = diskUsage(self.dir_path)
            #text.append(_("Media:") + ' ' + str(mount_path))
            text.append(_("Total:") + ' ' + realSize(total, 3))
            text.append(_("Used:") + ' ' + realSize(used, 3))
            text.append(_("Free:") + ' ' + realSize(free, 3))
            real_path = os.path.realpath(self.dir_path) + os.sep
            if self.dir_path != real_path:
                text.append(_("Symlink:") + ' ' + real_path)

        return "\n".join(text)
    def getDirDescription(self):
        text = _("Name:") + ' ' + self.name
        text1 = []
        if self.dir_size > -1:
            text1.append(realSize(self.dir_size, 3))
        if self.dir_count > 0:
            text1.append(str(self.dir_count) + ' ' + _("Directories"))
        if self.mov_count > 0:
            text1.append(str(self.mov_count) + ' ' + _("Movies"))

        if len(text1) > 0:
            text += "  (" + ", ".join(text1) + ")"
        text = [text]

        #mount_path = self.getmount()
        # TODO temporary disabled, performance issue on mass storage devices
        if config.AdvancedMovieSelection.show_diskusage.value and os.path.exists(self.dir_path):
            total, used, free = diskUsage(self.dir_path)
            #text.append(_("Media:") + ' ' + str(mount_path))
            text.append(_("Total:") + ' ' + realSize(total, 3))
            text.append(_("Used:") + ' ' + realSize(used, 3))
            text.append(_("Free:") + ' ' + realSize(free, 3))
            real_path = os.path.realpath(self.dir_path) + os.sep
            if self.dir_path != real_path:
                text.append(_("Symlink:") + ' ' + real_path)
        
        return "\n".join(text)
Example #3
0
	def update(self):
		try:
			total, used, free = diskUsage(self.path)
			if self.type == self.FREE:
				self.setText(("%s " + _("free diskspace")) % (realSize(free)))
			if self.type == self.USED:
				self.setText(("%s " + _("used diskspace")) % (realSize(used)))
			if self.type == self.SIZE:
				self.setText(("%s " + _("total diskspace")) % (realSize(total)))
		except OSError:
			return -1
Example #4
0
 def getDBDescription(self):
     text1 = []
     
     if self.dir_size > 0:
         text1.append(realSize(self.dir_size, 3))
     if self.dir_count > 0:
         text1.append(str(self.dir_count) + ' ' + _("Directories"))
     if self.mov_count > 0:
         text1.append(str(self.mov_count) + ' ' + _("Movies"))
         text1.append(str(self.mov_seen) + ' ' + _("seen"))
         text1.append(str(self.mov_count - self.mov_seen) + ' ' + _("new"))
     
     result = ", ".join(text1)
     if movieScanner.last_update:
         result += "\r\n" + _("Last update:") + ' ' + movieScanner.getLastUpdate()
     
     return result
 def getDBDescription(self):
     from MovieScanner import movieScanner
     self.dir_size = movieScanner.movielibrary.getSize()
     self.dir_count, self.mov_count = movieScanner.movielibrary.getFullCount()
     text1 = []
     
     if self.dir_size > -1:
         text1.append(realSize(self.dir_size, 3))
     if self.dir_count > 0:
         text1.append(str(self.dir_count) + ' ' + _("Directories"))
     if self.mov_count > 0:
         text1.append(str(self.mov_count) + ' ' + _("Movies"))
     
     result = ", ".join(text1)
     if movieScanner.last_update:
         result += "\r\n" + _("Last update:") + ' ' + movieScanner.getLastUpdate()
     
     return result
 def getDBDescription(self):
     from MovieScanner import movieScanner
     self.dir_size = movieScanner.movielibrary.getSize()
     self.dir_count, self.mov_count = movieScanner.movielibrary.getFullCount()
     text1 = []
     
     if self.dir_size > -1:
         text1.append(realSize(self.dir_size, 3))
     if self.dir_count > 0:
         text1.append(str(self.dir_count) + ' ' + _("Directories"))
     if self.mov_count > 0:
         text1.append(str(self.mov_count) + ' ' + _("Movies"))
     
     result = ", ".join(text1)
     if movieScanner.last_update:
         result += "\r\n" + _("Last update:") + ' ' + movieScanner.getLastUpdate()
     
     return result