Skip to content

Commit

Permalink
Fixed comments and found some more links
Browse files Browse the repository at this point in the history
  • Loading branch information
oscargus committed Jul 6, 2019
1 parent 7a90a9a commit 4cc0791
Show file tree
Hide file tree
Showing 59 changed files with 224 additions and 198 deletions.
2 changes: 1 addition & 1 deletion bootstrap.py
Expand Up @@ -80,7 +80,7 @@
# --- Test environment for surprises

# Warn if Spyder is located on non-ASCII path
# See spyder-ide/spyder#812
# See spyder-ide/spyder#812.
try:
osp.join(DEVPATH, 'test')
except UnicodeDecodeError:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -128,7 +128,7 @@ def run(self):
#==============================================================================
# NOTE: the '[...]_win_post_install.py' script is installed even on non-Windows
# platforms due to a bug in pip installation process
# (see spyder-ide/spyder#1158)
# See spyder-ide/spyder#1158.
SCRIPTS = ['%s_win_post_install.py' % NAME]
if PY3 and sys.platform.startswith('linux'):
SCRIPTS.append('spyder3')
Expand Down
16 changes: 8 additions & 8 deletions spyder/app/mainwindow.py
Expand Up @@ -81,7 +81,7 @@
# Avoid a bug in Qt: https://bugreports.qt.io/browse/QTBUG-46720
from qtpy import QtWebEngineWidgets # analysis:ignore

# For spyder-ide/spyder#7447
# For spyder-ide/spyder#7447.
try:
from qtpy.QtQuick import QQuickWindow, QSGRendererInterface
except Exception:
Expand Down Expand Up @@ -552,7 +552,7 @@ def signal_handler(signum, frame=None):

