Skip to content

API Changes - Simplify EnvironmentMixin #390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 5, 2022
Merged

API Changes - Simplify EnvironmentMixin #390

merged 3 commits into from
Aug 5, 2022

Conversation

tony
Copy link
Member

@tony tony commented Aug 2, 2022

Via #389

  • Removed key lookups from {meth}libtmux.common.EnvironmentMixin.show_environment

    Only EnvironmentMixin.show_environment() (without an argument) exists, and
    it still returns a dict.

  • Add key lookups via {meth}libtmux.common.EnvironmentMixin.getenv

    # Before
    server.show_environment('DISPLAY')
    
    # After
    server.getenv('DISPLAY')
    
    # Before
    session.show_environment('DISPLAY')
    
    # After
    session.getenv('DISPLAY')
  • Removed key lookups from {meth}Session.show_options

    session.show_options()  # still returns dict, without an argument
    
    # Old
    session.show_options('DISPLAY')
    
    # Now
    session.show_option('DISPLAY')
  • Removed key lookups from {meth}Window.show_window_options

    window.show_window_options()  # still returns dict, without an argument
    
    # Old
    window.show_window_options('DISPLAY')
    
    # Now
    window.show_window_option('DISPLAY')

@tony tony linked an issue Aug 2, 2022 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Aug 2, 2022

Codecov Report

Merging #390 (fc82e28) into master (f606a42) will increase coverage by 0.00%.
The diff coverage is 97.56%.

❗ Current head fc82e28 differs from pull request most recent head 2a3bea2. Consider uploading reports for the commit 2a3bea2 to get more accurate results

@@           Coverage Diff           @@
##           master     #390   +/-   ##
=======================================
  Coverage   88.08%   88.08%           
=======================================
  Files          16       16           
  Lines        1611     1620    +9     
=======================================
+ Hits         1419     1427    +8     
- Misses        192      193    +1     
Impacted Files Coverage Δ
libtmux/common.py 86.97% <94.11%> (+0.21%) ⬆️
libtmux/session.py 80.70% <100.00%> (-0.23%) ⬇️
libtmux/window.py 84.11% <100.00%> (-0.19%) ⬇️
tests/test_server.py 100.00% <100.00%> (ø)
tests/test_session.py 98.55% <100.00%> (ø)
tests/test_window.py 98.78% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@tony tony force-pushed the api-lookups branch 2 times, most recently from aa3324c to fc82e28 Compare August 2, 2022 10:56
tony added 3 commits August 4, 2022 19:36
Use show(_window_option)(option:str) instead.
…environments

For individual lookups, use server.getenv(key) and session.getenv(key)
@tony tony changed the title API Changes API Changes - Simplify EnvironmentMixin Aug 5, 2022
@tony tony merged commit c3eefd5 into master Aug 5, 2022
@tony tony deleted the api-lookups branch August 5, 2022 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API todos: Lookups
1 participant