コード例 #1
0
ファイル: ginterface.py プロジェクト: yochai/rssgraber
	def downloader(self):
		"""This method does the actual running of the download_manager, smart download and all the rest.
		It is also following all the variables regarding safety. It is suppose to be called from the timer but can be called manually but what ever you do, you should call it through a thread or the interface will freeze."""
		if not self.files_under_usage and self.allow_download:
			#we can go on
			#we are working safe:
			self.stt_switch_button.config(state='disabled')
			self.stt_dl_now.config(state='disabled')
			self.files_under_usage = True
			#now let download
			self.__print_log__(self._('Initiating RSS check'))
			runner = download_manager(self.files_manager, report_all = True)
			runner.basic_download(False, silent = True)		
			if runner.report:
				self.__print_log__(self._('Downloaded the following torrent\s:'))
				for i in runner.report:
					for subi in i:
						self.__print_log__(subi)
			else:
				self.__print_log__(self._('found no new torrents'))
			self.sd.search_and_download(silent_report = True)
			for line in self.sd.report:
				self.__print_log__(line)
			self.__print_log__(self._('finished RSS check'))
			#lets clean up
			self.files_under_usage = False
			self.stt_switch_button.config(state='normal')
			self.stt_dl_now.config(state='normal')