# Server to open external files on a single instance
# This is needed in order to handle socket creation problems.
# See spyder-ide/spyder#4132
# See spyder-ide/spyder#4132.
if os.name == 'nt':
try:
self.open_files_server = socket.socket(socket.AF_INET,
Expand Down Expand Up @@ -1281,7 +1281,7 @@ def post_visible_setup(self):
was triggered"""
self.restore_scrollbar_position.emit()

# [Workaround for spyder-ide/spyder#880]
# Workaround for spyder-ide/spyder#880.
# QDockWidget objects are not painted if restored as floating
# windows, so we must dock them before showing the mainwindow,
# then set them again as floating windows here.
Expand Down Expand Up @@ -1358,7 +1358,7 @@ def post_visible_setup(self):
self.report_missing_dependencies()

# Raise the menuBar to the top of the main window widget's stack
# (Fixes spyder-ide/spyder#3887)
# Fixes spyder-ide/spyder#3887.
self.menuBar().raise_()
self.is_setting_up = False

Expand Down Expand Up @@ -1420,7 +1420,7 @@ def load_window_settings(self, prefix, default=False, section='main'):
pos = get_func(section, prefix+'position')

# It's necessary to verify if the window/position value is valid
# with the current screen. See spyder-ide/spyder#3748
# with the current screen. See spyder-ide/spyder#3748.
width = pos[0]
height = pos[1]
screen_shape = QApplication.desktop().geometry()
Expand Down Expand Up @@ -1467,7 +1467,7 @@ def set_window_settings(self, hexstate, window_size, prefs_dialog_size,
if hexstate:
self.restoreState( QByteArray().fromHex(
str(hexstate).encode('utf-8')) )
# [Workaround for spyder-ide/spyder#880]
# Workaround for spyder-ide/spyder#880.
# QDockWidget objects are not painted if restored as floating
# windows, so we must dock them before showing the mainwindow.
for widget in self.children():
Expand Down Expand Up @@ -2859,7 +2859,7 @@ def apply_settings(self):
"""Apply settings changed in 'Preferences' dialog box"""
qapp = QApplication.instance()
# Set 'gtk+' as the default theme in Gtk-based desktops
# Fixes spyder-ide/spyder#2036
# Fixes spyder-ide/spyder#2036.
if is_gtk_desktop() and ('GTK+' in QStyleFactory.keys()):
try:
qapp.setStyle('gtk+')
Expand Down Expand Up @@ -3026,7 +3026,7 @@ def start_open_files_server(self):
try:
req, dummy = self.open_files_server.accept()
except socket.error as e:
# Seespyder-ide/spyder#1275 for details on why errno EINTR is
# See spyder-ide/spyder#1275 for details on why errno EINTR is
# silently ignored here.
eintr = errno.WSAEINTR if os.name == 'nt' else errno.EINTR
# To avoid a traceback after closing on Windows
Expand Down
14 changes: 7 additions & 7 deletions spyder/app/start.py
Expand Up @@ -17,11 +17,11 @@
import time

# To prevent a race condition with ZMQ
# See spyder-ide/spyder#5324
# See spyder-ide/spyder#5324.
import zmq

# Load GL library to prevent segmentation faults on some Linux systems
# See spyder-ide/spyder#3226 and spyder-ide/spyder#3332
# See spyder-ide/spyder#3226 and spyder-ide/spyder#3332.
try:
ctypes.CDLL("libGL.so.1", mode=ctypes.RTLD_GLOBAL)
except:
Expand Down Expand Up @@ -120,8 +120,8 @@ def main():
os.environ['LC_ALL'] = LC_ALL

# Don't show useless warning in the terminal where Spyder
# was started
# See spyder-ide/spyder#3730
# was started.
# See spyder-ide/spyder#3730.
os.environ['EVENT_NOKQUEUE'] = '1'
else:
# Prevent our kernels to crash when Python fails to identify
Expand All @@ -131,7 +131,7 @@ def main():
from locale import getlocale
getlocale()
except ValueError:
# This can fail on Windows. See spyder-ide/spyder#6886
# This can fail on Windows. See spyder-ide/spyder#6886.
try:
os.environ['LANG'] = 'C'
os.environ['LC_ALL'] = 'C'
Expand Down Expand Up @@ -162,8 +162,8 @@ def main():
except:
# If locking fails because of errors in the lockfile
# module, try to remove a possibly stale spyder.lock.
# This is reported to solve all problems with
# lockfile (See spyder-ide/spyder#2363)
# This is reported to solve all problems with lockfile.
# See spyder-ide/spyder#2363.
try:
if os.name == 'nt':
if osp.isdir(lock_file):
Expand Down
8 changes: 4 additions & 4 deletions spyder/app/tests/test_mainwindow.py
Expand Up @@ -281,7 +281,7 @@ def test_filter_numpy_warning(main_window, qtbot):
values and the Variable Explorer option 'Show arrays min/man'
is on.
For spyder-ide/spyder#7063
For spyder-ide/spyder#7063.
"""
shell = main_window.ipyconsole.get_current_shellwidget()
control = shell._control
Expand Down Expand Up @@ -621,7 +621,7 @@ def test_dedicated_consoles(main_window, qtbot):
assert nsb.editor.model.rowCount() == 4

# --- Assert only runfile text is present and there's no banner text ---
# See PR #5301
# See spyder-ide/spyder#5301.
text = control.toPlainText()
assert ('runfile' in text) and not ('Python' in text or 'IPython' in text)

Expand Down Expand Up @@ -1104,7 +1104,7 @@ def test_open_files_in_new_editor_window(main_window, qtbot):
This tests that opening files in a new editor window
is working as expected.
Test for spyder-ide/spyder#4085
Test for spyder-ide/spyder#4085.
"""
# Set a timer to manipulate the open dialog while it's running
QTimer.singleShot(2000, lambda: open_file_in_editor(main_window,
Expand Down Expand Up @@ -1689,7 +1689,7 @@ def test_troubleshooting_menu_item_and_url(monkeypatch):
@pytest.mark.slow
def test_help_opens_when_show_tutorial_full(main_window, qtbot):
"""
Test fix for spyder-ide/spyder#6317 :
Test fix for spyder-ide/spyder#6317.
'Show tutorial' opens the help plugin if closed.
"""
Expand Down
2 changes: 1 addition & 1 deletion spyder/app/tour.py
Expand Up @@ -884,7 +884,7 @@ def __init__(self, parent):
combobox_background=MAIN_TOP_COLOR)

# Widgets setup
# Needed to fix spyder-ide/spyder#2204
# Needed to fix spyder-ide/spyder#2204.
self.setAttribute(Qt.WA_TransparentForMouseEvents)

# Signals and slots
Expand Down
8 changes: 4 additions & 4 deletions spyder/config/base.py
Expand Up @@ -197,7 +197,7 @@ def get_conf_path(filename=None):
conf_dir = get_clean_conf_dir()
elif sys.platform.startswith('linux'):
# This makes us follow the XDG standard to save our settings
# on Linux, as it was requested on spyder-ide/spyder#2629
# on Linux, as it was requested on spyder-ide/spyder#2629.
xdg_config_home = os.environ.get('XDG_CONFIG_HOME', '')
if not xdg_config_home:
xdg_config_home = osp.join(get_home_dir(), '.config')
Expand Down Expand Up @@ -360,7 +360,7 @@ def get_interface_language():
locale is either 'pt' or 'pt_BR', this function will return 'pt_BR'
"""

# Solves spyder-ide/spyder#3627
# Solves spyder-ide/spyder#3627.
try:
locale_language = locale.getdefaultlocale()[0]
except ValueError:
Expand Down Expand Up @@ -390,7 +390,7 @@ def save_lang_conf(value):
"""Save language setting to language config file"""
# Needed to avoid an error when trying to save LANG_FILE
# but the operation fails for some reason.
# See spyder-ide/spyder#8807
# See spyder-ide/spyder#8807.
try:
with open(LANG_FILE, 'w') as f:
f.write(value)
Expand Down Expand Up @@ -439,7 +439,7 @@ def translate_dumb(x):
if os.name == 'nt':
# Trying to set LANG on Windows can fail when Spyder is
# run with admin privileges.
# Fixes spyder-ide/spyder#6886
# Fixes spyder-ide/spyder#6886.
try:
os.environ["LANG"] = language # Works on Windows
except Exception:
Expand Down
4 changes: 3 additions & 1 deletion spyder/config/tests/test_user.py
Expand Up @@ -38,11 +38,13 @@ def test_userconfig_set_percentage_string(userconfig):
def test_userconfig_get_string_from_inifile(userconfig):
assert userconfig.get('section', 'option') == 'value'


def test_userconfig_get_does_not_eval_functions(userconfig):
# regression test for spyder-ide/spyder#3354
# Regression test for spyder-ide/spyder#3354.
userconfig.set('section', 'option', 'print("foo")')
assert userconfig.get('section', 'option') == 'print("foo")'


def test_userconfig_set_with_string(userconfig):
userconfig.set('section', 'option', 'new value')
with open(userconfig.filename()) as inifile:
Expand Down
2 changes: 1 addition & 1 deletion spyder/otherplugins.py
Expand Up @@ -50,7 +50,7 @@ def _get_spyderplugins(plugin_path, is_io, modnames, modlist):

for name in os.listdir(plugin_path):
# This is needed in order to register the spyder_io_hdf5 plugin.
# See spyder-ide/spyder#4487
# See spyder-ide/spyder#4487.
# Is this a Spyder plugin?
if not name.startswith(PLUGIN_PREFIX):
continue
Expand Down
2 changes: 1 addition & 1 deletion spyder/plugins/console/widgets/console.py
Expand Up @@ -157,7 +157,7 @@ def __init__(self, parent=None):
# We use an object name to set the right background
# color when changing interface theme. This seems to
# be a Qt bug.
# Fixes spyder-ide/spyder#8072
# Fixes spyder-ide/spyder#8072.
self.setObjectName('console')

self.setMaximumBlockCount(300)
Expand Down
4 changes: 2 additions & 2 deletions spyder/plugins/console/widgets/internalshell.py
Expand Up @@ -77,11 +77,11 @@ def empty_queue(self):
self.lock.release()
return s

# We need to add this method to fix spyder-ide/spyder#1789
# We need to add this method to fix spyder-ide/spyder#1789.
def flush(self):
pass

# This is needed to fix spyder-ide/spyder#2984
# This is needed to fix spyder-ide/spyder#2984.
@property
def closed(self):
return False
Expand Down
2 changes: 1 addition & 1 deletion spyder/plugins/editor/panels/linenumber.py
Expand Up @@ -64,7 +64,7 @@ def paintEvent(self, event):
painter.fillRect(event.rect(), self.editor.sideareas_color)
# This is needed to make that the font size of line numbers
# be the same as the text one when zooming
# See spyder-ide/spyder#2296 and spyder-ide/spyder#4811
# See spyder-ide/spyder#2296 and spyder-ide/spyder#4811.
font = self.editor.font()
font_height = self.editor.fontMetrics().height()

Expand Down
14 changes: 7 additions & 7 deletions spyder/plugins/editor/plugin.py
Expand Up @@ -835,7 +835,7 @@ def get_plugin_actions(self):
_("Clear this list"), tip=_("Clear recent files list"),
triggered=self.clear_recent_files)

