Exemple #1
0
    def __init__(self):

        log('main addon starting')

        # queue for communication with the comm and Main
        self.parent_queue = Queue.Queue()

        # create socket, listen for comms
        self.listener = comms.communicator(
            self.parent_queue, socket_file='/var/tmp/osmc.settings.sockfile')
        self.listener.start()

        # the gui is created and stored in memory for quick access
        # after a few hours, the gui should be removed from memory
        self.create_gui()
        self.gui_last_accessed = datetime.datetime.now()
        self.skip_check = True

        # monitor created to check for xbmc abort requests
        self.monitor = xbmc.Monitor()

        # current skin directory, used to detect when the user has changed skins and prompts a reconstruction of the gui
        self.skindir = xbmc.getSkinDir()

        # daemon
        self._daemon()

        log('_daemon exited')
	def __init__(self):

		# queue for communication with the comm and Main
		self.parent_queue = Queue.Queue()

		# create socket, listen for comms
		self.listener = comms.communicator(self.parent_queue)
		self.listener.start()

		# daemon
		self._daemon()
    def __init__(self):

        # queue for communication with the comm and Main
        self.parent_queue = Queue.Queue()

        # create socket, listen for comms
        self.listener = comms.communicator(self.parent_queue)
        self.listener.start()

        # daemon
        self._daemon()
Exemple #4
0
    def __init__(self):

        log('main addon starting')

        if not os.path.isfile('/walkthrough_completed'):
            # Tell Kodi that OSMC is running the walkthrough
            xbmc.setosmcwalkthroughstatus(1)
        else:
            # Tell Kodi that OSMC is done
            xbmc.setosmcwalkthroughstatus(2)

        # queue for communication with the comm and Main
        self.parent_queue = Queue.Queue()

        # create socket, listen for comms
        self.listener = comms.communicator(
            self.parent_queue, socket_file='/var/tmp/osmc.settings.sockfile')
        self.listener.start()

        # the gui is created and stored in memory for quick access
        # after a few hours, the gui should be removed from memory
        self.create_gui()
        self.gui_last_accessed = datetime.datetime.now()
        self.skip_check = True

        # monitor created to check for xbmc abort requests
        self.monitor = xbmc.Monitor()

        # current skin directory, used to detect when the user has changed skins and prompts a reconstruction of the gui
        self.skindir = xbmc.getSkinDir()

        # run the ubiquifonts script to import the needed fonts into the Font.xml
        response = ubiquifonts.import_osmc_fonts()

        if response == 'reload_please':

            log('Skin reload requested')

            xbmc.executebuiltin('ReloadSkin()')

        # daemon
        self._daemon()

        log('_daemon exited')
Exemple #5
0
	def __init__(self):

		log('main addon starting')

		if not os.path.isfile('/walkthrough_completed'):
			# Tell Kodi that OSMC is running the walkthrough
			xbmc.setosmcwalkthroughstatus(1)
		else:
                       # Tell Kodi that OSMC is done
                       xbmc.setosmcwalkthroughstatus(2)

		# queue for communication with the comm and Main
		self.parent_queue = Queue.Queue()

		# create socket, listen for comms
		self.listener = comms.communicator(self.parent_queue, socket_file='/var/tmp/osmc.settings.sockfile')
		self.listener.start()

		# the gui is created and stored in memory for quick access
		# after a few hours, the gui should be removed from memory
		self.create_gui()
		self.gui_last_accessed = datetime.datetime.now()
		self.skip_check = True

		# monitor created to check for xbmc abort requests
		self.monitor = xbmc.Monitor()

		# current skin directory, used to detect when the user has changed skins and prompts a reconstruction of the gui
		self.skindir = xbmc.getSkinDir()

		# run the ubiquifonts script to import the needed fonts into the Font.xml
		response = ubiquifonts.import_osmc_fonts()

		if response == 'reload_please':

			log('Skin reload requested')

			xbmc.executebuiltin('ReloadSkin()')
			
		# daemon
		self._daemon()

		log('_daemon exited')
	def __init__(self):

		# queue for communication with the comm and Main
		self.parent_queue = Queue.Queue()

		# create socket, listen for comms
		self.listener = comms.communicator(self.parent_queue, socket_file='/var/tmp/osmc.settings.sockfile')
		self.listener.start()

		# the gui is created and stored in memory for quick access
		# after a few hours, the gui should be removed from memory
		self.stored_gui = settings.OSMCGui(queue=self.parent_queue)
		self.gui_last_accessed = datetime.datetime.now()
		self.skip_check = True

		# monitor created to check for xbmc abort requests
		self.monitor = xbmc.Monitor()

		# daemon
		self._daemon()

		log('_daemon exited')
