willprice / python-omxplayer-wrapper

:tv: Control OMXPlayer, the Raspberry Pi media player, from Python
http://python-omxplayer-wrapper.readthedocs.io
GNU Lesser General Public License v3.0
253 stars 71 forks source link

Callback when process exits and return exit status #116

Closed Mello-Yello closed 6 years ago

Mello-Yello commented 6 years ago

This should fix #15 and #106. Basically I set up an event keeping it consistent with previous events. This way in the main script you can run: player.exitEvent += lambda _, exit_code: print("OK") if exit_code == 0 else print("NOT OK")

or just

player.exitEvent += lambda _, _: print("OMXPLAYER TERMINATED")

sourcelevel-bot[bot] commented 6 years ago

Hello, @Mello-Yello! This is your first Pull Request that will be reviewed by Ebert, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information.

codecov-io commented 6 years ago

Codecov Report

Merging #116 into develop will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #116   +/-   ##
========================================
  Coverage    79.19%   79.19%           
========================================
  Files            4        3    -1     
  Lines          399      399           
  Branches        21       21           
========================================
  Hits           316      316           
  Misses          75       75           
  Partials         8        8
Impacted Files Coverage Δ
omxplayer/player.py 82.42% <100%> (+0.1%) :arrow_up:
tests/integration/__init__.py

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ccf34d9...28ad77c. Read the comment docs.

willprice commented 6 years ago

Awesome! Thanks for this :)