Skip to content

Commit bf20c3e

Browse files
committed
Rename util.version to util.has_required_tmux_version(). Remove superfluous stdout statements on $ tmuxp load
1 parent 43d1aca commit bf20c3e

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

doc/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Internals
5757

5858
.. autoclass:: tmuxp.util.tmux
5959

60-
.. automethod:: tmuxp.util.version
60+
.. automethod:: tmuxp.util.has_required_tmux_version
6161

6262
.. automethod:: tmuxp.util.oh_my_zsh_auto_title
6363

tmuxp/cli.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def load_workspace(config_file, args):
230230
:param type: string
231231
232232
"""
233-
logger.info('building %s.' % config_file)
233+
logger.info('Loading %s.' % config_file)
234234

235235
sconfig = kaptan.Kaptan()
236236
sconfig = sconfig.import_config(config_file).get()
@@ -367,7 +367,7 @@ def command_load(args):
367367
startup(config_dir)
368368
configs_in_user = config.in_dir(config_dir)
369369
configs_in_cwd = config.in_cwd()
370-
print(configs_in_cwd)
370+
371371
sys.exit()
372372

373373
output = ''
@@ -385,6 +385,7 @@ def command_load(args):
385385
)
386386

387387
print(output)
388+
return
388389

389390
elif args.config:
390391
if '.' == args.config:
@@ -397,9 +398,7 @@ def command_load(args):
397398
configfile = args.config
398399
file_user = os.path.join(config_dir, configfile)
399400
file_cwd = os.path.join(cwd_dir, configfile)
400-
print(file_user)
401-
print(file_cwd)
402-
print(cwd_dir)
401+
403402
if os.path.exists(file_cwd) and os.path.isfile(file_cwd):
404403
print('load %s' % file_cwd)
405404
load_workspace(file_cwd, args)
@@ -899,10 +898,10 @@ def main():
899898

900899
args = parser.parse_args()
901900

902-
setup_logger(level=args.log_level.upper())
901+
setup_logger(level=args.log_level.upper() if 'log_level' in args else 'INFO')
903902

904903
try:
905-
util.version()
904+
util.has_required_tmux_version()
906905
except Exception as e:
907906
logger.error(e)
908907
sys.exit()

tmuxp/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def is_version(version):
249249
return StrictVersion(installed_version) == StrictVersion(version)
250250

251251

252-
def version():
252+
def has_required_tmux_version():
253253
"""Return if tmux meets version requirement. Version >1.8 or above."""
254254
proc = tmux('-V')
255255

0 commit comments

Comments
 (0)