Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: timvideos/gst-switch
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a96b42337354
Choose a base ref
...
head repository: timvideos/gst-switch
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 10aa4d06702c
Choose a head ref
  • 4 commits
  • 1 file changed
  • 2 contributors

Commits on Jan 17, 2015

  1. Copy the full SHA
    f9a6cc2 View commit details
  2. Remove print-statements form controller

    The controller should not print to stdout anyway
    MaZderMind committed Jan 17, 2015
    Copy the full SHA
    a84e935 View commit details
  3. Fix boolean comparisons

    MaZderMind committed Jan 17, 2015
    Copy the full SHA
    3ac6a1a View commit details
  4. Merge pull request #162 from MaZderMind/python-cleanup-controller

    Remove unnecessary prints.
    mithro committed Jan 17, 2015
    Copy the full SHA
    10aa4d0 View commit details
Showing with 8 additions and 20 deletions.
  1. +8 −20 python-api/gstswitch/controller.py
28 changes: 8 additions & 20 deletions python-api/gstswitch/controller.py
Original file line number Diff line number Diff line change
@@ -229,10 +229,7 @@ def set_composite_mode(self, mode):
if mode in range(0, 4):
try:
conn = self.connection.set_composite_mode(mode)
print conn
res = conn.unpack()[0]
if res is True:
print "Set composite mode to %s" % (str(mode))
except AttributeError:
raise ConnectionReturnError('Connection returned invalid '
'values. Should return a '
@@ -253,11 +250,9 @@ def set_encode_mode(self, channel):
try:
conn = self.connection.set_encode_mode(channel)
res = conn.unpack()[0]
if res is True:
print "Set encode mode to %s" % (str(channel))
else:
pass
if res is not True:
# raise some exception
pass
return res
except AttributeError:
raise ConnectionReturnError('Connection returned invalid values. '
@@ -272,10 +267,8 @@ def new_record(self):
try:
conn = self.connection.new_record()
res = conn.unpack()[0]
if res is True:
# logging
print "New record"
else:
if res is not True:
# raise some exception
pass
except AttributeError:
raise ConnectionReturnError('Connection returned invalid values. '
@@ -295,8 +288,6 @@ def adjust_pip(self, xpos, ypos, width, height):
try:
conn = self.connection.adjust_pip(xpos, ypos, width, height)
res = conn.unpack()[0]
print "adjust pip xpos:%s ypos:%s w:%s h:%s" % (
str(xpos), str(ypos), str(width), str(height))
except AttributeError:
raise ConnectionReturnError('Connection returned invalid values. '
'Should return a GVariant tuple')
@@ -317,9 +308,8 @@ def switch(self, channel, port):
try:
conn = self.connection.switch(channel, port)
res = conn.unpack()[0]
if res is True:
print "Switch channel:%s port:%s" % (str(channel), str(port))
else:
if res is not True:
# raise some exception
pass
return res
except AttributeError:
@@ -339,10 +329,8 @@ def click_video(self, xpos, ypos, width, height):
try:
conn = self.connection.click_video(xpos, ypos, width, height)
res = conn.unpack()[0]
if res is True:
print "Click video: xpos:%s ypos:%s width:%s height:%s" % (
str(xpos), str(ypos), str(width), str(height))
else:
if res is not True:
# raise some exception
pass
except:
raise ConnectionReturnError('Connection returned invalid values. '