예제 #1
0
	def __init__(self, main_window):

		"""
		desc:
			Constructor.

		arguments:
			main_window:	The main-window object.
		"""

		self.setup(main_window)
		self.main_window.set_status(_(u'Loading extensions'), timeout=None,
			status=u'busy')
		QtGui.QApplication.processEvents()
		self._extensions = []
		self.events = {}
		for ext_name in plugins.list_plugins(_type=u'extensions'):
			try:
				ext = plugins.load_extension(ext_name, self.main_window)
			except Exception as e:
				if not isinstance(e, osexception):
					e = osexception(msg=u'Extension error', exception=e)
				self.notify(
					u'Failed to load extension %s (see debug window for stack trace)' \
					% ext_name)
				self.main_window.print_debug_window(e)
			self._extensions.append(ext)
			for event in ext.supported_events():
				if event not in self.events:
					self.events[event] = []
				self.events[event].append(ext)
		self.main_window.set_status(_(u'Done'), status=u'ready')
예제 #2
0
	def __init__(self, main_window):

		"""
		desc:
			Constructor.

		arguments:
			main_window:	The main-window object.
		"""

		self.setup(main_window)
		self.main_window.set_busy()
		QtWidgets.QApplication.processEvents()
		self._extensions = []
		self.events = {}
		self._suspended = False
		self._suspended_until = None
		for ext_name in plugins.list_plugins(_type=u'extensions'):
			try:
				ext = plugins.load_extension(ext_name, self.main_window)
			except Exception as e:
				if not isinstance(e, osexception):
					e = osexception(msg=u'Extension error', exception=e)
				self.notify(
					u'Failed to load extension %s (see debug window for stack trace)' \
					% ext_name)
				self.console.write(e)
				continue
			self._extensions.append(ext)
			for event in ext.supported_events():
				if event not in self.events:
					self.events[event] = []
				self.events[event].append(ext)
		self.main_window.set_busy(False)
예제 #3
0
    def __init__(self, main_window):
        """
		desc:
			Constructor.

		arguments:
			main_window:	The main-window object.
		"""

        self.setup(main_window)
        self.main_window.set_status(_(u'Loading extensions'),
                                    timeout=None,
                                    status=u'busy')
        QtGui.QApplication.processEvents()
        self._extensions = []
        self.events = {}
        for ext_name in plugins.list_plugins(_type=u'extensions'):
            try:
                ext = plugins.load_extension(ext_name, self.main_window)
            except Exception as e:
                if not isinstance(e, osexception):
                    e = osexception(msg=u'Extension error', exception=e)
                self.notify(
                 u'Failed to load extension %s (see debug window for stack trace)' \
                 % ext_name)
                self.main_window.print_debug_window(e)
            self._extensions.append(ext)
            for event in ext.supported_events():
                if event not in self.events:
                    self.events[event] = []
                self.events[event].append(ext)
        self.main_window.set_status(_(u'Done'), status=u'ready')