@@ -335,17 +335,23 @@ def by(val, *args):
335335 return list (filter (by , self .children ))
336336
337337 def get_by_id (self , id ):
338- """Return object based on ``child_id_attribute``.
338+ """
339+ Return object based on ``child_id_attribute``.
340+
341+ Parameters
342+ ----------
343+ val : str
344+
345+ Returns
346+ -------
347+ object
339348
349+ Notes
350+ -----
340351 Based on `.get()`_ from `backbone.js`_.
341352
342353 .. _backbone.js: http://backbonejs.org/
343354 .. _.get(): http://backbonejs.org/#Collection-get
344-
345- :param id:
346- :type id: str
347- :rtype: object
348-
349355 """
350356 for child in self .children :
351357 if child [self .child_id_attribute ] == id :
@@ -359,18 +365,26 @@ def get_by_id(self, id):
359365def which (exe = None , default_paths = [
360366 '/bin' , '/sbin' , '/usr/bin' , '/usr/sbin' , '/usr/local/bin'
361367 ], append_env_path = True ):
362- """Return path of bin. Python clone of /usr/bin/which.
363-
368+ """
369+ Return path of bin. Python clone of /usr/bin/which.
370+
371+ Parameters
372+ ----------
373+ exe : str
374+ Application to search PATHs for.
375+ default_path : list
376+ Paths to check inside of
377+ append_env_path : bool, optional
378+ Append list of directories to check in from PATH environment variable.
379+ Default True. Setting False only for testing / diagnosing.
380+
381+ Returns
382+ -------
383+ str
384+
385+ Notes
386+ -----
364387 from salt.util - https://www.github.com/saltstack/salt - license apache
365-
366- :param exe: Application to search PATHs for.
367- :type exe: str
368- :param default_path: Application to search PATHs for.
369- :type default_path: list
370- :param append_env_path: Append PATHs in environmental variables.
371- :type append_env_path: bool
372- :rtype: str
373-
374388 """
375389 def _is_executable_file_or_link (exe ):
376390 # check for os.X_OK doesn't suffice because directory may executable
@@ -439,23 +453,35 @@ def get_version():
439453
440454
441455def has_version (version ):
442- """Return True if tmux version installed.
456+ """
457+ Return affirmative if tmux version installed.
443458
444- :param version: version, '1.8'
445- :type version: str
446- :returns: True if version matches
447- :rtype: bool
459+ Parameters
460+ ----------
461+ version : str
462+ version number, e.g. '1.8'
463+
464+ Returns
465+ -------
466+ bool :
467+ True if version matches
448468 """
449469 return get_version () == LooseVersion (version )
450470
451471
452472def has_gt_version (min_version ):
453- """Return True if tmux version greater than minimum.
473+ """
474+ Return affirmative if tmux version greater than minimum.
454475
455- :param min_version: version, e.g. '1.8'
456- :type min_version: str
457- :returns: True if version above min_version
458- :rtype: bool
476+ Parameters
477+ ----------
478+ min_version : str
479+ tmux version, e.g. '1.8'
480+
481+ Returns
482+ -------
483+ bool :
484+ True if version above min_version
459485 """
460486 return get_version () > LooseVersion (min_version )
461487
0 commit comments