Commit dbf5a5b3 authored by Thibault Saunier's avatar Thibault Saunier

Use the reindent.py official python script

parent d6ce9780
......@@ -22,4 +22,3 @@
"""
Project store/load support
"""
......@@ -307,7 +307,7 @@ class Formatter(Signallable, Loggable):
self.debug("oldpath:%r, newpath:%r", oldpath, newpath)
# FIXME dumbest of dumbest implementation, whoever comes up
# with a less ugly code is welcome to change this :)
# Split the paths for each directory level
a = oldpath.split(os.sep)
b = newpath.split(os.sep)
......@@ -410,4 +410,3 @@ class DefaultFormatter(Formatter):
description = "PiTiVi default file format"
pass
......@@ -711,7 +711,7 @@ class TimelineEdges(object):
"""
self._disconnectFromTimelineObject(timeline_object)
for obj in timeline_object.track_objects:
self.removeTrackObject(obj)
self.removeTrackObject(obj)
def _connectToTimelineObject(self, timeline_object):
timeline_object.connect("track-object-added", self._trackObjectAddedCb)
......@@ -1734,10 +1734,10 @@ class Timeline(Signallable, Loggable):
break
if track is None:
raise TimelineError("There is no Track to add the effect to")
raise TimelineError("There is no Track to add the effect to")
if not timeline_objects:
raise TimelineError("There is no timeline object to add effect to")
raise TimelineError("There is no timeline object to add effect to")
listTimelineObjectTrackObject = []
track_object = TrackEffect(factory, input_stream)
......@@ -2056,9 +2056,9 @@ class Timeline(Signallable, Loggable):
# Exclude objects that start after current position.
for obj in self.timeline_objects:
tl_objs.append(obj)
if obj.start > time:
break
tl_objs.append(obj)
if obj.start > time:
break
keyframe_positions = self._getKeyframePositions(tl_objs)
for n in range(len(keyframe_positions) -1, -1, -1):
......@@ -2079,8 +2079,8 @@ class Timeline(Signallable, Loggable):
keyframe_positions = self._getKeyframePositions(tl_objs)
for n in range(0, len(keyframe_positions)):
if keyframe_positions[n] > time:
return keyframe_positions[n]
if keyframe_positions[n] > time:
return keyframe_positions[n]
return None
......
......@@ -389,8 +389,8 @@ class EffectProperties(gtk.HBox):
def _treeviewSelectionChangedCb(self, treeview):
if self.selection.count_selected_rows() == 0 and self.timeline_objects:
self.app.gui.setActionsSensitive(['DeleteObj'], True)
self._removeEffectBt.set_sensitive(False)
self.app.gui.setActionsSensitive(['DeleteObj'], True)
self._removeEffectBt.set_sensitive(False)
else:
self.app.gui.setActionsSensitive(['DeleteObj'], False)
self._removeEffectBt.set_sensitive(True)
......
......@@ -201,4 +201,3 @@ def set_combo_value(combo, value, default_index=-1):
def get_combo_value(combo):
active = combo.get_active()
return combo.props.model[active][1]
......@@ -319,7 +319,7 @@ class FractionWidget(TextWidget, DynamicWidget):
strval = "%g:%g" % (preset.num, preset.denom)
fpreset = float(preset)
if self.low <= fpreset and fpreset <= self.high:
choices.append(strval)
choices.append(strval)
self.addChoices(choices)
......
......@@ -204,30 +204,30 @@ class EffectList(gtk.VBox, Loggable):
hsearch.show_all()
def _addMenuItems(self, uiman):
view_menu_item = uiman.get_widget('/MainMenuBar/View')
view_menu = view_menu_item.get_submenu()
seperator = gtk.SeparatorMenuItem()
self.treeview_menuitem = gtk.RadioMenuItem(None,
_("Show Video Effects as a List"))
self.iconview_menuitem = gtk.RadioMenuItem(self.treeview_menuitem,
_("Show Video Effects as Icons"))
if self.settings.lastEffectView == SHOW_TREEVIEW:
self.treeview_menuitem.set_active(True)
self.iconview_menuitem.set_active(False)
else:
self.treeview_menuitem.set_active(False)
self.iconview_menuitem.set_active(True)
self.treeview_menuitem.connect("toggled", self._treeViewMenuItemToggledCb)
view_menu.append(seperator)
view_menu.append(self.treeview_menuitem)
view_menu.append(self.iconview_menuitem)
self.treeview_menuitem.show()
self.iconview_menuitem.show()
seperator.show()
self.effect_view = self.settings.lastEffectView
view_menu_item = uiman.get_widget('/MainMenuBar/View')
view_menu = view_menu_item.get_submenu()
seperator = gtk.SeparatorMenuItem()
self.treeview_menuitem = gtk.RadioMenuItem(None,
_("Show Video Effects as a List"))
self.iconview_menuitem = gtk.RadioMenuItem(self.treeview_menuitem,
_("Show Video Effects as Icons"))
if self.settings.lastEffectView == SHOW_TREEVIEW:
self.treeview_menuitem.set_active(True)
self.iconview_menuitem.set_active(False)
else:
self.treeview_menuitem.set_active(False)
self.iconview_menuitem.set_active(True)
self.treeview_menuitem.connect("toggled", self._treeViewMenuItemToggledCb)
view_menu.append(seperator)
view_menu.append(self.treeview_menuitem)
view_menu.append(self.iconview_menuitem)
self.treeview_menuitem.show()
self.iconview_menuitem.show()
seperator.show()
self.effect_view = self.settings.lastEffectView
def _addFactories(self, elements, effectType):
for element in elements:
......@@ -363,10 +363,10 @@ class EffectList(gtk.VBox, Loggable):
self._dragStarted = True
if self.effect_view is SHOW_TREEVIEW:
if chain_up:
gtk.TreeView.do_button_press_event(view, event)
else:
view.grab_focus()
if chain_up:
gtk.TreeView.do_button_press_event(view, event)
else:
view.grab_focus()
return False
......@@ -463,7 +463,7 @@ class EffectList(gtk.VBox, Loggable):
return not bool(view.get_path_at_pos(int(event.x), int(event.y)))
def _getDndTuple(self):
if self.effectType.get_active() == VIDEO_EFFECT:
if self.effectType.get_active() == VIDEO_EFFECT:
return [dnd.VIDEO_EFFECT_TUPLE, dnd.EFFECT_TUPLE]
else:
else:
return [dnd.AUDIO_EFFECT_TUPLE, dnd.EFFECT_TUPLE]
......@@ -54,7 +54,7 @@ class EncodingProgressDialog(Signallable):
# UI widgets
self.window.set_icon_from_file(configure.get_pixmap_dir() + "/pitivi-render-16.png")
# FIXME: re-enable these widgets when bugs #650710 and 637079 are fixed
self.play_pause_button.hide()
self.table1.hide()
......
......@@ -241,8 +241,8 @@ class PreviewWidget(gtk.VBox, Loggable):
self.bbox.show()
def show_error(self, uri):
self.l_error.show()
self.b_details.show()
self.l_error.show()
self.b_details.show()
def clear_preview(self):
self.log("Reset PreviewWidget ")
......
......@@ -181,4 +181,3 @@ class AudioPresetManager(PresetManager):
parser.set(section, "channels", str(values["channels"]))
parser.set(section, "depth", str(values["depth"]))
parser.set(section, "sample-rate", str(values["sample-rate"]))
......@@ -560,4 +560,3 @@ class RandomAccessAudioPreviewer(RandomAccessPreviewer):
def _showWaveformsChanged(self, settings):
self._view = settings.showWaveforms
self.emit("update", None)
......@@ -122,4 +122,3 @@ class RippleUpdateGroup(object):
# enqueue children
queue.extend(((cur, v) for v in self.arcs[cur]))
......@@ -220,5 +220,3 @@ class TestGap(TestCase):
( 0 * gst.SECOND, 1 * gst.SECOND),
(12 * gst.SECOND, 2 * gst.SECOND),
])
......@@ -320,4 +320,3 @@ class TestPipeline(TestCase):
if __name__ == "__main__":
main()
......@@ -81,4 +81,3 @@ class TestSeeker(TestCase):
# timeout with None position
seeker._seekTimeoutCb()
......@@ -158,4 +158,3 @@ class TestStillImage(TestCase):
self.configureStreams(range(4), [0, self.clip_duration // 2, self.clip_duration, (3 * self.clip_duration) // 2])
self.startRender()
self.cleanUp()
......@@ -279,4 +279,3 @@ class TestStreamGroupMatching(TestCase):
group_b = [stream5, stream6, stream4]
best_map = match_stream_groups(group_a, group_b)
self.failUnlessEqual(known_best_map, best_map)
......@@ -315,4 +315,3 @@ class TestTimelineSourceFactoryPipeline(MainLoopTestCase):
pipeline.set_state(gst.STATE_NULL)
factory.clean()
......@@ -386,12 +386,12 @@ class TestUndoableActionLog(TestCase):
self.n = n
def do(self):
call_sequence.append("do%s" % self.n)
self._done()
call_sequence.append("do%s" % self.n)
self._done()
def undo(self):
call_sequence.append("undo%s" % self.n)
self._undone()
call_sequence.append("undo%s" % self.n)
self._undone()
action1 = Action(1)
action2 = Action(2)
......@@ -415,4 +415,3 @@ class TestUndoableActionLog(TestCase):
call_sequence[:] = []
self.log.undo()
self.failUnlessEqual(call_sequence, ["undo3", "undo2", "undo1"])
......@@ -51,4 +51,3 @@ class TestBeautifyLength(TestCase):
def testBeautifyHoursAndMinutes(self):
self.failUnlessEqual(beautify_length(hour + minute + second),
"1 hour, 1 minute")
......@@ -94,5 +94,3 @@ w.add(b)
w.show_all()
w.connect("destroy", gtk.main_quit)
gtk.main()
......@@ -88,7 +88,7 @@ class Deploy():
for path in [self.dist_dir, self.dist_bin_dir, self.dist_etc_dir,
self.dist_share_dir, self.dist_lib_pitivi_dir,
self.dist_share_pixmaps_dir]:
os.makedirs(path)
os.makedirs(path)
def checkDependencies(self):
print ('Checking dependencies')
......@@ -110,10 +110,10 @@ class Deploy():
import gtk.gdk
import gobject
except ImportError:
self.close('IMPORT_ERROR: Could not find the Gtk Python bindings.\n'
'You can download the installers at:\n'
'http://www.pygtk.org/\n'
'http://www.gtk.org/')
self.close('IMPORT_ERROR: Could not find the Gtk Python bindings.\n'
'You can download the installers at:\n'
'http://www.pygtk.org/\n'
'http://www.gtk.org/')
else:
print ('Gtk... OK')
......@@ -220,5 +220,3 @@ def main():
if __name__ == "__main__":
main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment