Skip to content

Commit

Permalink
Sorting of imports (using isort -m 3 -tc).
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanslenders committed Apr 16, 2019
1 parent f66f74e commit 237cf46
Show file tree
Hide file tree
Showing 254 changed files with 1,415 additions and 571 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ matrix:

install:
- pip install . pytest coverage codecov flake8
- if [ "$TRAVIS_PYTHON_VERSION" != "2.6" ]; then pip install isort; fi
- pip list

script:
- echo "$TRAVIS_PYTHON_VERSION"
- if [ "$TRAVIS_PYTHON_VERSION" != "2.6" ]; then flake8 prompt_toolkit; fi
- coverage run -m pytest

# Check wheather the imports were sorted correctly.
# When this fails, please run ./tools/sort-imports.sh
- if [ "$TRAVIS_PYTHON_VERSION" != "2.6" ]; then isort -c -m 3 -tc -rc prompt_toolkit; fi

after_success:
- codecov
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import sys

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -99,7 +99,6 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.

import os
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if on_rtd:
Expand Down
1 change: 1 addition & 0 deletions examples/dialogs/button_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Example of button dialog window.
"""
from __future__ import unicode_literals

from prompt_toolkit.shortcuts import button_dialog


Expand Down
1 change: 1 addition & 0 deletions examples/dialogs/input_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Example of an input box dialog.
"""
from __future__ import unicode_literals

from prompt_toolkit.shortcuts import input_dialog


Expand Down
1 change: 1 addition & 0 deletions examples/dialogs/messagebox.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Example of a message box window.
"""
from __future__ import unicode_literals

from prompt_toolkit.shortcuts import message_dialog


Expand Down
1 change: 1 addition & 0 deletions examples/dialogs/password_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Example of an password input dialog.
"""
from __future__ import unicode_literals

from prompt_toolkit.shortcuts import input_dialog


Expand Down
6 changes: 4 additions & 2 deletions examples/dialogs/progress_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
Example of a progress bar dialog.
"""
from __future__ import unicode_literals
from prompt_toolkit.shortcuts import progress_dialog
import time

import os
import time

from prompt_toolkit.shortcuts import progress_dialog


def worker(set_percentage, log_text):
Expand Down
1 change: 1 addition & 0 deletions examples/dialogs/radio_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Example of a radio list box dialog.
"""
from __future__ import unicode_literals

from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.shortcuts import radiolist_dialog

Expand Down
2 changes: 1 addition & 1 deletion examples/dialogs/styled_messagebox.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
text.
"""
from __future__ import unicode_literals

from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.shortcuts import message_dialog
from prompt_toolkit.styles import Style


# Custom color scheme.
example_style = Style.from_dict({
'dialog': 'bg:#88ff88',
Expand Down
1 change: 1 addition & 0 deletions examples/dialogs/yes_no_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Example of confirmation (yes/no) dialog window.
"""
from __future__ import unicode_literals

from prompt_toolkit.shortcuts import yes_no_dialog


Expand Down
10 changes: 7 additions & 3 deletions examples/full-screen/buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
A simple example of a few buttons and click handlers.
"""
from __future__ import unicode_literals

from prompt_toolkit.application import Application
from prompt_toolkit.application.current import get_app
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.key_binding.bindings.focus import focus_next, focus_previous
from prompt_toolkit.layout import VSplit, HSplit, Layout
from prompt_toolkit.key_binding.bindings.focus import (
focus_next,
focus_previous,
)
from prompt_toolkit.layout import HSplit, Layout, VSplit
from prompt_toolkit.styles import Style
from prompt_toolkit.widgets import Button, Box, TextArea, Label, Frame
from prompt_toolkit.widgets import Box, Button, Frame, Label, TextArea


# Event handlers for all the buttons.
Expand Down
2 changes: 1 addition & 1 deletion examples/full-screen/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from prompt_toolkit.layout.containers import HSplit, Window
from prompt_toolkit.layout.layout import Layout
from prompt_toolkit.styles import Style
from prompt_toolkit.widgets import TextArea, SearchToolbar
from prompt_toolkit.widgets import SearchToolbar, TextArea

help_text = """
Type any expression (e.g. "4 + 4") followed by enter to execute.
Expand Down
26 changes: 21 additions & 5 deletions examples/full-screen/full-screen-demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,35 @@
"""
from __future__ import unicode_literals

from pygments.lexers.html import HtmlLexer

from prompt_toolkit.application import Application
from prompt_toolkit.application.current import get_app
from prompt_toolkit.completion import WordCompleter
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.key_binding.bindings.focus import focus_next, focus_previous
from prompt_toolkit.layout.containers import VSplit, HSplit, Float
from prompt_toolkit.key_binding.bindings.focus import (
focus_next,
focus_previous,
)
from prompt_toolkit.layout.containers import Float, HSplit, VSplit
from prompt_toolkit.layout.dimension import D
from prompt_toolkit.layout.layout import Layout
from prompt_toolkit.lexers import PygmentsLexer
from prompt_toolkit.layout.menus import CompletionsMenu
from prompt_toolkit.lexers import PygmentsLexer
from prompt_toolkit.styles import Style
from prompt_toolkit.widgets import TextArea, Label, Frame, Box, Checkbox, Dialog, Button, RadioList, MenuContainer, MenuItem, ProgressBar
from pygments.lexers.html import HtmlLexer
from prompt_toolkit.widgets import (
Box,
Button,
Checkbox,
Dialog,
Frame,
Label,
MenuContainer,
MenuItem,
ProgressBar,
RadioList,
TextArea,
)


def accept_yes():
Expand Down
4 changes: 3 additions & 1 deletion examples/full-screen/hello-world-asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
A simple example of a a text area displaying "Hello World!".
"""
from __future__ import unicode_literals

