Esempio n. 1
0
 def _init_storage(self):
     storage_folder = self.config.get('general', 'storage_folder')
     if not storage_folder:
         storage_folder = os.path.join(USERDIR, 'Downloads')
     self.log.debug("Storage: {0}".format(storage_folder))
     makedirs(storage_folder)
     space_size = format.size(availspace(storage_folder))
     self.log.info(_("Available storage space: {0}").format(space_size))
Esempio n. 2
0
 def _init_storage(self):
     storage_folder = self.config.get('general', 'storage_folder')
     if not storage_folder:
         storage_folder = os.path.join(USERDIR, 'Downloads')
     self.log.debug("Storage: {0}".format(storage_folder))
     makedirs(storage_folder)
     space_size = format.size(availspace(storage_folder))
     self.log.info(_("Available storage space: {0}").format(space_size))
Esempio n. 3
0
    def work(self):
        """
        Main routine that does the periodical work.
        """
        self.try_reconnect()

        if (availspace(self.pyload.config.get('general', 'storage_folder')) <
                self.pyload.config.get('general', 'min_storage_size') << 20):
            self.pyload.log.warning(_("Not enough space left on device"))
            self.pause = True

        # if self.pause or not self.pyload.api.is_time_download():
        # return False
        if self.pause:
            return False

        # at least one thread want reconnect and we are supposed to wait
        if self.pyload.config.get('reconnect',
                                  'wait') and self.want_reconnect() > 1:
            return False

        self.assign_jobs()
Esempio n. 4
0
    def work(self):
        """
        Main routine that does the periodical work.
        """
        self.try_reconnect()

        if (availspace(self.pyload.config.get('general', 'storage_folder')) <
                self.pyload.config.get('general', 'min_storage_size') << 20):
            self.pyload.log.warning(_("Not enough space left on device"))
            self.pause = True

        # if self.pause or not self.pyload.api.is_time_download():
            # return False
        if self.pause:
            return False

        # at least one thread want reconnect and we are supposed to wait
        if self.pyload.config.get(
                'reconnect', 'wait') and self.want_reconnect() > 1:
            return False

        self.assign_jobs()
Esempio n. 5
0
 def avail_space(self):
     """
     Available free space at download directory in bytes.
     """
     return availspace(self.pyload.config.get('general', 'storage_folder'))
Esempio n. 6
0
 def avail_space(self):
     """
     Available free space at download directory in bytes.
     """
     return availspace(self.pyload.config.get('general', 'storage_folder'))