From 5d3a663d4782ac7664e601604a7f6b365dbd4961 Mon Sep 17 00:00:00 2001 From: Misha Wolfson Date: Thu, 8 Sep 2016 16:58:57 -0400 Subject: [PATCH 1/6] Fix docstring for freeze command --- tmuxp/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmuxp/cli.py b/tmuxp/cli.py index 32d703761c..1fe7cf1e29 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -351,7 +351,7 @@ def startup(config_dir): @click.option('-S', 'socket_path', help='pass-through for tmux -L') @click.option('-L', 'socket_name', help='pass-through for tmux -L') def command_freeze(session_name, socket_name, socket_path): - """Import teamocil config to tmuxp format.""" + """Write configuration for a snapshot of the current session into a tmuxp config.""" t = Server( socket_name=socket_name, From 0cc94306202b62c2c74df4b4a8d186f54293008b Mon Sep 17 00:00:00 2001 From: Misha Wolfson Date: Thu, 8 Sep 2016 19:02:43 -0400 Subject: [PATCH 2/6] Expand documentation for the load command --- tmuxp/cli.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tmuxp/cli.py b/tmuxp/cli.py index 1fe7cf1e29..2abf0fffb6 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -451,8 +451,24 @@ def command_freeze(session_name, socket_name, socket_path): help='Like -2, but indicates that the terminal supports 88 colours.') def command_load(ctx, config, socket_name, socket_path, answer_yes, detached, colors): - """Load a tmux workspace from one or multiple CONFIG path to config file, - directory with config file or session name. + """Load a tmux workspace from each CONFIG. + + CONFIG is a specifier for a configuration file. + + If CONFIG is a path to a directory, tmuxp will search it for ".tmuxp.{yaml,yml,json}". + + If CONFIG is has no directory component and only a filename, e.g. "myconfig.yaml", tmuxp will + search the users's config directory for that file. + + If CONFIG has no directory component, and only a name with no extension, e.g. "myconfig", + tmuxp will search the users's config directory for any file with the extension ".yaml", ".yml", + or ".json" that matches that name. + + If multiple configuration files that match a given CONFIG are found, tmuxp will warn and pick + the first one found. + + If multiple CONFIGs are provided, workspaces will be created for all of them. The last one + provided will be attached. The others will be created in detached mode. """ util.oh_my_zsh_auto_title() From 6fa0cab8cc618f8d2c3c43b00b6a8182684657a0 Mon Sep 17 00:00:00 2001 From: Misha Wolfson Date: Thu, 8 Sep 2016 19:37:33 -0400 Subject: [PATCH 3/6] Fix short help strings and add a global help message --- tmuxp/cli.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/tmuxp/cli.py b/tmuxp/cli.py index 2abf0fffb6..2f43379407 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -306,6 +306,10 @@ def reattach(session): @click.option('--log_level', default='INFO', help='Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)') def cli(log_level): + """Manage tmux sessions. + + Pass the "--help" argument to any command to see detailed help. + See detailed documentation and examples at http://tmuxp.readthedocs.io/en/latest/""" try: has_required_tmux_version() except exc.TmuxpException as e: @@ -351,7 +355,9 @@ def startup(config_dir): @click.option('-S', 'socket_path', help='pass-through for tmux -L') @click.option('-L', 'socket_name', help='pass-through for tmux -L') def command_freeze(session_name, socket_name, socket_path): - """Write configuration for a snapshot of the current session into a tmuxp config.""" + """Snapshot a session into a config. + + If SESSION_NAME is provided, snapshot that session. Otherwise, use the current session.""" t = Server( socket_name=socket_name, @@ -434,7 +440,7 @@ def command_freeze(session_name, socket_name, socket_path): sys.exit() -@cli.command(name='load') +@cli.command(name='load', short_help='Load tmuxp workspaces.') @click.pass_context @click.argument('config', click.Path(exists=True), nargs=-1, callback=resolve_config_argument) @@ -502,6 +508,7 @@ def command_load(ctx, config, socket_name, socket_path, answer_yes, @cli.group(name='import') def import_config_cmd(): + """Import a teamocil/tmuxinator config.""" pass @@ -560,24 +567,24 @@ def import_config(configfile, importfunc): sys.exit() -@import_config_cmd.command(name='teamocil') +@import_config_cmd.command(name='teamocil', short_help='Convert and import a teamocil config.') @click.argument( 'configfile', click.Path(exists=True), nargs=1, callback=_create_resolve_config_argument(get_teamocil_dir) ) def command_import_teamocil(configfile): - """Import teamocil config to tmuxp format.""" + """Convert a teamocil config from CONFIGFILE to tmuxp format and import it into tmuxp.""" import_config(configfile, config.import_teamocil) -@import_config_cmd.command(name='tmuxinator') +@import_config_cmd.command(name='tmuxinator', short_help='Convert and import a tmuxinator config.') @click.argument( 'configfile', click.Path(exists=True), nargs=1, callback=_create_resolve_config_argument(get_tmuxinator_dir) ) def command_import_tmuxinator(configfile): - """Import tmuxinator config to tmuxp format.""" + """Convert a tmuxinator config from CONFIGFILE to tmuxp format and import it into tmuxp.""" import_config(configfile, config.import_tmuxinator) @@ -585,7 +592,7 @@ def command_import_tmuxinator(configfile): @click.argument('config', click.Path(exists=True), nargs=1, callback=resolve_config_argument) def command_convert(config): - """Convert tmuxp config to and from JSON and YAML.""" + """Convert a tmuxp config between JSON and YAML.""" _, ext = os.path.splitext(config) if 'json' in ext: From 5b08012d35d902cafc7c4c2ce95fbb6e2a9cd139 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 13 Sep 2016 11:45:42 -0500 Subject: [PATCH 4/6] flake8 --- tmuxp/cli.py | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/tmuxp/cli.py b/tmuxp/cli.py index 2f43379407..fce70eb9f2 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -309,7 +309,8 @@ def cli(log_level): """Manage tmux sessions. Pass the "--help" argument to any command to see detailed help. - See detailed documentation and examples at http://tmuxp.readthedocs.io/en/latest/""" + See detailed documentation and examples at: + http://tmuxp.readthedocs.io/en/latest/""" try: has_required_tmux_version() except exc.TmuxpException as e: @@ -357,7 +358,8 @@ def startup(config_dir): def command_freeze(session_name, socket_name, socket_path): """Snapshot a session into a config. - If SESSION_NAME is provided, snapshot that session. Otherwise, use the current session.""" + If SESSION_NAME is provided, snapshot that session. Otherwise, use the + current session.""" t = Server( socket_name=socket_name, @@ -461,20 +463,23 @@ def command_load(ctx, config, socket_name, socket_path, answer_yes, CONFIG is a specifier for a configuration file. - If CONFIG is a path to a directory, tmuxp will search it for ".tmuxp.{yaml,yml,json}". + If CONFIG is a path to a directory, tmuxp will search it for + ".tmuxp.{yaml,yml,json}". - If CONFIG is has no directory component and only a filename, e.g. "myconfig.yaml", tmuxp will - search the users's config directory for that file. + If CONFIG is has no directory component and only a filename, e.g. + "myconfig.yaml", tmuxp will search the users's config directory for that + file. - If CONFIG has no directory component, and only a name with no extension, e.g. "myconfig", - tmuxp will search the users's config directory for any file with the extension ".yaml", ".yml", - or ".json" that matches that name. + If CONFIG has no directory component, and only a name with no extension, + e.g. "myconfig", tmuxp will search the users's config directory for any + file with the extension ".yaml", ".yml", or ".json" that matches that name. - If multiple configuration files that match a given CONFIG are found, tmuxp will warn and pick - the first one found. + If multiple configuration files that match a given CONFIG are found, tmuxp + will warn and pick the first one found. - If multiple CONFIGs are provided, workspaces will be created for all of them. The last one - provided will be attached. The others will be created in detached mode. + If multiple CONFIGs are provided, workspaces will be created for all of + them. The last one provided will be attached. The others will be created in + detached mode. """ util.oh_my_zsh_auto_title() @@ -567,24 +572,29 @@ def import_config(configfile, importfunc): sys.exit() -@import_config_cmd.command(name='teamocil', short_help='Convert and import a teamocil config.') +@import_config_cmd.command(name='teamocil', + short_help='Convert and import a teamocil config.') @click.argument( 'configfile', click.Path(exists=True), nargs=1, callback=_create_resolve_config_argument(get_teamocil_dir) ) def command_import_teamocil(configfile): - """Convert a teamocil config from CONFIGFILE to tmuxp format and import it into tmuxp.""" + """Convert a teamocil config from CONFIGFILE to tmuxp format and import + it into tmuxp.""" import_config(configfile, config.import_teamocil) -@import_config_cmd.command(name='tmuxinator', short_help='Convert and import a tmuxinator config.') +@import_config_cmd.command( + name='tmuxinator', + short_help='Convert and import a tmuxinator config.') @click.argument( 'configfile', click.Path(exists=True), nargs=1, callback=_create_resolve_config_argument(get_tmuxinator_dir) ) def command_import_tmuxinator(configfile): - """Convert a tmuxinator config from CONFIGFILE to tmuxp format and import it into tmuxp.""" + """Convert a tmuxinator config from CONFIGFILE to tmuxp format and import + it into tmuxp.""" import_config(configfile, config.import_tmuxinator) From 0f4bb8dfb6c42ac1fb8703adce46bf1dadb17f10 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 13 Sep 2016 11:47:38 -0500 Subject: [PATCH 5/6] Update pytest from 2.9.2 to 3.0.2 --- requirements/test.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements/test.txt b/requirements/test.txt index bf4bdf561c..998cc48c6a 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,2 +1,2 @@ -pytest==2.9.2 -pytest-rerunfailures==2.0.0 +pytest==3.0.2 # updated from 2.9.2 +pytest-rerunfailures==2.0.1 # updated from 2.0.0 From c4fbfc117caba3e57aa684dc0d2ce756cf915bf4 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 13 Sep 2016 11:48:11 -0500 Subject: [PATCH 6/6] update setup.cfg section for pytest to 3.0.2 format --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 8ba22e1c69..615899d1de 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,5 +2,5 @@ exclude = .*/,.tox,*.egg,tmuxp/_compat.py,tmuxp/__*__.py, select = E,W,F,N -[pytest] +[tool:pytest] addopts = --rerun 5