import asyncio

from prompt_toolkit.application import Application
from prompt_toolkit.eventloop import use_asyncio_event_loop
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.layout import Layout
from prompt_toolkit.widgets import Box, Frame, TextArea
import asyncio

# Layout for displaying hello world.
# (The frame creates the border, the box takes care of the margin/padding.)
Expand Down
1 change: 1 addition & 0 deletions examples/full-screen/hello-world.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
A simple example of a a text area displaying "Hello World!".
"""
from __future__ import unicode_literals

from prompt_toolkit.application import Application
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.layout import Layout
Expand Down
7 changes: 3 additions & 4 deletions examples/full-screen/pager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"""
from __future__ import unicode_literals

from pygments.lexers.python import PythonLexer

from prompt_toolkit.application import Application
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.layout.containers import HSplit, Window
Expand All @@ -12,10 +14,7 @@
from prompt_toolkit.layout.layout import Layout
from prompt_toolkit.lexers import PygmentsLexer
from prompt_toolkit.styles import Style
from prompt_toolkit.widgets import TextArea, SearchToolbar

from pygments.lexers.python import PythonLexer

from prompt_toolkit.widgets import SearchToolbar, TextArea

# Create one text buffer for the main content.

Expand Down
1 change: 0 additions & 1 deletion examples/full-screen/simple-demos/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from prompt_toolkit.layout.controls import FormattedTextControl
from prompt_toolkit.layout.layout import Layout


LIPSUM = """Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas
quis interdum enim. Nam viverra, mauris et blandit malesuada, ante est bibendum
mauris, ac dignissim dui tellus quis ligula. Aenean condimentum leo at
Expand Down
10 changes: 8 additions & 2 deletions examples/full-screen/simple-demos/autocompletion.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@
otherwise the completions won't be visible.
"""
from __future__ import unicode_literals

from prompt_toolkit.application import Application
from prompt_toolkit.buffer import Buffer
from prompt_toolkit.completion import WordCompleter
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.layout.containers import HSplit, Window, FloatContainer, Float
from prompt_toolkit.layout.controls import FormattedTextControl, BufferControl
from prompt_toolkit.layout.containers import (
Float,
FloatContainer,
HSplit,
Window,
)
from prompt_toolkit.layout.controls import BufferControl, FormattedTextControl
from prompt_toolkit.layout.layout import Layout
from prompt_toolkit.layout.menus import CompletionsMenu

Expand Down
5 changes: 2 additions & 3 deletions examples/full-screen/simple-demos/colorcolumn.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
from prompt_toolkit.application import Application
from prompt_toolkit.buffer import Buffer
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.layout.containers import HSplit, Window, ColorColumn
from prompt_toolkit.layout.controls import FormattedTextControl, BufferControl
from prompt_toolkit.layout.containers import ColorColumn, HSplit, Window
from prompt_toolkit.layout.controls import BufferControl, FormattedTextControl
from prompt_toolkit.layout.layout import Layout