Exemple #7
0
    def __init__(self):

        # queue for communication with the comm and Main
        self.parent_queue = Queue.Queue()

        # create socket, listen for comms
        self.listener = comms.communicator(
            self.parent_queue, socket_file='/var/tmp/osmc.settings.sockfile')
        self.listener.start()

        # the gui is created and stored in memory for quick access
        # after a few hours, the gui should be removed from memory
        self.stored_gui = settings.OSMCGui(queue=self.parent_queue)
        self.gui_last_accessed = datetime.datetime.now()
        self.skip_check = True

        # monitor created to check for xbmc abort requests
        self.monitor = xbmc.Monitor()

        # daemon
        self._daemon()

        log('_daemon exited')
	def __init__(self):

		self.first_run = True

		# the time that the service started
		self.service_start = datetime.now()

		# dictionary containing the permissable actions (communicated from the child apt scripts) 
		# and the corresponding methods in the parent
		self.action_dict = 	{
								'apt_cache update complete' 		: self.apt_update_complete,
								'apt_cache update_manual complete'	: self.apt_update_manual_complete,
								'apt_cache commit complete'			: self.apt_commit_complete,
								'apt_cache fetch complete'			: self.apt_fetch_complete,
								'progress_bar'						: self.progress_bar,
								'update_settings'					: self.update_settings,
								'update_now'						: self.update_now,
								'user_update_now'					: self.user_update_now,
								'kill_yourself'						: self.kill_yourself,
								'settings_command'					: self.settings_command,
								'apt_error'							: self.apt_error,
								'action_list'						: self.action_list,
								'apt_cache action_list complete'	: self.action_list_complete,

							}

		# queue for communication with the comm and Main
		self.parent_queue = Queue.Queue()

		self.randomid = random.randint(0,1000)

		self.EXTERNAL_UPDATE_REQUIRED = 0

		# create socket, listen for comms
		self.listener = comms.communicator(self.parent_queue, socket_file='/var/tmp/osmc.settings.update.sockfile')
		self.listener.start()

		# grab the settings, saves them into a dict called seld.s
		self.update_settings()

		# a class to handle scheduling update checks
		self.scheduler = sched.SimpleScheduler(self.s)
		log(self.scheduler.trigger_time, 'trigger_time')

		# this holding pattern holds a function that represents the completion of a process that was put on hold
		# while the user was watching media or the system was active
		self.function_holding_pattern = False

		# monitor for identifying addon settings updates and kodi abort requests
		self.monitor = Monitah(parent_queue = self.parent_queue)

		# window onto which to paste the update notification
		self.window = xbmcgui.Window(10000)

		# property which determines whether the notification should be pasted to the window
		self.window.setProperty('OSMC_notification','false')

		# ControlImage(x, y, width, height, filename[, aspectRatio, colorDiffuse])
		self.update_image = xbmcgui.ControlImage(15, 55, 175, 75, __image_file__)
		self.position_icon()
		self.window.addControl(self.update_image)
		self.update_image.setVisibleCondition('[SubString(Window(Home).Property(OSMC_notification), true, left)]')

		# this flag is present when updates have been downloaded but the user wants to choose when to install using
		# the manual control in the settings
		self.block_update_file = '/var/tmp/.suppress_osmc_update_checks'
		
		# if the file is present, then suppress further update checks and show the notification
		if os.path.isfile(self.block_update_file):
			self.skip_update_check = True 

			# if the user has suppressed icon notification of updates and has chosen not to install the updates
			# its their own damned fault if osmc never get updated
			if not self.s['suppress_icon']:
				self.window.setProperty('OSMC_notification', 'true')

		else:

			self.skip_update_check =  False

		# check for the external update failed
		fail_check_file = '/var/tmp/.osmc_failed_update'
		if os.path.isfile(fail_check_file):
			with open(fail_check_file, 'r') as f:
				package = f.readline()

			ok = DIALOG.ok(lang(32087), lang(32088) % package, '', lang(32089))

			try:
				os.remove(fail_check_file)
			except:
				pass

		# keep alive method
		self._daemon()
