Skip to content
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

Dbus API with Signals #184

Merged
merged 32 commits into from Feb 1, 2015
Merged

Dbus API with Signals #184

merged 32 commits into from Feb 1, 2015

Conversation

MaZderMind
Copy link

Re-Implement the Server-to-Client-Communication using DBus-Signals.
This allows using this Communication in Python and also provides a much cleaner interface.

This PR reconfigures the Server, the C-Client, the UI, the PTZ-Capture-Tool, and also the Python-API. It contains Unit- and Integration-Tests that ensures that the Signal-Handlers actually fire in the right Way.

fixes #172 by removing the concept of a role

@landscape-bot
Copy link

Code Health
Repository health decreased by 0.51% when pulling a2ecdd5 on MaZderMind:dbus-api-signals into 47600c7 on timvideos:master.

@@ -394,3 +415,39 @@ def parse_preview_ports(cls, res):
for tupl in liststr:
preview_ports.append(int(tupl[0]))
return preview_ports

def on_preview_port_added(self, cb):
if not hasattr(cb, '__call__'):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ callable: (object)                                                                                           │
│ callable(object) -> bool                                                                                     │
│                                                                                                              │
│ Return whether the object is callable (i.e., some kind of function).                                         │
│ Note that classes are callable, as are instances with a __call__() method.                                   │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

callable was not available from python3 to python 3.2 and 2to3 will probably change it back to an isinstance call, but to appreciate the future (it's back in python3.3), I'll change that :)

@mithro
Copy link
Member

mithro commented Jan 29, 2015

Can you check if this patch is pep8 and pylint clean?

@mithro
Copy link
Member

mithro commented Jan 29, 2015

Can you check and see if any of the landscape errors are relevant?

@mithro
Copy link
Member

mithro commented Jan 29, 2015

Generally looks pretty good - only some minor clean up issues.

@MaZderMind
Copy link
Author

The things I did not comment directly on are fixed with these Commits. There are some PEP8-Warnings that I can't see a way to avoid them:

peter@spock ~/AAA-VOC/gst-switch/python-api $ make test
PYTHONWARNINGS=ignore
PYTHONPATH=:/home/peter/AAA-VOC/gst-switch/python-api
pylint --rcfile=.pylintrc_gstswitch gstswitch
************* Module gstswitch.controller
W:181,16: Used * or ** magic (star-args)
W:166,42: Unused argument 'sender_name' (unused-argument)
W:167,65: Unused argument 'user_data' (unused-argument)
W:166,55: Unused argument 'object_path' (unused-argument)
W:166,30: Unused argument 'connection' (unused-argument)
W:167,24: Unused argument 'interface_name' (unused-argument)
Makefile:6: recipe for target 'lint' failed
make: *** [lint] Error 4

@landscape-bot
Copy link

Code Health
Repository health decreased by 0.70% when pulling 48c50e0 on MaZderMind:dbus-api-signals into 47600c7 on timvideos:master.

@landscape-bot
Copy link

Code Health
Repository health increased by 0.19% when pulling bd64d19 on MaZderMind:dbus-api-signals into 47600c7 on timvideos:master.

@landscape-bot
Copy link

Code Health
Repository health increased by 0.21% when pulling 7aa420a on MaZderMind:dbus-api-signals into d9ce0ac on timvideos:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.27%) to 98.14% when pulling 7aa420a on MaZderMind:dbus-api-signals into d9ce0ac on timvideos:master.

@landscape-bot
Copy link

Code Health
Repository health increased by 0.21% when pulling 0e1b2af on MaZderMind:dbus-api-signals into d9ce0ac on timvideos:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.27%) to 98.14% when pulling 0e1b2af on MaZderMind:dbus-api-signals into d9ce0ac on timvideos:master.

bus_name='us.timvideos.gstswitch.SwitchController',
object_path="/us/timvideos/gstswitch/SwitchController",
default_interface=("us.timvideos.gstswitch."
"SwitchControllerInterface")
):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be better wrapped as

+            default_interface=(
+                 "us.timvideos.gstswitch.SwitchControllerInterface")

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.53%) to 97.79% when pulling d23a94d on MaZderMind:dbus-api-signals into 912d5fa on timvideos:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.25%) to 98.06% when pulling d23a94d on MaZderMind:dbus-api-signals into 912d5fa on timvideos:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.25%) to 98.06% when pulling f3aca36 on MaZderMind:dbus-api-signals into 912d5fa on timvideos:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.25%) to 98.06% when pulling f3aca36 on MaZderMind:dbus-api-signals into 912d5fa on timvideos:master.

@@ -0,0 +1,115 @@
/* GstSwitch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This copyright header is wrong. It should be;

/* gst-switch                               -*- c -*-
 * Copyright (C) 2015 Peter XXXX <xxx@xxxxx>
 *
 * This file is part of gst-switch.
 *
 * gst-switch is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free
 * Software Foundation, either version 3 of the License, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program.  If not, see <http://www.gnu.org/licenses/>.
 */

mithro added a commit that referenced this pull request Feb 1, 2015
Change the DBus API to be more inline with how DBus should be used.
@mithro mithro merged commit 0109013 into timvideos:master Feb 1, 2015
@MaZderMind MaZderMind deleted the dbus-api-signals branch February 1, 2015 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants