Skip to content

Commit bfb3e7b

Browse files
committed
Use DEFAULT_BUFFER enum consistently
1 parent 9d1c69d commit bfb3e7b

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

awsshell/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
1919
from prompt_toolkit.history import InMemoryHistory, FileHistory
2020
from prompt_toolkit.enums import EditingMode
21+
from prompt_toolkit.enums import DEFAULT_BUFFER
2122

2223
from awsshell.ui import create_default_layout
2324
from awsshell.config import Config
@@ -444,7 +445,7 @@ def create_application(self, completer, history,
444445
)
445446

446447
def on_input_timeout(self, cli):
447-
if not self.show_help or cli.current_buffer_name != u'DEFAULT_BUFFER':
448+
if not self.show_help or cli.current_buffer_name != DEFAULT_BUFFER:
448449
return
449450
document = cli.current_buffer.document
450451
text = document.text

awsshell/keys.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
1313
from prompt_toolkit.key_binding.manager import KeyBindingManager
14+
from prompt_toolkit.enums import DEFAULT_BUFFER
1415
from prompt_toolkit.keys import Keys
1516

1617

@@ -154,7 +155,7 @@ def handle_f9(event):
154155
155156
"""
156157
if event.cli.current_buffer_name == u'clidocs':
157-
event.cli.focus(u'DEFAULT_BUFFER')
158+
event.cli.focus(DEFAULT_BUFFER)
158159
else:
159160
event.cli.focus(u'clidocs')
160161

awsshell/toolbar.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
1313
from pygments.token import Token
14+
from prompt_toolkit.enums import DEFAULT_BUFFER
1415

1516

1617
class Toolbar(object):
@@ -87,7 +88,7 @@ def get_toolbar_items(cli):
8788
else:
8889
show_help_token = Token.Toolbar.Off
8990
show_help_cfg = 'OFF'
90-
if cli.current_buffer_name == 'DEFAULT_BUFFER':
91+
if cli.current_buffer_name == DEFAULT_BUFFER:
9192
show_buffer_name = 'cli'
9293
else:
9394
show_buffer_name = 'doc'

0 commit comments

Comments
 (0)