Exemple #9
0
	def __init__(self):

		self.first_run = True

		# set the hardware prefix
		self.hw_prefix = get_hardware_prefix()

		# list of packages that require an external update
		self.EXTERNAL_UPDATE_REQUIRED_LIST = 	[
												"mediacenter",
												"lirc-osmc",
												"eventlircd-osmc",
												"libcec-osmc",
												"dbus",
												"dbus-x11"
												]

		# list of packages that may break compatibility with addons and databases.
		self.UPDATE_WARNING = False
		self.UPDATE_WARNING_LIST = 	[
									"-mediacenter-osmc",
									]

		# Items that start with a hyphen should have the hardware prefix attached
		self.UPDATE_WARNING_LIST = [(str(self.hw_prefix) + x) if x[0] =='-' else x for x in self.UPDATE_WARNING_LIST]
		log('UPDATE_WARNING_LIST: %s' % self.UPDATE_WARNING_LIST)

		# the time that the service started
		self.service_start = datetime.now()

		# dictionary containing the permissable actions (communicated from the child apt scripts) 
		# and the corresponding methods in the parent
		self.action_dict = 	{
								'apt_cache update complete' 		: self.apt_update_complete,
								'apt_cache update_manual complete'	: self.apt_update_manual_complete,
								'apt_cache commit complete'			: self.apt_commit_complete,
								'apt_cache fetch complete'			: self.apt_fetch_complete,
								'progress_bar'						: self.progress_bar,
								'update_settings'					: self.update_settings,
								'update_now'						: self.update_now,
								'user_update_now'					: self.user_update_now,
								'kill_yourself'						: self.kill_yourself,
								'settings_command'					: self.settings_command,
								'apt_error'							: self.apt_error,
								'apt_action_list_error'				: self.apt_action_list_error,
								'action_list'						: self.action_list,
								'apt_cache action_list complete'	: self.action_list_complete,
								'pre_backup_complete'				: self.pre_backup_complete, 

							}

		# queue for communication with the comm and Main
		self.parent_queue = Queue.Queue()

		self.randomid = random.randint(0,1000)

		self.EXTERNAL_UPDATE_REQUIRED = 1

		# create socket, listen for comms
		self.listener = comms.communicator(self.parent_queue, socket_file='/var/tmp/osmc.settings.update.sockfile')
		self.listener.start()

		# grab the settings, saves them into a dict called seld.s
		self.update_settings()

		# a class to handle scheduling update checks
		self.scheduler = sched.SimpleScheduler(self.s)
		log(self.scheduler.trigger_time, 'trigger_time')

		# this holding pattern holds a function that represents the completion of a process that was put on hold
		# while the user was watching media or the system was active
		self.function_holding_pattern = False

		# monitor for identifying addon settings updates and kodi abort requests
		self.monitor = Monitah(parent_queue = self.parent_queue)

		# window onto which to paste the update notification
		self.window = xbmcgui.Window(10000)

		# property which determines whether the notification should be pasted to the window
		self.window.setProperty('OSMC_notification','false')

		# ControlImage(x, y, width, height, filename[, aspectRatio, colorDiffuse])
		self.update_image = xbmcgui.ControlImage(50, 1695, 175, 75, __image_file__)
		self.try_image_position_again = False
		self.try_count = 0
		self.position_icon()
		self.window.addControl(self.update_image)
		self.update_image.setVisibleCondition('[SubString(Window(Home).Property(OSMC_notification), true, left)]')
		# self.window.setProperty('OSMC_notification', 'true')    # USE THIS TO TEST THE UPDATE_ICON

		# this flag is present when updates have been downloaded but the user wants to choose when to install using
		# the manual control in the settings
		self.block_update_file = '/var/tmp/.suppress_osmc_update_checks'
		
		# if the file is present, then suppress further update checks and show the notification
		if os.path.isfile(self.block_update_file):
			self.skip_update_check = True 

			# if the user has suppressed icon notification of updates and has chosen not to install the updates
			# its their own damned fault if osmc never get updated
			if not self.s['suppress_icon']:
				self.window.setProperty('OSMC_notification', 'true')

		else:

			self.skip_update_check =  False

		# check for the external update failed
		fail_check_file = '/var/tmp/.osmc_failed_update'
		if os.path.isfile(fail_check_file):
			with open(fail_check_file, 'r') as f:
				package = f.readline()

			ok = DIALOG.ok(lang(32087), lang(32088) % package, '', lang(32089))

			try:
				os.remove(fail_check_file)
			except:
				pass

		self.freespace_supressor = 172200
		self.freespace_remedy    = 'reboot' # change this to 'apt' to give the user the option to clean the apt files

		# keep alive method
		self._daemon()
