Module Expr Str ImportFrom alias alias alias alias alias Import alias Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad ClassDef bases NameLoad NameLoad body Expr Str Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad kwarg body Expr Call AttributeLoad NameLoad attr NameLoad Str Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr ListLoad If NameLoad body Assign AttributeStore NameLoad attr NameLoad If NameLoad body Assign AttributeStore NameLoad attr NameLoad If NameLoad body Assign AttributeStore NameLoad attr NameLoad If NameLoad body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str Assign NameStore Call NameLoad NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Num Call AttributeLoad Str attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Num Call AttributeLoad Str attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Num Call AttributeLoad Str attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body If CompareEq AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Num Str orelse If CompareEq AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Num Str orelse Raise Call NameLoad Str Return Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore ListComp BinOpMod Str NameLoad comprehension NameStore NameLoad Assign NameStore TupleLoad BinOpMod Str Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad If AttributeLoad NameLoad attr body Raise Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num If AttributeLoad NameLoad attr body Raise Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore ListComp BinOpMod Str NameLoad comprehension NameStore NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore ListComp Call NameLoad Call NameLoad NameLoad Call AttributeLoad NameLoad attr Str comprehension NameStore NameLoad Assign NameStore ListComp Call NameLoad GeneratorExp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return ListComp Call NameLoad keyword NameLoad NameLoad comprehension NameStore AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr decorator_list NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpAdd ListLoad Str Str AttributeLoad NameLoad attr Assign NameStore ListComp BinOpMod Str NameLoad comprehension NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Str BinOpMod Str Call AttributeLoad Str attr NameLoad If AttributeLoad NameLoad attr body Raise Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore BinOpAdd ListLoad Str Str AttributeLoad NameLoad attr Assign NameStore ListComp Call NameLoad Call NameLoad NameLoad Call AttributeLoad NameLoad attr Str comprehension NameStore NameLoad Assign NameStore ListComp Call NameLoad GeneratorExp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad For NameStore NameLoad body If UnaryOpNot CompareIn Str NameLoad body Assign SubscriptStore NameLoad Index Str SubscriptLoad NameLoad Index Str If AttributeLoad NameLoad attr body Assign SubscriptStore AttributeLoad NameLoad attr Slice ListLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpAdd ListLoad Str Str Str Str Str AttributeLoad NameLoad attr Assign NameStore ListComp BinOpMod Str NameLoad comprehension NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Str BinOpMod Str Call AttributeLoad Str attr NameLoad If AttributeLoad NameLoad attr body Raise Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore BinOpAdd ListLoad Str Str Str Str Str AttributeLoad NameLoad attr Assign NameStore ListComp Call NameLoad Call NameLoad NameLoad Call AttributeLoad NameLoad attr Str comprehension NameStore NameLoad Assign NameStore ListComp Call NameLoad GeneratorExp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad If AttributeLoad NameLoad attr body Assign SubscriptStore AttributeLoad NameLoad attr Slice ListLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad For NameStore NameLoad body If CompareIn Str NameLoad body If CompareEq Call AttributeLoad NameLoad attr Str Str body Expr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad orelse Continue Return BoolOpOr ListComp Call NameLoad keyword NameLoad NameLoad comprehension NameStore NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str BinOpMod Str NameLoad If CompareEq AttributeLoad NameLoad attr ListLoad body Return NameLoad If Call NameLoad GeneratorExp CompareIn NameLoad AttributeLoad NameLoad attr comprehension NameStore ListLoad Str Str body Return NameLoad orelse If CompareIn Str AttributeLoad NameLoad attr body Return NameLoad orelse If CompareIn Str AttributeLoad NameLoad attr body Return NameLoad orelse If CompareIn Str AttributeLoad NameLoad attr body Return NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str BinOpMod Str NameLoad If AttributeLoad NameLoad attr body Raise Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str BinOpMod Str NameLoad If AttributeLoad NameLoad attr body Raise Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad If NameLoad body AugAssignAdd NameStore TupleLoad BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad If AttributeLoad NameLoad attr body Raise Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad vararg kwarg body Expr Str If Call AttributeLoad NameLoad attr NameLoad body If NameLoad body Expr Call AttributeLoad NameLoad attr Str BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad orelse Raise Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore ListComp BinOpMod Str NameLoad comprehension NameStore NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str If NameLoad body Delete SubscriptDel AttributeLoad NameLoad attr Index Str Assign NameStore TupleLoad BinOpMod Str NameLoad Str BinOpMod Str Call AttributeLoad Str attr NameLoad If UnaryOpNot NameLoad body AugAssignAdd NameStore TupleLoad Str Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad If AttributeLoad NameLoad attr body Raise Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num If NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameLoad Assign NameStore Call NameLoad Call NameLoad NameLoad Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad GeneratorExp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad keyword NameLoad NameLoad Return NameLoad decorator_list decorator_list
N/A N/A Pythonization of the :term:`tmux(1)` server.