LIPSUM = """
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas
quis interdum enim. Nam viverra, mauris et blandit malesuada, ante est bibendum
Expand Down
3 changes: 1 addition & 2 deletions examples/full-screen/simple-demos/cursorcolumn-cursorline.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
from prompt_toolkit.buffer import Buffer
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.layout.containers import HSplit, Window
from prompt_toolkit.layout.controls import FormattedTextControl, BufferControl
from prompt_toolkit.layout.controls import BufferControl, FormattedTextControl
from prompt_toolkit.layout.layout import Layout


LIPSUM = """
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas
quis interdum enim. Nam viverra, mauris et blandit malesuada, ante est bibendum
Expand Down
2 changes: 1 addition & 1 deletion examples/full-screen/simple-demos/float-transparency.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from prompt_toolkit.application import Application
from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.layout.containers import Window, FloatContainer, Float
from prompt_toolkit.layout.containers import Float, FloatContainer, Window
from prompt_toolkit.layout.controls import FormattedTextControl
from prompt_toolkit.layout.layout import Layout
from prompt_toolkit.widgets import Frame
Expand Down
2 changes: 1 addition & 1 deletion examples/full-screen/simple-demos/floats.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from prompt_toolkit.application import Application
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.layout.containers import Window, FloatContainer, Float
from prompt_toolkit.layout.containers import Float, FloatContainer, Window
from prompt_toolkit.layout.controls import FormattedTextControl
from prompt_toolkit.layout.layout import Layout
from prompt_toolkit.widgets import Frame
Expand Down
9 changes: 4 additions & 5 deletions examples/full-screen/simple-demos/focus.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
from __future__ import unicode_literals

from prompt_toolkit.application import Application
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.layout.containers import VSplit, HSplit, Window
from prompt_toolkit.layout.controls import FormattedTextControl, BufferControl
from prompt_toolkit.layout.layout import Layout
from prompt_toolkit.buffer import Buffer
from prompt_toolkit.document import Document

from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.layout.containers import HSplit, VSplit, Window
from prompt_toolkit.layout.controls import BufferControl, FormattedTextControl
from prompt_toolkit.layout.layout import Layout

# 1. The layout
top_text = (
Expand Down
9 changes: 8 additions & 1 deletion examples/full-screen/simple-demos/horizontal-align.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@
from prompt_toolkit.application import Application
from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.layout.containers import HSplit, VSplit, Window, HorizontalAlign, VerticalAlign, WindowAlign
from prompt_toolkit.layout.containers import (
HorizontalAlign,
HSplit,
VerticalAlign,
VSplit,
Window,
WindowAlign,
)
from prompt_toolkit.layout.controls import FormattedTextControl
from prompt_toolkit.layout.dimension import D
from prompt_toolkit.layout.layout import Layout
Expand Down
1 change: 0 additions & 1 deletion examples/full-screen/simple-demos/horizontal-split.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from prompt_toolkit.layout.controls import FormattedTextControl
from prompt_toolkit.layout.layout import Layout


# 1. The layout
left_text = "\nVertical-split example. Press 'q' to quit.\n\n(top pane.)"
right_text = "\n(bottom pane.)"
Expand Down
11 changes: 8 additions & 3 deletions examples/full-screen/simple-demos/line-prefixes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,23 @@
otherwise the completions won't be visible.
"""
from __future__ import unicode_literals

from prompt_toolkit.application import Application
from prompt_toolkit.buffer import Buffer
from prompt_toolkit.completion import WordCompleter
from prompt_toolkit.filters import Condition
from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.layout.containers import HSplit, Window, FloatContainer, Float
from prompt_toolkit.layout.controls import FormattedTextControl, BufferControl
from prompt_toolkit.layout.containers import (
Float,
FloatContainer,
HSplit,
Window,
)
from prompt_toolkit.layout.controls import BufferControl, FormattedTextControl
from prompt_toolkit.layout.layout import Layout
from prompt_toolkit.layout.menus import CompletionsMenu


LIPSUM = """
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas
quis interdum enim. Nam viverra, mauris et blandit malesuada, ante est bibendum
Expand Down
3 changes: 1 addition & 2 deletions examples/full-screen/simple-demos/margins.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
from prompt_toolkit.buffer import Buffer
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.layout.containers import HSplit, Window
from prompt_toolkit.layout.controls import FormattedTextControl, BufferControl
from prompt_toolkit.layout.controls import BufferControl, FormattedTextControl
from prompt_toolkit.layout.layout import Layout
from prompt_toolkit.layout.margins import NumberedMargin, ScrollbarMargin


LIPSUM = """
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas
quis interdum enim. Nam viverra, mauris et blandit malesuada, ante est bibendum
Expand Down
Loading

0 comments on commit 237cf46

Please sign in to comment.