Exemple #10
0
    def __init__(self):

        self.first_run = True

        # the time that the service started
        self.service_start = datetime.now()

        # dictionary containing the permissable actions (communicated from the child apt scripts)
        # and the corresponding methods in the parent
        self.action_dict = {
            'apt_cache update complete': self.apt_update_complete,
            'apt_cache commit complete': self.apt_commit_complete,
            'apt_cache fetch complete': self.apt_fetch_complete,
            'progress_bar': self.progress_bar,
            'update_settings': self.update_settings,
            'update_now': self.update_now,
            'user_update_now': self.user_update_now,
            'kill_yourself': self.kill_yourself,
            'settings_command': self.settings_command,
            'apt_error': self.apt_error,
            'action_list': self.action_list,
            'apt_cache action_list complete': self.action_list_complete,
        }

        # queue for communication with the comm and Main
        self.parent_queue = Queue.Queue()

        self.randomid = random.randint(0, 1000)

        self.EXTERNAL_UPDATE_REQUIRED = 0

        # create socket, listen for comms
        self.listener = comms.communicator(
            self.parent_queue,
            socket_file='/var/tmp/osmc.settings.update.sockfile')
        self.listener.start()

        # grab the settings, saves them into a dict called seld.s
        self.update_settings()

        # a class to handle scheduling update checks
        self.scheduler = sched.SimpleScheduler(self.s)
        log(self.scheduler.trigger_time, 'trigger_time')

        # this holding pattern holds a function that represents the completion of a process that was put on hold
        # while the user was watching media or the system was active
        self.function_holding_pattern = False

        # monitor for identifying addon settings updates and kodi abort requests
        self.monitor = Monitah(parent_queue=self.parent_queue)

        # window onto which to paste the update notification
        self.window = xbmcgui.Window(10000)

        # property which determines whether the notification should be pasted to the window
        self.window.setProperty('OSMC_notification', 'false')

        # ControlImage(x, y, width, height, filename[, aspectRatio, colorDiffuse])
        self.update_image = xbmcgui.ControlImage(15, 55, 175, 75,
                                                 __image_file__)
        self.position_icon()
        self.window.addControl(self.update_image)
        self.update_image.setVisibleCondition(
            '[SubString(Window(Home).Property(OSMC_notification), true, left)]'
        )

        # this flag is present when updates have been downloaded but the user wants to choose when to install using
        # the manual control in the settings
        self.block_update_file = '/var/tmp/.suppress_osmc_update_checks'

        # if the file is present, then suppress further update checks and show the notification
        if os.path.isfile(self.block_update_file):
            self.skip_update_check = True

            # if the user has suppressed icon notification of updates and has chosen not to install the updates
            # its their own damned fault if osmc never get updated
            if not self.s['suppress_icon']:
                self.window.setProperty('OSMC_notification', 'true')

        else:

            self.skip_update_check = False

        # check for the external update failed
        fail_check_file = '/var/tmp/.osmc_failed_update'
        if os.path.isfile(fail_check_file):
            with open(fail_check_file, 'r') as f:
                package = f.readline()

            ok = DIALOG.ok(lang(32087), lang(32088) % package, '', lang(32089))

            try:
                os.remove(fail_check_file)
            except:
                pass

        # a preliminary check for updates (for testing only)
        if self.s['check_onboot']:
            if not self.skip_update_check:
                self.boot_delay_passed = False
                self.function_holding_pattern = self.holding_pattern_boot_update
                log('boot update check put into holding pattern')

        # keep alive method
        self._daemon()