tmuxp.server
~~~~~~~~~~~~

 __future__ absolute_import division print_function with_statement unicode_literals N/A logging N/A os N/A formats exc session Session util tmux_cmd TmuxRelationalObject common EnvironmentMixin N/A logger N/A N/A logging getLogger __name__ Server N/A TmuxRelationalObject EnvironmentMixin N/A N/A The :term:`tmux(1)` server.

    - :attr:`Server._sessions` [:class:`Session`, ...]

      - :attr:`Session._windows` [:class:`Window`, ...]

        - :attr:`Window._panes` [:class:`Pane`, ...]

          - :class:`Pane`

    When instantiated, provides the ``t`` global. stores information on live,
    running tmux server.

     N/A socket_name None N/A socket_path None N/A config_file None N/A colors None N/A childIdAttribute session_id __init__ N/A N/A self socket_name socket_path config_file colors N/A None None None None kwargs N/A N/A N/A N/A EnvironmentMixin __init__ self -g N/A N/A self _windows N/A N/A N/A self _panes N/A N/A socket_name N/A N/A N/A self socket_name socket_name N/A socket_path N/A N/A N/A self socket_path socket_path N/A config_file N/A N/A N/A self config_file config_file N/A colors N/A N/A N/A self colors colors N/A cmd N/A N/A self N/A args kwargs N/A N/A Return :class:`util.tmux_cmd` send tmux commands with sockets, colors.

        :rtype: :class:`util.tmux_cmd`

        :versionchanged: 0.8
            Renamed from ``.tmux`` to ``.cmd``.

         N/A args N/A list args N/A N/A self socket_name N/A N/A N/A N/A args insert 0 N/A N/A -L{0} format N/A self socket_name N/A N/A self socket_path N/A N/A N/A N/A args insert 0 N/A N/A -S{0} format N/A self socket_path N/A N/A self config_file N/A N/A N/A N/A args insert 0 N/A N/A -f{0} format N/A self config_file N/A N/A self colors N/A N/A N/A N/A self colors 256 N/A N/A N/A N/A args insert 0 -2 N/A N/A N/A N/A self colors 88 N/A N/A N/A N/A args insert 0 -8 N/A N/A N/A ValueError Server.colors must equal 88 or 256 N/A N/A tmux_cmd args kwargs N/A _list_sessions N/A N/A self N/A N/A N/A Return list of sessions in :py:obj:`dict` form.

        Retrieved from ``$ tmux(1) list-sessions`` stdout.

        The :py:obj:`list` is derived from ``stdout`` in :class:`util.tmux_cmd`
        which wraps :py:class:`subprocess.Popen`.

        :rtype: :py:obj:`list` of :py:obj:`dict`

         N/A sformats N/A formats SESSION_FORMATS N/A tmux_formats N/A N/A #{%s} f N/A f sformats N/A tmux_args N/A N/A -F%s N/A N/A join tmux_formats N/A proc N/A N/A self cmd list-sessions tmux_args N/A N/A proc stderr N/A N/A N/A N/A exc TmuxpException N/A proc stderr N/A N/A session_info N/A N/A proc stdout N/A 0 N/A N/A proc stderr N/A N/A N/A N/A exc TmuxpException N/A proc stderr N/A sformats N/A formats SESSION_FORMATS N/A tmux_formats N/A N/A #{%s} format N/A format sformats N/A sessions N/A proc stdout N/A sessions N/A N/A dict N/A zip sformats N/A N/A session split N/A session sessions N/A sessions N/A N/A dict N/A N/A k v N/A N/A k v N/A N/A session items v N/A session sessions N/A sessions N/A _sessions N/A N/A self N/A N/A N/A Property / alias to return :meth:`~._list_sessions`. N/A N/A N/A self _list_sessions N/A property list_sessions N/A N/A self N/A N/A N/A Return list of :class:`Session` from the ``tmux(1)`` session.

        :rtype: :py:obj:`list` of :class:`Session`

         N/A N/A N/A Session server self s N/A s N/A self _sessions N/A sessions N/A N/A self N/A N/A N/A Property / alias to return :meth:`~.list_sessions`. N/A N/A N/A self list_sessions N/A property N/A children sessions _list_windows N/A N/A self N/A N/A N/A Return list of windows in :py:obj:`dict` form.

        Retrieved from ``$ tmux(1) list-windows`` stdout.

        The :py:obj:`list` is derived from ``stdout`` in :class:`util.tmux_cmd`
        which wraps :py:class:`subprocess.Popen`.

        :rtype: list

         N/A wformats N/A N/A session_name session_id N/A formats WINDOW_FORMATS N/A tmux_formats N/A N/A #{%s} format N/A format wformats N/A proc N/A N/A self cmd list-windows -a N/A -F%s N/A N/A join tmux_formats N/A N/A proc stderr N/A N/A N/A N/A exc TmuxpException N/A proc stderr N/A windows N/A proc stdout N/A wformats N/A N/A session_name session_id N/A formats WINDOW_FORMATS N/A windows N/A N/A dict N/A zip wformats N/A N/A window split N/A window windows N/A windows N/A N/A dict N/A N/A k v N/A N/A k v N/A N/A window items v N/A window windows N/A w windows N/A N/A N/A N/A window_id w N/A N/A N/A w N/A window_id N/A w N/A window_name N/A N/A self _windows N/A N/A N/A N/A self _windows N/A N/A N/A N/A N/A N/A self _windows extend windows N/A N/A self _windows N/A _update_windows N/A N/A self N/A N/A N/A Update internal window data and return ``self`` for chainability.

        :rtype: :class:`Server`

         N/A N/A N/A self _list_windows N/A self N/A _list_panes N/A N/A self N/A N/A N/A Return list of panes in :py:obj:`dict` form.

        Retrieved from ``$ tmux(1) list-panes`` stdout.

        The :py:obj:`list` is derived from ``stdout`` in :class:`util.tmux_cmd`
        which wraps :py:class:`subprocess.Popen`.

        :rtype: list

         N/A pformats N/A N/A session_name session_id window_index window_id window_name N/A formats PANE_FORMATS N/A tmux_formats N/A N/A #{%s}	 f N/A f pformats N/A proc N/A N/A self cmd list-panes -a N/A -F%s N/A N/A join tmux_formats N/A N/A proc stderr N/A N/A N/A N/A exc TmuxpException N/A proc stderr N/A panes N/A proc stdout N/A pformats N/A N/A session_name session_id window_index window_id window_name N/A formats PANE_FORMATS N/A panes N/A N/A dict N/A zip pformats N/A N/A window split N/A window panes N/A panes N/A N/A dict N/A N/A k v N/A N/A k v N/A N/A window items v N/A window panes N/A N/A self _panes N/A N/A N/A N/A self _panes N/A N/A N/A N/A N/A N/A self _panes extend panes N/A N/A self _panes N/A _update_panes N/A N/A self N/A N/A N/A Update internal pane data and return ``self`` for chainability.

        :rtype: :class:`Server`

         N/A N/A N/A self _list_panes N/A self N/A attached_sessions N/A N/A self N/A N/A N/A Return active :class:`Session` objects.

        This will not work where multiple tmux sessions are attached.

        :rtype: :py:obj:`list` of :class:`Session`

         N/A sessions N/A self _sessions N/A attached_sessions N/A list N/A session sessions N/A N/A N/A session_attached session N/A N/A N/A N/A N/A session get session_attached 1 N/A N/A N/A N/A logger debug session %s attached N/A N/A session get session_name N/A N/A N/A attached_sessions append session N/A N/A N/A N/A N/A N/A Session server self s N/A s attached_sessions None N/A has_session N/A N/A self target_session N/A N/A N/A Return True if session exists. ``$ tmux has-session``.

        :param: target_session: str of session name.
        :rtype: bool

         N/A proc N/A N/A self cmd has-session N/A -t%s target_session N/A N/A N/A proc stdout N/A N/A N/A True N/A N/A any N/A N/A x N/A proc stdout N/A x N/A failed to connect to server error connecting to N/A N/A False N/A N/A N/A no server running N/A proc stdout N/A N/A False N/A N/A N/A can't find session N/A proc stdout N/A N/A False N/A N/A N/A session not found N/A proc stdout N/A N/A False N/A N/A True N/A kill_server N/A N/A self N/A N/A N/A ``$ tmux kill-server``. N/A N/A N/A self cmd kill-server N/A kill_session N/A N/A self target_session N/A None N/A N/A Kill the tmux session with ``$ tmux kill-session``, return ``self``.

        :param: target_session: str. note this accepts ``fnmatch(3)``. 'asdf'
            will kill 'asdfasd'.

        :rtype: :class:`Server`

         N/A proc N/A N/A self cmd kill-session N/A -t%s target_session N/A N/A proc stderr N/A N/A N/A N/A exc TmuxpException N/A proc stderr N/A self N/A switch_client N/A N/A self target_session N/A N/A N/A ``$ tmux switch-client``.

        :param: target_session: str. name of the session. fnmatch(3) works.

         N/A proc N/A N/A self cmd switch-client N/A -t%s target_session N/A N/A proc stderr N/A N/A N/A N/A exc TmuxpException N/A proc stderr N/A attach_session N/A N/A self target_session N/A None N/A N/A ``$ tmux attach-session`` aka alias: ``$ tmux attach``.

        :param: target_session: str. name of the session. fnmatch(3) works.

         N/A tmux_args N/A tuple N/A target_session N/A N/A tmux_args N/A N/A -t%s target_session N/A proc N/A N/A self cmd attach-session tmux_args N/A N/A proc stderr N/A N/A N/A N/A exc TmuxpException N/A proc stderr N/A new_session N/A N/A self session_name kill_session attach N/A None False False args kwargs N/A N/A Return :class:`Session` from  ``$ tmux new-session``.

        Uses ``-P`` flag to print session info, ``-F`` for return formatting
        returns new Session object.

        ``$ tmux new-session -d`` will create the session in the background
        ``$ tmux new-session -Ad`` will move to the session name if it already
        exists. todo: make an option to handle this.

        :param session_name: session name::

            $ tmux new-session -s <session_name>
        :type session_name: string

        :param attach: create session in the foreground. ``attach=False`` is
        equivalent to::

            $ tmux new-session -d
        :type attach: bool

        :param kill_session: Kill current session if ``$ tmux has-session``
                             Useful for testing workspaces.
        :type kill_session: bool
        :rtype: :class:`Session`

         N/A N/A N/A self has_session session_name N/A N/A kill_session N/A N/A N/A N/A self cmd kill-session N/A -t%s session_name N/A N/A N/A logger info N/A session %s exists. killed it. session_name N/A N/A N/A N/A exc TmuxSessionExists N/A Session named %s exists session_name N/A N/A N/A logger debug N/A creating session %s session_name N/A sformats N/A formats SESSION_FORMATS N/A tmux_formats N/A N/A #{%s} f N/A f sformats N/A env N/A N/A N/A os environ get TMUX N/A env N/A N/A N/A N/A os environ N/A TMUX N/A tmux_args N/A N/A -s%s session_name -P N/A -F%s N/A N/A join tmux_formats N/A N/A attach N/A N/A tmux_args N/A -d N/A proc N/A N/A self cmd new-session tmux_args N/A N/A proc stderr N/A N/A N/A N/A exc TmuxpException N/A proc stderr N/A session N/A N/A proc stdout N/A 0 N/A env N/A N/A N/A N/A os environ N/A TMUX env N/A session N/A dict N/A zip sformats N/A N/A session split N/A session N/A dict N/A N/A k v N/A N/A k v N/A N/A session items v N/A session N/A Session server self session N/A session N/A N/A