10BC0 Upgrade to libtmux 0.7.1 by tony · Pull Request #248 · tmux-python/tmuxp · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ language: python

sudo: false
python:
- 2.6
- 2.7
- 3.3
- 3.4
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ Project details
---------------

============== ==========================================================
tmux support 1.8, 1.9a, 2.0, 2.1, 2.2, 2.3
python support 2.6, 2.7, >= 3.3, pypy, pypy3
tmux support 1.8, 1.9a, 2.0, 2.1, 2.2, 2.3, 2.4
python support 2.7, >= 3.3, pypy, pypy3
config support yaml, json, python dict
Source https://github.com/tony/tmuxp
Docs http://tmuxp.git-pull.com
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
kaptan>=0.5.7
libtmux==0.6.5 # Updated from 0.6.4
libtmux==0.7.1 # Updated from 0.6.5
click==6.7
colorama==0.3.9
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def run_tests(self):
'Environment :: Web Environment',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
Expand Down
20 changes: 13 additions & 7 deletions tests/test_workspacebuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from . import fixtures_dir
from libtmux import Window
from libtmux.common import has_gte_version
from libtmux.test import temp_session
from tmuxp import config, exc
from tmuxp._compat import text_type
Expand Down Expand Up @@ -242,6 +243,9 @@ def test_window_options(session):
sconfig = sconfig.import_config(yaml_config).get()
sconfig = config.expand(sconfig)

if has_gte_version('2.3'):
sconfig['windows'][0]['options']['pane-border-format'] = ' #P '

builder = WorkspaceBuilder(sconf=sconfig)

window_count = len(session._windows) # current window count
Expand All @@ -253,6 +257,8 @@ def test_window_options(session):
assert len(s._windows) == window_count
assert isinstance(w, Window)
assert w.show_window_option('main-pane-height') == 5
if has_gte_version('2.3'):
assert w.show_window_option('pane-border-format') == ' #P '

assert len(s._windows) == window_count
window_count += 1
Expand All @@ -262,7 +268,6 @@ def test_window_options(session):
@pytest.mark.flaky(reruns=5)
def test_window_options_after(session):
yaml_config = loadfixture("workspacebuilder/window_options_after.yaml")
s = session
sconfig = kaptan.Kaptan(handler='yaml')
sconfig = sconfig.import_config(yaml_config).get()
sconfig = config.expand(sconfig)
Expand All @@ -274,8 +279,8 @@ def assert_last_line(p, s):
correct = False
for _ in range(10):
pane_out = p.cmd('capture-pane', '-p', '-J').stdout
# delete trailing empty lines for tmux 1.8...
while not pane_out[-1].strip(): pane_out.pop()
while not pane_out[-1].strip(): # delete trailing lines tmux 1.8
pane_out.pop()
if len(pane_out) > 1 and pane_out[-2].strip() == s:
correct = True
break
Expand All @@ -291,10 +296,11 @@ def assert_last_line(p, s):
for i, pane in enumerate(session.attached_window.panes):
assert assert_last_line(pane, str(i)), \
"Initial command did not execute properly/" + str(i)
pane.cmd('send-keys', 'Up') # Will repeat echo
pane.enter() # in each iteration
assert assert_last_line(pane, str(i)), \
"Repeated command did not execute properly/" + str(i)
pane.cmd('send-keys', 'Up') # Will repeat echo
pane.enter() # in each iteration
assert assert_last_line(pane, str(i)), (
"Repeated command did not execute properly/" + str(i)
)

session.cmd('send-keys', ' echo moo')
session.cmd('send-keys', 'Enter')
Expand Down
4 changes: 2 additions & 2 deletions tmuxp/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import click
import kaptan
from click.exceptions import FileError
from libtmux.common import has_required_tmux_version, which
from libtmux.common import has_minimum_version, which
from libtmux.exc import TmuxCommandNotFound
from libtmux.server import Server

Expand Down Expand Up @@ -318,7 +318,7 @@ def cli(log_level):
See detailed documentation and examples at:
http://tmuxp.readthedocs.io/en/latest/"""
try:
has_required_tmux_version()
has_minimum_version()
except TmuxCommandNotFound:
click.echo('tmux not found. tmuxp requires you install tmux first.')
sys.exit()
< 7B35 a href="#diff-4d7d7e5291d4e3b3a36d7f47b46db0eea18d2e4fc18a85d525ec22260293fd0d" id="expand-down-link--diff-4d7d7e5291d4e3b3a36d7f47b46db0eea18d2e4fc18a85d525ec22260293fd0d" class="js-expand directional-expander single-expander" aria-label="Expand Down" data-url="/tmux-python/tmuxp/blob_excerpt/7159b350a262da8fa2b8a740b66c8b3e7b64dc78?context=pull_request&diff=unified&direction=down&in_wiki_context&last_left=324&last_right=324&left=650&left_hunk_size&mode=100644&path=tmuxp%2Fcli.py&pull_request_id=118216237&right=650&right_hunk_size" data-left-range="325-649" data-right-range="325-649"> Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py26, py27, py33, py34, py35
envlist = py27, py33, py34, py35, py36

[testenv]
commands = make test []
0