Exemple #1
0
	def load_basic_data(self):
		"""This method just calls all, but just, the methods we need to collect the minimum needed information to initiate the interface."""
		sd = smart_download(self.files_manager)
		self.__load_feeds_list__()
		self.__load_sd_feeds_list__()
		self.__load_sd_shows_list__()
		self.__print_download_path__()
		self.__spin_timer__()
		self.__toggle_start_dl_at_on__()
		self.stts_print()
Exemple #2
0
	def __init__(self):
		#basic settings:
		if os.name == 'nt':
			self.main_folder = os.path.join(os.path.expanduser('~'), 'rssgraber')
		else:
			self.main_folder = os.path.join(os.getenv("HOME"), '.rssgraber')
		self.files_manager = files_manager(self.main_folder)
		self.sd = smart_download(self.files_manager)
		#some variables that are very much needed.
		self.files_under_usage = False #used to track usage of files (we can't have more then one...)
		self.allow_download = True #used to control an activation of downloads for torrents. If set to False no farther downloads will be initiated till it sets back to True
		self.download_intervals = self.__grab_time__()
		self.download_now = False #used to signal the program to download now.
		self.__temp_text_list__ = list() #the list of items in the temp_text system.
		#lets initiate gettext:
		t = gettext.translation('en', os.getenv("PWD"), fallback=True)
		self._ = t.gettext 
		#lets create the timer thread
		self.timer = threading.Thread(target=self.__timer__)
		self.timer.daemon = True
		self.timer.start()
		#lets initiate the main window and Tk.
		self.root = Tk()
		self.root.title("rssgraber")
		#first of all, lets gather the basic data..
		#lets paint the interface
		self.paint_interface()
		self.load_basic_data()
		self.stt_status_on_off(self.allow_download)
		#initiating help texts:
		feeds_tab_helps = {self.fo_dont_include:self._("A list of comma separated words that mustn't be in the name of the torrent for it to be downloaded."), self.fo_folder:self._("Download-to folder, leave empty to use default folder."), self.fo_must_include:self._("A list of comma separated words that must be in the name of the torrent for it to be downloaded."), self.fo_name:self._("The Feed's name."), self.fo_one_include:self._("A list of comma separated words that at-least one of them must be included in the name of the torrent for it be downloaded."), self.fo_regex:self._("A Quotation marks surrounded regex that torrent must follow (checking the torrent's name)."), self.fo_time:self._("Leave empty to use current time. The format is HH:MM:SS DD/MM/YYYY. Can be entered as DD/MM/YYYY or HH:MM DD/MM/YYYY."), self.fo_url:self._("The Feed's URL.")}
		sd_tab_helps = {self.sdo_cur_ep:self._("The episode for the show"), self.sdo_cur_sea:self._("The season of the show."), self.sdo_quality:self._("Takes a comma separated list of words that can't be included in the show name, ment to be used only for quality limits for future functions."), self.sdo_time:self._("The time of the source (there is really no need to set that).  The format is HH:MM:SS DD/MM/YYYY. Can be entered as DD/MM/YYYY or HH:MM DD/MM/YYYY."), self.sdo_url:self._("The URL of the source."), self.sdo_name:self._("The name of show or the source.")}
		opt_tab_helps = {self.opt_dl_at_turn_on:self._("Toggle it on to have the download process start right (1 minute ~) after you turn downloading on."), self.opt_intervals:self._("Chose how many minutes to wait between feed checks. Between 10 and 720 minutes."), self.opt_path:self._("Chose the default location for torrents.")}
		self.help_texts = dict(list(feeds_tab_helps.items()) + list(sd_tab_helps.items()) + list(opt_tab_helps.items()))
		self.help_floats = dict()
		#now lets bind the help floater.
		for field in self.help_texts:
			field.bind("<Enter>", self.__helper_enter__)
			field.bind("<Leave>", self.__left_helper__)
			field.bind("<<Pointer-pointed-2sec>>", self.__helper_pointed_at__)
		self.root.mainloop()