# Fixes spyder-ide/spyder#6055
# Fixes spyder-ide/spyder#6055.
# See: https://bugreports.qt.io/browse/QTBUG-8596
self.tab_navigation_actions = []
if sys.platform == 'darwin':
Expand Down Expand Up @@ -1859,7 +1859,7 @@ def load(self, filenames=None, goto=None, word='',
if self.editorwindows and not self.dockwidget.isVisible():
# We override the editorwindow variable to force a focus on
# the editor window instead of the hidden editor dockwidget.
# See PR #5742.
# See spyder-ide/spyder#5742.
if editorwindow not in self.editorwindows:
editorwindow = self.editorwindows[0]
editorwindow.setFocus()
Expand Down Expand Up @@ -2362,11 +2362,11 @@ def run_file(self, debug=False):
fname = osp.abspath(self.get_current_filename())

# Get fname's dirname before we escape the single and double
# quotes (Fixes spyder-ide/spyder#6771)
# quotes. Fixes spyder-ide/spyder#6771.
dirname = osp.dirname(fname)

# Escape single and double quotes in fname and dirname
# (Fixes spyder-ide/spyder#2158)
# Escape single and double quotes in fname and dirname.
# Fixes spyder-ide/spyder#2158.
fname = fname.replace("'", r"\'").replace('"', r'\"')
dirname = dirname.replace("'", r"\'").replace('"', r'\"')

Expand Down Expand Up @@ -2723,9 +2723,9 @@ def setup_open_files(self):
all_filenames = self.autosave.recover_files_to_open + filenames
if all_filenames and any([osp.isfile(f) for f in all_filenames]):
layout = self.get_option('layout_settings', None)
# Check if no saved layout settings exist, e.g. clean prefs file
# Check if no saved layout settings exist, e.g. clean prefs file.
# If not, load with default focus/layout, to fix
# spyder-ide/spyder#8458
# spyder-ide/spyder#8458.
if layout:
is_vertical, cfname, clines = layout.get('splitsettings')[0]
if cfname in filenames:
Expand Down
2 changes: 1 addition & 1 deletion spyder/plugins/editor/utils/decoration.py
Expand Up @@ -72,7 +72,7 @@ def remove(self, decoration):
except ValueError:
return False
except RuntimeError:
# This is needed to fix spyder-ide/spyder#9173
# This is needed to fix spyder-ide/spyder#9173.
pass

def clear(self):
Expand Down
12 changes: 6 additions & 6 deletions spyder/plugins/editor/widgets/base.py
Expand Up @@ -321,8 +321,8 @@ def update_current(self):
def focusOutEvent(self, event):
event.ignore()
# Don't hide it on Mac when main window loses focus because
# keyboard input is lost
# Fixes spyder-ide/spyder#1318
# keyboard input is lost.
# Fixes spyder-ide/spyder#1318.
if sys.platform == "darwin":
if event.reason() != Qt.ActiveWindowFocusReason:
self.hide()
Expand Down Expand Up @@ -682,7 +682,7 @@ def toPlainText(self):
# contents under Windows and PY3. This bug leads to
# corruptions when saving files with certain combinations
# of unicode chars on them (like the one attached on
# spyder-ide/spyder#1546)
# spyder-ide/spyder#1546).
if os.name == 'nt' and PY3:
text = self.get_text('sof', 'eof')
return text.replace('\u2028', '\n').replace('\u2029', '\n')\
Expand All @@ -695,7 +695,7 @@ def keyPressEvent(self, event):
ctrl = event.modifiers() & Qt.ControlModifier
meta = event.modifiers() & Qt.MetaModifier
# Use our own copy method for {Ctrl,Cmd}+C to avoid Qt
# copying text in HTML (See spyder-ide/spyder#2285)
# copying text in HTML. See spyder-ide/spyder#2285.
if (ctrl or meta) and key == Qt.Key_C:
self.copy()
else:
Expand Down Expand Up @@ -1281,7 +1281,7 @@ def mousePressEvent(self, event):
QPlainTextEdit.mousePressEvent(self, event)
QPlainTextEdit.mouseReleaseEvent(self, event)
# Send selection text to clipboard to be able to use
# the paste method and avoid the strange spyder-ide/spyder#1445
# the paste method and avoid the strange spyder-ide/spyder#1445.
# NOTE: This issue seems a focusing problem but it
# seems really hard to track
mode_clip = QClipboard.Clipboard
Expand Down Expand Up @@ -1309,7 +1309,7 @@ def focusOutEvent(self, event):

def wheelEvent(self, event):
"""Reimplemented to emit zoom in/out signals when Ctrl is pressed"""
# This feature is disabled on MacOS, see spyder-ide/spyder#1510
# This feature is disabled on MacOS, see spyder-ide/spyder#1510.
if sys.platform != 'darwin':
if event.modifiers() & Qt.ControlModifier:
if hasattr(event, 'angleDelta'):
Expand Down
6 changes: 3 additions & 3 deletions spyder/plugins/editor/widgets/codeeditor.py
Expand Up @@ -398,7 +398,7 @@ def __init__(self, parent=None):
# Vertical scrollbar
# This is required to avoid a "RuntimeError: no access to protected
# functions or signals for objects not created from Python" in
# Linux Ubuntu. See PR #5215.
# Linux Ubuntu. See spyder-ide/spyder#5215.
self.setVerticalScrollBar(QScrollBar())

# Scrollbar flag area
Expand Down Expand Up @@ -1847,7 +1847,7 @@ def paste(self):
text = to_text_string(clipboard.text())
if clipboard.mimeData().hasUrls():
# Have copied file and folder urls pasted as text paths.
# See PR: #8644 for details.
# See spyder-ide/spyder#8644 for details.
urls = clipboard.mimeData().urls()
if all([url.isLocalFile() for url in urls]):
if len(urls) > 1:
Expand Down Expand Up @@ -2823,7 +2823,7 @@ def blockcomment(self):
def unblockcomment(self):
"""Un-block comment current line or selection."""
# Needed for backward compatibility with Spyder previous blockcomments.
# See spyder-ide/spyder#2845
# See spyder-ide/spyder#2845.
unblockcomment = self.__unblockcomment()
if not unblockcomment:
unblockcomment = self.__unblockcomment(compatibility=True)
Expand Down

0 comments on commit 4cc0791

Please sign in to comment.