Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test():
from spyder.utils.qthelpers import qapplication
app = qapplication()
table = ShortcutsTable()
table.show()
app.exec_()
table.check_shortcuts()
def test():
"""Text editor demo"""
from spyder.utils.qthelpers import qapplication
_app = qapplication() # analysis:ignore
text = """01234567890123456789012345678901234567890123456789012345678901234567890123456789
dedekdh elkd ezd ekjd lekdj elkdfjelfjk e"""
dialog = TextEditor(text)
dialog.exec_()
dlg_text = dialog.get_value()
assert text == dlg_text
def test():
"""Run breakpoint widget test"""
from spyder.utils.qthelpers import qapplication
app = qapplication()
widget = BreakpointWidget(None)
widget.show()
sys.exit(app.exec_())
def test():
"""Run widget test"""
from spyder.utils.qthelpers import qapplication
app = qapplication()
widget = LineProfilerWidget(None)
widget.resize(800, 600)
widget.show()
widget.analyze(osp.normpath(osp.join(osp.dirname(__file__), os.pardir,
'tests/profiling_test_script.py')),
use_colors=True)
sys.exit(app.exec_())
def test():
from spyder.utils.qthelpers import qapplication
app = qapplication()
test = ProjectExplorerTest()
test.resize(250, 480)
test.show()
app.exec_()
def test():
"""Text editor demo"""
from spyder.utils.qthelpers import qapplication
_app = qapplication() # analysis:ignore
text = """01234567890123456789012345678901234567890123456789012345678901234567890123456789
dedekdh elkd ezd ekjd lekdj elkdfjelfjk e"""
dialog = TextEditor(text)
dialog.exec_()
dlg_text = dialog.get_value()
assert text == dlg_text
def editor_test():
"""Test Collections editor."""
from spyder.utils.qthelpers import qapplication
app = qapplication() #analysis:ignore
dialog = CollectionsEditor()
dialog.setup(get_test_data())
dialog.show()
app.exec_()
def test(): # pragma: no cover
"""Display recovery dialog for manual testing."""
import shutil
import tempfile
from spyder.utils.qthelpers import qapplication
app = qapplication()
tempdir = tempfile.mkdtemp()
unused, unused, autosave_mapping = make_temporary_files(tempdir)
dialog = RecoveryDialog(autosave_mapping)
dialog.exec_()
print('files_to_open =', dialog.files_to_open) # spyder: test-skip
shutil.rmtree(tempdir)
def initialize():
"""Initialize Qt, patching sys.exit and eventually setting up ETS"""
# This doesn't create our QApplication, just holds a reference to
# MAIN_APP, created above to show our splash screen as early as
# possible
app = qapplication()
# --- Set application icon
app.setWindowIcon(APP_ICON)
#----Monkey patching QApplication
class FakeQApplication(QApplication):
"""Spyder's fake QApplication"""
def __init__(self, args):
self = app # analysis:ignore
@staticmethod
def exec_():
"""Do nothing because the Qt mainloop is already running"""
pass
from qtpy import QtWidgets
QtWidgets.QApplication = FakeQApplication
def main():
"""Run Windows environment variable editor"""
from spyder.utils.qthelpers import qapplication
app = qapplication()
if os.name == 'nt':
dialog = WinUserEnvDialog()
else:
dialog = EnvDialog()
dialog.show()
app.exec_()