Skip to content

Commit

Permalink
Fixes #174: Merge branch '174-networksourceunavailable-not-exposed-to…
Browse files Browse the repository at this point in the history
…-python'
  • Loading branch information
Dzhoshkun Ismail Shakir committed Mar 14, 2017
2 parents e796b7e + 76cd053 commit 31d4800
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ pypi-network-sources:
- gift-epiphan-pearl
only:
- 5-add-support-for-blackmagic
- 174-networksourceunavailable-not-exposed-to-python

################## Device: Epiphan Pearl ##################
network-sources:
Expand All @@ -391,6 +392,7 @@ network-sources:
- gift-epiphan-pearl
only:
- 5-add-support-for-blackmagic
- 174-networksourceunavailable-not-exposed-to-python

################## Device: Blackmagic DeckLink SDI 4K ##################
pypi-blackmagic-decklink-sdi-4k:
Expand Down
1 change: 1 addition & 0 deletions doc/py-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ In particular the following classes are available and are of interest to Python
* `DeviceAlreadyConnected`
* `DeviceNotFound`
* `DeviceOffline`
* `NetworkSourceUnavailable`
3 changes: 3 additions & 0 deletions src/api/except.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ class ObserverError : public BasicException
//! \brief Thrown in case of problems related
//! to network video sources.
//!
//! \attention <b>In Python:</b> This exception
//! maps to \c IOError
//!
class NetworkSourceUnavailable : public BasicException
{
public:
Expand Down
8 changes: 8 additions & 0 deletions src/python/wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,13 @@ void translate_DeviceOffline(gg::DeviceOffline const & e)
PyErr_SetString(PyExc_IOError, msg.c_str());
}

void translate_NetworkSourceUnavailable(gg::NetworkSourceUnavailable const & e)
{
std::string msg;
msg.append("NetworkSourceUnavailable: ").append(e.what());
PyErr_SetString(PyExc_IOError, msg.c_str());
}

void translate_VideoTargetError(gg::VideoTargetError const & e)
{
std::string msg;
Expand All @@ -403,6 +410,7 @@ BOOST_PYTHON_MODULE(pygiftgrab)
register_exception_translator<gg::DeviceAlreadyConnected>(&translate_DeviceAlreadyConnected);
register_exception_translator<gg::DeviceNotFound>(&translate_DeviceNotFound);
register_exception_translator<gg::DeviceOffline>(&translate_DeviceOffline);
register_exception_translator<gg::NetworkSourceUnavailable>(&translate_NetworkSourceUnavailable);
register_exception_translator<gg::VideoTargetError>(&translate_VideoTargetError);
register_exception_translator<gg::ObserverError>(&translate_ObserverError);

Expand Down

0 comments on commit 31d4800

Please sign in to comment.