Exemple #11
0
	def __init__(self):

		self.first_run = True

		# set the hardware prefix
		self.hw_prefix = get_hardware_prefix()

		# list of packages that require an external update
		self.EXTERNAL_UPDATE_REQUIRED_LIST = 	[
												"mediacenter",
												"lirc-osmc",
												"eventlircd-osmc",
												"libcec-osmc",
												"dbus",
												"dbus-x11"
												]

		# list of packages that may break compatibility with addons and databases.
		self.UPDATE_WARNING = False
		self.UPDATE_WARNING_LIST = 	[
									"-mediacenter-osmc",
									]

		# Items that start with a hyphen should have the hardware prefix attached
		self.UPDATE_WARNING_LIST = [(str(self.hw_prefix) + x) if x[0] =='-' else x for x in self.UPDATE_WARNING_LIST]
		log('UPDATE_WARNING_LIST: %s' % self.UPDATE_WARNING_LIST)

		# the time that the service started
		self.service_start = datetime.now()

		# dictionary containing the permissable actions (communicated from the child apt scripts) 
		# and the corresponding methods in the parent
		self.action_dict = 	{
								'apt_cache update complete' 		: self.apt_update_complete,
								'apt_cache update_manual complete'	: self.apt_update_manual_complete,
								'apt_cache commit complete'			: self.apt_commit_complete,
								'apt_cache fetch complete'			: self.apt_fetch_complete,
								'progress_bar'						: self.progress_bar,
								'update_settings'					: self.update_settings,
								'update_now'						: self.update_now,
								'user_update_now'					: self.user_update_now,
								'kill_yourself'						: self.kill_yourself,
								'settings_command'					: self.settings_command,
								'apt_error'							: self.apt_error,
								'apt_action_list_error'				: self.apt_action_list_error,
								'action_list'						: self.action_list,
								'apt_cache action_list complete'	: self.action_list_complete,
								'pre_backup_complete'				: self.pre_backup_complete, 

							}

		# queue for communication with the comm and Main
		self.parent_queue = Queue.Queue()

		self.randomid = random.randint(0,1000)

		self.EXTERNAL_UPDATE_REQUIRED = 1

		# create socket, listen for comms
		self.listener = comms.communicator(self.parent_queue, socket_file='/var/tmp/osmc.settings.update.sockfile')
		self.listener.start()

		# grab the settings, saves them into a dict called seld.s
		self.update_settings()

		# a class to handle scheduling update checks
		self.scheduler = sched.SimpleScheduler(self.s)
		log(self.scheduler.trigger_time, 'trigger_time')

		# this holding pattern holds a function that represents the completion of a process that was put on hold
		# while the user was watching media or the system was active
		self.function_holding_pattern = False

		# monitor for identifying addon settings updates and kodi abort requests
		self.monitor = Monitah(parent_queue = self.parent_queue)

		# window onto which to paste the update notification
		self.window = xbmcgui.Window(10000)

		# property which determines whether the notification should be pasted to the window
		self.window.setProperty('OSMC_notification','false')

		# ControlImage(x, y, width, height, filename[, aspectRatio, colorDiffuse])
		self.update_image = xbmcgui.ControlImage(50, 1695, 175, 75, __image_file__)
		self.try_image_position_again = False
		self.try_count = 0
		self.position_icon()
		self.window.addControl(self.update_image)
		self.update_image.setVisibleCondition('[String.Contains(Window(Home).Property(OSMC_notification), true)]')
		# self.window.setProperty('OSMC_notification', 'true')    # USE THIS TO TEST THE UPDATE_ICON

		# this flag is present when updates have been downloaded but the user wants to choose when to install using
		# the manual control in the settings
		self.block_update_file = '/var/tmp/.suppress_osmc_update_checks'
		
		# if the file is present, then suppress further update checks and show the notification
		if os.path.isfile(self.block_update_file):
			self.skip_update_check = True 

			# if the user has suppressed icon notification of updates and has chosen not to install the updates
			# its their own damned fault if osmc never get updated
			if not self.s['suppress_icon']:
				self.window.setProperty('OSMC_notification', 'true')

		else:

			self.skip_update_check =  False

		# check for the external update failed
		fail_check_file = '/var/tmp/.osmc_failed_update'
		if os.path.isfile(fail_check_file):
			with open(fail_check_file, 'r') as f:
				package = f.readline()

			ok = DIALOG.ok(lang(32087), lang(32088) % package, '', lang(32089))

			try:
				os.remove(fail_check_file)
			except:
				pass

		self.freespace_supressor = 172200
		self.freespace_remedy    = 'reboot' # change this to 'apt' to give the user the option to clean the apt files

		# keep alive method
		self._daemon()
	def __init__(self):

		self.first_run = True

		# the time that the service started
		self.service_start = datetime.now()

		# dictionary containing the permissable actions (communicated from the child apt scripts) 
		# and the corresponding methods in the parent
		self.action_dict = 	{
								'apt_cache update complete' : self.apt_update_complete,
								'apt_cache commit complete' : self.apt_commit_complete,
								'apt_cache fetch complete'  : self.apt_fetch_complete,
								'progress_bar'				: self.progress_bar,
								'update_settings'			: self.update_settings,
								'update_now'				: self.update_now,
								'user_update_now'			: self.user_update_now,
								'kill_yourself'				: self.kill_yourself,
								'call_child_script'			: self.call_child_script,

							}

		# queue for communication with the comm and Main
		self.parent_queue = Queue.Queue()

		self.randomid = random.randint(0,1000)

		# create socket, listen for comms
		self.listener = comms.communicator(self.parent_queue, socket_file='/var/tmp/osmc.settings.update.sockfile')
		self.listener.start()

		# grab the settings, saves them into a dict called seld.s
		self.update_settings()

		# a class to handle scheduling update checks
		self.scheduler = sched.SimpleScheduler(self.s)
		log(self.scheduler.trigger_time, 'trigger_time')

		# this holding pattern holds a function that represents the completion of a process that was put on hold
		# while the user was watching media or the system was active
		self.function_holding_pattern = False

		# monitor for identifying addon settings updates and kodi abort requests
		self.monitor = Monitah(parent_queue = self.parent_queue)

		# window onto which to paste the update notification
		self.window = xbmcgui.Window(10000)

		# property which determines whether the notification should be pasted to the window
		self.window.setProperty('OSMC_notification','false')

		# ControlImage(x, y, width, height, filename[, aspectRatio, colorDiffuse])
		self.update_image = xbmcgui.ControlImage(15, 55, 175, 75, __image_file__)
		self.position_icon()
		self.window.addControl(self.update_image)
		self.update_image.setVisibleCondition('[SubString(Window(Home).Property(OSMC_notification), true, left)]')

		# this flag is present when updates have been downloaded but the user wants to reboot themselves manually via the settings
		# it is deleted using the 'setting_exit_install.py' script.
		self.block_update_file = '/var/tmp/.dont_install_downloaded_updates'
		if os.path.isfile(self.block_update_file):
			self.skip_update_check = True
		else:
			self.skip_update_check = False

		# a preliminary check for updates (for testing only)
		if self.s['check_onboot']:
			if not self.skip_update_check:
				self.function_holding_pattern = self.holding_pattern_boot_update
				log('boot update check put into holding pattern')

		# keep alive method
		self._daemon()