Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5d0b37b

Browse files
committed
Reformat with ruff format all the file with <10 changes.
This will have minimal impacts on potential rebases or conflicts.
1 parent 36f74b6 commit 5d0b37b

30 files changed

Lines changed: 68 additions & 62 deletions

IPython/__main__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# PYTHON_ARGCOMPLETE_OK
22
# encoding: utf-8
3-
"""Terminal-based IPython entry point.
4-
"""
3+
"""Terminal-based IPython entry point."""
54
# -----------------------------------------------------------------------------
65
# Copyright (c) 2012, IPython Development Team.
76
#

IPython/consoleapp.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66

77
from warnings import warn
88

9-
warn("The `IPython.consoleapp` package has been deprecated since IPython 4.0."
10-
"You should import from jupyter_client.consoleapp instead.", stacklevel=2)
9+
warn(
10+
"The `IPython.consoleapp` package has been deprecated since IPython 4.0."
11+
"You should import from jupyter_client.consoleapp instead.",
12+
stacklevel=2,
13+
)
1114

1215
from jupyter_client.consoleapp import *

IPython/core/displaypub.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# Copyright (c) IPython Development Team.
1616
# Distributed under the terms of the Modified BSD License.
1717

18-
1918
import sys
2019

2120
from traitlets.config.configurable import Configurable

IPython/core/payloadpage.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ def page(strng, start=0, screen_lines=0, pager_cmd=None):
2828
# negative value. Offset to 0 for robustness.
2929
start = max(0, start)
3030
shell = get_ipython()
31-
31+
3232
if isinstance(strng, dict):
3333
data = strng
3434
else:
35-
data = {'text/plain' : strng}
35+
data = {"text/plain": strng}
3636
payload = dict(
37-
source='page',
37+
source="page",
3838
data=data,
3939
start=start,
40-
)
40+
)
4141
shell.payload_manager.write_payload(payload)

IPython/core/prompts.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
"""Being removed
3-
"""
2+
"""Being removed"""
43

54

65
class LazyEvaluate(object):

IPython/display.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Public API for display tools in IPython.
2-
"""
1+
"""Public API for display tools in IPython."""
32

43
# -----------------------------------------------------------------------------
54
# Copyright (C) 2012 The IPython Development Team

IPython/sphinxext/ipython_console_highlighting.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@
66
from sphinx import highlighting
77
from ipython_pygments_lexers import IPyLexer
88

9+
910
def setup(app):
1011
"""Setup as a sphinx extension."""
1112

1213
# This is only a lexer, so adding it below to pygments appears sufficient.
1314
# But if somebody knows what the right API usage should be to do that via
1415
# sphinx, by all means fix it here. At least having this setup.py
1516
# suppresses the sphinx warning we'd get without it.
16-
metadata = {'parallel_read_safe': True, 'parallel_write_safe': True}
17+
metadata = {"parallel_read_safe": True, "parallel_write_safe": True}
1718
return metadata
1819

20+
1921
# Register the extension as a valid pygments lexer.
2022
# Alternatively, we could register the lexer with pygments instead. This would
2123
# require using setuptools entrypoints: http://pygments.org/docs/plugins

IPython/terminal/pt_inputhooks/asyncio.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
2929
"""
3030

31+
3132
def inputhook(context):
3233
"""
3334
Inputhook for asyncio event loop integration.

IPython/terminal/pt_inputhooks/gtk3.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""prompt_toolkit input hook for GTK 3
2-
"""
1+
"""prompt_toolkit input hook for GTK 3"""
32

43
from gi.repository import Gtk, GLib
54

IPython/terminal/pt_inputhooks/pyglet.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""Enable pyglet to be used interactively with prompt_toolkit
2-
"""
1+
"""Enable pyglet to be used interactively with prompt_toolkit"""
32

43
import sys
54
import time
@@ -10,13 +9,15 @@
109
# window close. For details, see:
1110
# http://groups.google.com/group/pyglet-users/browse_thread/thread/47c1aab9aa4a3d23/c22f9e819826799e?#c22f9e819826799e
1211

13-
if sys.platform.startswith('linux'):
12+
if sys.platform.startswith("linux"):
13+
1414
def flip(window):
1515
try:
1616
window.flip()
1717
except AttributeError:
1818
pass
1919
else:
20+
2021
def flip(window):
2122
window.flip()
2223

@@ -38,7 +39,7 @@ def inputhook(context):
3839
for window in pyglet.app.windows:
3940
window.switch_to()
4041
window.dispatch_events()
41-
window.dispatch_event('on_draw')
42+
window.dispatch_event("on_draw")
4243
flip(window)
4344

4445
# We need to sleep at this point to keep the idle CPU load

0 commit comments

Comments
 (0)