def _init_modules(*, args): """Initialize all 'modules' which need to be initialized. Args: args: The argparse namespace. """ log.init.debug("Initializing save manager...") save_manager = savemanager.SaveManager(q_app) objreg.register('save-manager', save_manager) quitter.instance.shutting_down.connect(save_manager.shutdown) configinit.late_init(save_manager) log.init.debug("Checking backend requirements...") backendproblem.init(args=args, save_manager=save_manager) log.init.debug("Initializing prompts...") prompt.init() log.init.debug("Initializing network...") networkmanager.init() log.init.debug("Initializing proxy...") proxy.init() quitter.instance.shutting_down.connect(proxy.shutdown) log.init.debug("Initializing downloads...") downloads.init() quitter.instance.shutting_down.connect(downloads.shutdown) try: log.init.debug("Initializing SQL...") sql.init(os.path.join(standarddir.data(), 'history.sqlite')) log.init.debug("Initializing web history...") history.init(q_app) except sql.KnownError as e: error.handle_fatal_exc(e, 'Error initializing SQL', pre_text='Error initializing SQL', no_err_windows=args.no_err_windows) sys.exit(usertypes.Exit.err_init) log.init.debug("Initializing command history...") cmdhistory.init() log.init.debug("Initializing sessions...") sessions.init(q_app) quitter.instance.shutting_down.connect(sessions.shutdown) log.init.debug("Initializing websettings...") websettings.init(args) quitter.instance.shutting_down.connect(websettings.shutdown) if not args.no_err_windows: crashsignal.crash_handler.display_faulthandler() log.init.debug("Initializing quickmarks...") quickmark_manager = urlmarks.QuickmarkManager(q_app) objreg.register('quickmark-manager', quickmark_manager) log.init.debug("Initializing bookmarks...") bookmark_manager = urlmarks.BookmarkManager(q_app) objreg.register('bookmark-manager', bookmark_manager) log.init.debug("Initializing cookies...") cookies.init(q_app) log.init.debug("Initializing cache...") cache.init(q_app) log.init.debug("Initializing downloads...") download_manager = qtnetworkdownloads.DownloadManager(parent=q_app) objreg.register('qtnetwork-download-manager', download_manager) log.init.debug("Initializing Greasemonkey...") greasemonkey.init() log.init.debug("Misc initialization...") macros.init() # Init backend-specific stuff browsertab.init()
def _init_modules(args, crash_handler): """Initialize all 'modules' which need to be initialized. Args: args: The argparse namespace. crash_handler: The CrashHandler instance. """ # pylint: disable=too-many-statements log.init.debug("Initializing prompts...") prompt.init() log.init.debug("Initializing save manager...") save_manager = savemanager.SaveManager(qApp) objreg.register('save-manager', save_manager) save_manager.add_saveable('version', _save_version) log.init.debug("Initializing network...") networkmanager.init() if qtutils.version_check('5.8'): # Otherwise we can only initialize it for QtWebKit because of crashes log.init.debug("Initializing proxy...") proxy.init() log.init.debug("Initializing readline-bridge...") readline_bridge = readline.ReadlineBridge() objreg.register('readline-bridge', readline_bridge) log.init.debug("Initializing config...") config.init(qApp) save_manager.init_autosave() log.init.debug("Initializing web history...") history.init(qApp) log.init.debug("Initializing crashlog...") if not args.no_err_windows: crash_handler.handle_segfault() log.init.debug("Initializing sessions...") sessions.init(qApp) log.init.debug("Initializing websettings...") websettings.init(args) log.init.debug("Initializing adblock...") host_blocker = adblock.HostBlocker() host_blocker.read_hosts() objreg.register('host-blocker', host_blocker) log.init.debug("Initializing quickmarks...") quickmark_manager = urlmarks.QuickmarkManager(qApp) objreg.register('quickmark-manager', quickmark_manager) log.init.debug("Initializing bookmarks...") bookmark_manager = urlmarks.BookmarkManager(qApp) objreg.register('bookmark-manager', bookmark_manager) log.init.debug("Initializing cookies...") cookie_jar = cookies.CookieJar(qApp) ram_cookie_jar = cookies.RAMCookieJar(qApp) objreg.register('cookie-jar', cookie_jar) objreg.register('ram-cookie-jar', ram_cookie_jar) log.init.debug("Initializing cache...") diskcache = cache.DiskCache(standarddir.cache(), parent=qApp) objreg.register('cache', diskcache) log.init.debug("Initializing completions...") completionmodels.init() log.init.debug("Misc initialization...") if config.get('ui', 'hide-wayland-decoration'): os.environ['QT_WAYLAND_DISABLE_WINDOWDECORATION'] = '1' else: os.environ.pop('QT_WAYLAND_DISABLE_WINDOWDECORATION', None) macros.init() # Init backend-specific stuff browsertab.init()
def _init_modules(args, crash_handler): """Initialize all 'modules' which need to be initialized. Args: args: The argparse namespace. crash_handler: The CrashHandler instance. """ # pylint: disable=too-many-statements log.init.debug("Initializing save manager...") save_manager = savemanager.SaveManager(qApp) objreg.register('save-manager', save_manager) save_manager.add_saveable('version', _save_version) log.init.debug("Initializing network...") networkmanager.init() log.init.debug("Initializing readline-bridge...") readline_bridge = readline.ReadlineBridge() objreg.register('readline-bridge', readline_bridge) log.init.debug("Initializing directories...") standarddir.init(args) log.init.debug("Initializing config...") config.init(qApp) save_manager.init_autosave() log.init.debug("Initializing web history...") history.init(qApp) log.init.debug("Initializing crashlog...") if not args.no_err_windows: crash_handler.handle_segfault() log.init.debug("Initializing sessions...") sessions.init(qApp) log.init.debug("Initializing js-bridge...") js_bridge = qutescheme.JSBridge(qApp) objreg.register('js-bridge', js_bridge) log.init.debug("Initializing websettings...") websettings.init() log.init.debug("Initializing adblock...") host_blocker = adblock.HostBlocker() host_blocker.read_hosts() objreg.register('host-blocker', host_blocker) log.init.debug("Initializing quickmarks...") quickmark_manager = urlmarks.QuickmarkManager(qApp) objreg.register('quickmark-manager', quickmark_manager) log.init.debug("Initializing bookmarks...") bookmark_manager = urlmarks.BookmarkManager(qApp) objreg.register('bookmark-manager', bookmark_manager) log.init.debug("Initializing proxy...") proxy.init() log.init.debug("Initializing cookies...") cookie_jar = cookies.CookieJar(qApp) objreg.register('cookie-jar', cookie_jar) log.init.debug("Initializing cache...") diskcache = cache.DiskCache(standarddir.cache(), parent=qApp) objreg.register('cache', diskcache) log.init.debug("Initializing completions...") completionmodels.init() log.init.debug("Misc initialization...") if config.get('ui', 'hide-wayland-decoration'): os.environ['QT_WAYLAND_DISABLE_WINDOWDECORATION'] = '1' else: os.environ.pop('QT_WAYLAND_DISABLE_WINDOWDECORATION', None) _maybe_hide_mouse_cursor() objreg.get('config').changed.connect(_maybe_hide_mouse_cursor)
def test_add_dupe(bm_file, fake_save_manager, qtbot): bm = urlmarks.BookmarkManager() bm.add(QUrl('http://example.com'), '') with pytest.raises(urlmarks.AlreadyExistsError): bm.add(QUrl('http://example.com'), '')
def _init_modules(args, crash_handler): """Initialize all 'modules' which need to be initialized. Args: args: The argparse namespace. crash_handler: The CrashHandler instance. """ log.init.debug("Initializing save manager...") save_manager = savemanager.SaveManager(qApp) objreg.register('save-manager', save_manager) configinit.late_init(save_manager) log.init.debug("Checking backend requirements...") backendproblem.init() log.init.debug("Initializing prompts...") prompt.init() log.init.debug("Initializing network...") networkmanager.init() log.init.debug("Initializing proxy...") proxy.init() log.init.debug("Initializing readline-bridge...") readline_bridge = readline.ReadlineBridge() objreg.register('readline-bridge', readline_bridge) try: log.init.debug("Initializing sql...") sql.init(os.path.join(standarddir.data(), 'history.sqlite')) log.init.debug("Initializing web history...") history.init(qApp) except sql.SqlEnvironmentError as e: error.handle_fatal_exc(e, args, 'Error initializing SQL', pre_text='Error initializing SQL') sys.exit(usertypes.Exit.err_init) log.init.debug("Initializing command history...") cmdhistory.init() log.init.debug("Initializing crashlog...") if not args.no_err_windows: crash_handler.handle_segfault() log.init.debug("Initializing sessions...") sessions.init(qApp) log.init.debug("Initializing websettings...") websettings.init(args) log.init.debug("Initializing adblock...") host_blocker = adblock.HostBlocker() host_blocker.read_hosts() objreg.register('host-blocker', host_blocker) log.init.debug("Initializing quickmarks...") quickmark_manager = urlmarks.QuickmarkManager(qApp) objreg.register('quickmark-manager', quickmark_manager) log.init.debug("Initializing bookmarks...") bookmark_manager = urlmarks.BookmarkManager(qApp) objreg.register('bookmark-manager', bookmark_manager) log.init.debug("Initializing cookies...") cookie_jar = cookies.CookieJar(qApp) ram_cookie_jar = cookies.RAMCookieJar(qApp) objreg.register('cookie-jar', cookie_jar) objreg.register('ram-cookie-jar', ram_cookie_jar) log.init.debug("Initializing cache...") diskcache = cache.DiskCache(standarddir.cache(), parent=qApp) objreg.register('cache', diskcache) log.init.debug("Initializing downloads...") download_manager = qtnetworkdownloads.DownloadManager(parent=qApp) objreg.register('qtnetwork-download-manager', download_manager) log.init.debug("Initializing Greasemonkey...") greasemonkey.init() log.init.debug("Misc initialization...") macros.init() # Init backend-specific stuff browsertab.init()
def _init_modules(*, args): """Initialize all 'modules' which need to be initialized. Args: args: The argparse namespace. """ log.init.debug("Initializing logging from config...") log.init_from_config(config.val) config.instance.changed.connect(_on_config_changed) log.init.debug("Initializing save manager...") save_manager = savemanager.SaveManager(objects.qapp) objreg.register('save-manager', save_manager) quitter.instance.shutting_down.connect(save_manager.shutdown) configinit.late_init(save_manager) log.init.debug("Checking backend requirements...") backendproblem.init(args=args, save_manager=save_manager) log.init.debug("Initializing prompts...") prompt.init() log.init.debug("Initializing network...") networkmanager.init() log.init.debug("Initializing proxy...") proxy.init() quitter.instance.shutting_down.connect(proxy.shutdown) log.init.debug("Initializing downloads...") downloads.init() quitter.instance.shutting_down.connect(downloads.shutdown) with debug.log_time("init", "Initializing SQL/history"): try: log.init.debug("Initializing web history...") history.init(db_path=pathlib.Path(standarddir.data()) / 'history.sqlite', parent=objects.qapp) except sql.KnownError as e: error.handle_fatal_exc(e, 'Error initializing SQL', pre_text='Error initializing SQL', no_err_windows=args.no_err_windows) sys.exit(usertypes.Exit.err_init) log.init.debug("Initializing command history...") cmdhistory.init() log.init.debug("Initializing websettings...") websettings.init(args) quitter.instance.shutting_down.connect(websettings.shutdown) log.init.debug("Initializing sessions...") sessions.init(objects.qapp) if not args.no_err_windows: crashsignal.crash_handler.display_faulthandler() log.init.debug("Initializing quickmarks...") quickmark_manager = urlmarks.QuickmarkManager(objects.qapp) objreg.register('quickmark-manager', quickmark_manager) log.init.debug("Initializing bookmarks...") bookmark_manager = urlmarks.BookmarkManager(objects.qapp) objreg.register('bookmark-manager', bookmark_manager) log.init.debug("Initializing cookies...") cookies.init(objects.qapp) log.init.debug("Initializing cache...") cache.init(objects.qapp) log.init.debug("Initializing downloads...") qtnetworkdownloads.init() log.init.debug("Initializing Greasemonkey...") greasemonkey.init() log.init.debug("Misc initialization...") macros.init() windowundo.init()
def _init_modules(args, crash_handler): """Initialize all 'modules' which need to be initialized. Args: args: The argparse namespace. crash_handler: The CrashHandler instance. """ # pylint: disable=too-many-statements log.init.debug("Initializing save manager...") save_manager = savemanager.SaveManager(qApp) objreg.register('save-manager', save_manager) configinit.late_init(save_manager) log.init.debug("Checking backend requirements...") backendproblem.init() log.init.debug("Initializing prompts...") prompt.init() log.init.debug("Initializing network...") networkmanager.init() log.init.debug("Initializing proxy...") proxy.init() log.init.debug("Initializing readline-bridge...") readline_bridge = readline.ReadlineBridge() objreg.register('readline-bridge', readline_bridge) log.init.debug("Initializing sql...") try: sql.init(os.path.join(standarddir.data(), 'history.sqlite')) except sql.SqlError as e: error.handle_fatal_exc(e, args, 'Error initializing SQL', pre_text='Error initializing SQL') sys.exit(usertypes.Exit.err_init) log.init.debug("Initializing completion...") completiondelegate.init() log.init.debug("Initializing command history...") cmdhistory.init() log.init.debug("Initializing web history...") history.init(qApp) log.init.debug("Initializing crashlog...") if not args.no_err_windows: crash_handler.handle_segfault() log.init.debug("Initializing sessions...") sessions.init(qApp) log.init.debug("Initializing websettings...") websettings.init(args) log.init.debug("Initializing adblock...") host_blocker = adblock.HostBlocker() host_blocker.read_hosts() objreg.register('host-blocker', host_blocker) log.init.debug("Initializing quickmarks...") quickmark_manager = urlmarks.QuickmarkManager(qApp) objreg.register('quickmark-manager', quickmark_manager) log.init.debug("Initializing bookmarks...") bookmark_manager = urlmarks.BookmarkManager(qApp) objreg.register('bookmark-manager', bookmark_manager) log.init.debug("Initializing cookies...") cookie_jar = cookies.CookieJar(qApp) ram_cookie_jar = cookies.RAMCookieJar(qApp) objreg.register('cookie-jar', cookie_jar) objreg.register('ram-cookie-jar', ram_cookie_jar) log.init.debug("Initializing cache...") diskcache = cache.DiskCache(standarddir.cache(), parent=qApp) objreg.register('cache', diskcache) log.init.debug("Misc initialization...") if config.val.window.hide_wayland_decoration: os.environ['QT_WAYLAND_DISABLE_WINDOWDECORATION'] = '1' else: os.environ.pop('QT_WAYLAND_DISABLE_WINDOWDECORATION', None) macros.init() # Init backend-specific stuff browsertab.init()