Beispiel #1
0
    def run(self, flux_id=None):

        if flux_id == None:
            try:
                flux_id = int(
                    input(
                        'Please insert the id of the show you want to download : '
                    ))
            except ValueError:
                print('Please insert an integer as show id')
                self.run()

        self.flux_mng = flux_manager()
        self.flux = self.flux_mng.get_by_id(flux_id)

        self.show_list = []
        XMLLoading = self.load_xml()

        if (XMLLoading):

            try:
                download_list = self.download_show_list()
                report = 'Download report for ' + self.flux.name + ': ' + download_list
                return [True, True, report, True]
            except Exception as e:
                print(e)
        else:
            return [True, False, 'Le flux n\'est pas accessible', True]
	def run(self, flux_id = None):

		if flux_id == None:
			try:
				flux_id = int(input('Please insert the id of the show you want to download : '))
			except ValueError:
				print('Please insert an integer as show id')
				self.run()

		self.flux_mng = flux_manager()		
		self.flux = self.flux_mng.get_by_id(flux_id)

		self.show_list = []
		XMLLoading = self.load_xml()
		
		if( XMLLoading):

			try :
				download_list = self.download_show_list()
				report = 'Download report for ' + self.flux.name + ': ' + download_list
				return [True, True, report, True]
			except Exception as e:
				print(e)
		else:
			return [True, False, 'Le flux n\'est pas accessible', True]
	def run(self):

		flux_id = int(input('Please insert the id of the show you want to update : '))

		flux_mng = flux_manager()
		flux = flux_mng.get_by_id(flux_id)

		return self.update_flux_infos(flux)
Beispiel #4
0
    def run(self):

        flux_id = int(
            input('Please insert the id of the show you want to update : '))

        flux_mng = flux_manager()
        flux = flux_mng.get_by_id(flux_id)

        return self.update_flux_infos(flux)
Beispiel #5
0
	def run(self):

		flux_id = input('Please enter show id : ')

		flux_mng = flux_manager()
		flux = flux_mng.get_by_id(flux_id)
		flux_mng.delete(flux.__dict__)

		return [True, True, '', True]
Beispiel #6
0
	def print_flux_list(self):

		flux_mng = flux_manager()
		flux_list = flux_mng.get_all()

		flux_list_string = ''

		for flux in flux_list:
			flux_list_string += '\n\t(' + str(flux.id) + ') - ' + flux.name + ' (last update : ' + flux.updated_date + ')'

		if flux_list_string == '':
			flux_list_string = '\n\tNo show available yet.'

		return flux_list_string
	def run(self):

		validation = input('You will lose every record of show or emission you have downloaded until now. Are you sure you want to proceed (y/n) ?')

		if validation.upper() == 'Y':
			flux_mng = flux_manager()
			flux_mng.flush()
			show_mng = show_manager()
			show_mng.flush()
			config_mng = config_manager()
			config_mng.flush()

			# TODO add new definition of daownload dir

		return [True, True, 'Database flushed.']
Beispiel #8
0
    def print_flux_list(self):

        flux_mng = flux_manager()
        flux_list = flux_mng.get_all()

        flux_list_string = ''

        for flux in flux_list:
            flux_list_string += '\n\t(' + str(
                flux.id
            ) + ') - ' + flux.name + ' (last update : ' + flux.updated_date + ')'

        if flux_list_string == '':
            flux_list_string = '\n\tNo show available yet.'

        return flux_list_string
Beispiel #9
0
    def run(self):

        self.flux_mng = flux_manager()
        self.flux_list = self.flux_mng.get_all()

        success = True
        clear = True
        report = ''
        show_flux_list = True

        for flux in self.flux_list:
            flux_downloader = flux_download()
            download_results = flux_downloader.run(
                flux.id)  #[True, True, str(flux.id), True]

            success = success and download_results[0]
            clear = success and download_results[1]
            report += download_results[2] + "\n\n"
            show_flux_list = success and download_results[3]

        return [success, clear, report, show_flux_list]
    def run(self):
        
        self.flux_mng = flux_manager()
        self.flux_list = self.flux_mng.get_all()
        
        success = True
        clear = True        
        report = ''
        show_flux_list = True
        
        for flux in self.flux_list:
            flux_downloader = flux_download()
            download_results = flux_downloader.run(flux.id) #[True, True, str(flux.id), True]
                       
            success = success and download_results[0]
            clear =  success and download_results[1]
            report += download_results[2] + "\n\n" 
            show_flux_list = success and download_results[3]
            
        return [success, clear, report, show_flux_list]