import os import os.path as osp import shutil # Third party imports from qtpy.QtCore import QSortFilterProxyModel, Qt, Signal, Slot from qtpy.QtWidgets import QAbstractItemView, QHeaderView, QMessageBox # Local imports from spyder.api.translations import get_translation from spyder.py3compat import to_text_string from spyder.utils import misc from spyder.plugins.explorer.widgets.explorer import DirView _ = get_translation('spyder') class ProxyModel(QSortFilterProxyModel): """Proxy model to filter tree view.""" PATHS_TO_HIDE = [ # Useful paths '.spyproject', '__pycache__', '.ipynb_checkpoints', # VCS paths '.git', '.hg', '.svn', # Others
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Copyright © 2020, Gonzalo Peña-Castellanos # # Licensed under the terms of the MIT license # ---------------------------------------------------------------------------- """ Spyder Boilerplate Preferences Page. """ # Third party imports from spyder.api.preferences import PluginConfigPage from spyder.api.translations import get_translation # Localization _ = get_translation("spyder_boilerplate.spyder") class SpyderBoilerplateConfPage(PluginConfigPage): # --- PluginConfigPage API # ------------------------------------------------------------------------ def setup_page(self): pass
# Third party imports from qtpy.QtCore import Qt, Slot from qtpy.QtWidgets import QMessageBox # Local imports from spyder.api.exceptions import SpyderAPIError from spyder.api.translations import get_translation from spyder.api.widgets.main_container import PluginMainContainer from spyder.plugins.layout.api import BaseGridLayoutType from spyder.plugins.layout.layouts import DefaultLayouts from spyder.plugins.layout.widgets.dialog import (LayoutSaveDialog, LayoutSettingsDialog) # Localization _ = get_translation("spyder") class LayoutContainerActions: DefaultLayout = 'default_layout_action' MatlabLayout = 'matlab_layout_action' RStudio = 'rstudio_layout_action' HorizontalSplit = 'horizontal_split_layout_action' VerticalSplit = 'vertical_split_layout_action' SaveLayoutAction = 'save_layout_action' ShowLayoutPreferencesAction = 'show_layout_preferences_action' ResetLayout = 'reset_layout_action' # Needs to have 'Maximize pane' as name to properly register # the action shortcut MaximizeCurrentDockwidget = 'Maximize pane' # Needs to have 'Fullscreen mode' as name to properly register
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Copyright © 2020, Gonzalo Peña-Castellanos # # Licensed under the terms of the MIT license # ---------------------------------------------------------------------------- """ Spyder Boilerplate Main Widget. """ # Third party imports from spyder.api.translations import get_translation from spyder.api.widgets import PluginMainWidget # Localization _ = get_translation('spyder_boilerplate.spyder') class SpyderBoilerplateWidget(PluginMainWidget): DEFAULT_OPTIONS = {} # Signals def __init__(self, name, plugin, parent=None, options=DEFAULT_OPTIONS): super().__init__(name, plugin, parent=parent, options=options) # --- PluginMainContainer API # ------------------------------------------------------------------------ def get_title(self): return _("Spyder Boilerplate")
# Licensed under the terms of the MIT License # ---------------------------------------------------------------------------- """ Python QtScreenCaster Spyder Widgets. """ # Third party imports from qtpy.QtWidgets import QVBoxLayout, QWidget from spyder.api.translations import get_translation from spyder.api.widgets.status import StatusBarWidget # Local imports from QScreenCast import ScreenCastToolButton # Localization _ = get_translation('qscreencast.spyder') # TODO: Change to use the base status widget not yet available class ScreenCastStatusWidget(StatusBarWidget): ID = 'screen_caster' CUSTOM_WIDGET_CLASS = ScreenCastToolButton def __init__(self, parent, main_window): super().__init__(parent, show_icon=False, show_label=False) self.custom_widget.setup(main_window) def start_recording(self): pass def stop_recording(self):
# Copyright © Tom Hören # # Licensed under the terms of the MIT License # ---------------------------------------------------------------------------- # Third party imports from qtpy.QtCore import QPoint, QSize, Signal from qtpy.QtGui import QIcon from spyder.api.plugins import SpyderPluginV2, Plugins from spyder.api.translations import get_translation # Local imports from spyder_screencast.container import ScreenCastContainer # Localization _ = get_translation('spyder_screencast') class ScreenCast(SpyderPluginV2): NAME = 'screencast' CONF_SECTION = NAME CONTAINER_CLASS = ScreenCastContainer REQUIRES = [Plugins.StatusBar] # --- Signals sig_main_window_resized = Signal(QSize, QSize) sig_main_window_moved = Signal(QPoint, QPoint) sig_resize_main_window_requested = Signal(QSize) sig_move_main_window_requested = Signal(QPoint) def get_name(self):
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Copyright © {% now 'local', '%Y' %}, {{ cookiecutter.full_name }} # # Licensed under the terms of the {{ cookiecutter.open_source_license }} # ---------------------------------------------------------------------------- """ {{cookiecutter.project_name}} Preferences Page. """ from spyder.api.preferences import PluginConfigPage from spyder.api.translations import get_translation _ = get_translation("{{cookiecutter.project_package_name}}.spyder") class {{cookiecutter.project_name.replace(" ", "")}}ConfigPage(PluginConfigPage): # --- PluginConfigPage API # ------------------------------------------------------------------------ def setup_page(self): pass
# Copyright (c) Semi-ATE # Distributed under the terms of the MIT License """ Spyder Remote Container. """ from qtpy.QtCore import Signal from spyder.api.translations import get_translation from spyder.api.widgets.main_container import PluginMainContainer from spyder_remote_client.spyder.widgets import RemoteConsoleDialog # Localization _ = get_translation("spyder_remote_client") class SpyderRemoteContainer(PluginMainContainer): def __init__(self, name, plugin, parent=None): super().__init__(name, plugin, parent=parent) self._dialog = RemoteConsoleDialog(self) self._dialog.sig_connect_to_kernel.connect(self.sig_connect_to_kernel) self._dialog.setModal(True) # --- Signals # ------------------------------------------------------------------------ sig_connect_to_kernel = Signal(object) """ This signal is emitted with the json data to perform the connection to the remote spyder-kernel.