Commit 3a3d2ab5 authored by Thibault Saunier's avatar Thibault Saunier Committed by Jean-François Fortin Tam

pitivi: All pep8 compliant

parent 79133213
......@@ -447,10 +447,10 @@ class SourceFactory(ObjectFactory):
caps_copy = gst.Caps(caps)
for structure in caps_copy:
# remove framerate as we don't adjust framerate here
if structure.has_key("framerate"):
if structure.has_field("framerate"):
del structure["framerate"]
# remove format as we will have converted to AYUV/ARGB
if structure.has_key("format"):
if structure.has_field("format"):
del structure["format"]
if b is None:
for bin in self.bins:
......
......@@ -74,9 +74,9 @@ def _importAndCheckStack(importName):
excType, excValue, excTraceback = sys.exc_info()
while excTraceback:
execName = excTraceback.tb_frame.f_globals["__name__"]
if (execName is None or # python 2.4+, post-cleanup
execName == importName): # python 2.3, no cleanup
raise excType, excValue, excTraceback
if (execName is None or
execName == importName):
raise _NoModuleFound()
excTraceback = excTraceback.tb_next
raise _NoModuleFound()
except:
......
......@@ -448,7 +448,6 @@ class ExportSettings(Signallable, Loggable):
# TODO : Add PAR/DAR for video
# TODO : switch to using GstFraction internally where appliable
muxers, aencoders, vencoders = available_combinations()
def __init__(self, **unused_kw):
......
......@@ -22,6 +22,7 @@
import gtk
from pitivi.ui.common import SPACING
class BaseTabs(gtk.Notebook):
def __init__(self, app, hide_hpaned=False):
""" initialize """
......@@ -91,14 +92,14 @@ class BaseTabs(gtk.Notebook):
self.app.gui.mainhpaned.remove(self.app.gui.secondhpaned)
self.app.gui.secondhpaned.remove(self.app.gui.projecttabs)
self.app.gui.secondhpaned.remove(self.app.gui.propertiestabs)
self.app.gui.mainhpaned.pack1(self.app.gui.projecttabs, resize= True,
self.app.gui.mainhpaned.pack1(self.app.gui.projecttabs, resize=True,
shrink=False)
def _showSecondHpanedInMainWindow(self):
self.app.gui.mainhpaned.remove(self.app.gui.projecttabs)
self.app.gui.secondhpaned.pack1(self.app.gui.projecttabs,
resize= True, shrink=False)
resize=True, shrink=False)
self.app.gui.secondhpaned.pack2(self.app.gui.propertiestabs,
resize= True, shrink=False)
resize=True, shrink=False)
self.app.gui.mainhpaned.pack1(self.app.gui.secondhpaned,
resize= True, shrink=False)
resize=True, shrink=False)
......@@ -43,10 +43,12 @@ from pitivi.ui import dynamic
COL_DESC_TEXT,
COL_TRACK_EFFECT) = range(5)
class ClipPropertiesError(Exception):
"""Base Exception for errors happening in L{ClipProperties}s or L{EffectProperties}s"""
pass
class ClipProperties(gtk.VBox, Loggable):
"""
Widget for configuring clips properties
......@@ -98,6 +100,7 @@ class ClipProperties(gtk.VBox, Loggable):
return label, info_bar
class EffectProperties(gtk.HBox):
"""
Widget for viewing and configuring effects
......@@ -118,7 +121,7 @@ class EffectProperties(gtk.HBox):
self.pipeline = None
self.effect_props_handling = effect_properties_handling
self.clip_properties = clip_properties
self._info_bar = None
self._info_bar = None
self._config_ui_h_pos = None
self._timeline = None
......@@ -158,8 +161,8 @@ class EffectProperties(gtk.HBox):
activatedcol = self.treeview.insert_column_with_attributes(-1,
_("Activated"),
activatedcell,
active = COL_ACTIVATED)
activatedcell.connect("toggled", self._effectActiveToggleCb)
active=COL_ACTIVATED)
activatedcell.connect("toggled", self._effectActiveToggleCb)
typecol = gtk.TreeViewColumn(_("Type"))
typecol.set_sort_column_id(COL_TYPE)
......@@ -399,7 +402,7 @@ class EffectProperties(gtk.HBox):
self._config_ui_h_pos =\
self.app.gui.settings.effectVPanedPosition
if self._config_ui_h_pos is None:
self._config_ui_h_pos=\
self._config_ui_h_pos =\
self.app.gui.settings.mainWindowHeight // 3
if self.selection.get_selected()[1]:
track_effect = self.storemodel.get_value(self.selection.get_selected()[1],
......
......@@ -18,6 +18,7 @@ TRACK_SPACING = 8
SPACING = 6
PADDING = 6
def pack_color_32(red, green, blue, alpha=0xFFFF):
"""Packs the specified 16bit color values in a 32bit RGBA value."""
red = red >> 8
......@@ -26,10 +27,12 @@ def pack_color_32(red, green, blue, alpha=0xFFFF):
alpha = alpha >> 8
return (red << 24 | green << 16 | blue << 8 | alpha)
def pack_color_64(red, green, blue, alpha=0xFFFF):
"""Packs the specified 16bit color values in a 64bit RGBA value."""
return (red << 48 | green << 32 | blue << 16 | alpha)
def unpack_color(value):
"""Unpacks the specified RGBA value into four 16bit color values.
......@@ -41,6 +44,7 @@ def unpack_color(value):
else:
return unpack_color_64(value)
def unpack_color_32(value):
"""Unpacks the specified 32bit RGBA value into four 16bit color values."""
red = (value >> 24) << 8
......@@ -49,6 +53,7 @@ def unpack_color_32(value):
alpha = (value & 0xFF) << 8
return red, green, blue, alpha
def unpack_color_64(value):
"""Unpacks the specified 64bit RGBA value into four 16bit color values."""
red = (value >> 48) & 0xFFFF
......@@ -57,6 +62,7 @@ def unpack_color_64(value):
alpha = value & 0xFFFF
return red, green, blue, alpha
def unpack_cairo_pattern(value):
"""Transforms the specified RGBA value into a SolidPattern object."""
red, green, blue, alpha = unpack_color(value)
......@@ -66,6 +72,7 @@ def unpack_cairo_pattern(value):
blue / 65535.0,
alpha / 65535.0)
def unpack_cairo_gradient(value):
"""Creates a LinearGradient object out of the specified RGBA value."""
red, green, blue, alpha = unpack_color(value)
......@@ -84,8 +91,10 @@ def unpack_cairo_gradient(value):
alpha / 65535.0)
return gradient
def beautify_factory(factory):
ranks = {VideoStream: 0, AudioStream: 1, TextStream: 2, MultimediaStream: 3}
def stream_sort_key(stream):
return ranks[type(stream)]
......@@ -94,6 +103,7 @@ def beautify_factory(factory):
return ("<b>" + escape(unquote(factory.name)) + "</b>\n" +
"\n".join((beautify_stream(stream) for stream in streams)))
def factory_name(factory):
return escape(unquote(factory.name))
......@@ -113,7 +123,7 @@ def beautify_stream(stream):
if stream.raw:
if stream.framerate.num:
templ = _("<b>Video:</b> %d x %d <i>pixels</i> at %.2f<i>fps</i>")
templ = templ % (stream.par * stream.width , stream.height,
templ = templ % (stream.par * stream.width, stream.height,
float(stream.framerate))
else:
templ = _("<b>Image:</b> %d x %d <i>pixels</i>")
......@@ -126,8 +136,9 @@ def beautify_stream(stream):
raise NotImplementedError
# from http://cairographics.org/cookbook/roundedrectangles/
def roundedrec(context,x,y,w,h,r = 10):
def roundedrec(context, x, y, w, h, r=10):
"Draw a rounded rectangle"
# A****BQ
# H C
......@@ -135,17 +146,20 @@ def roundedrec(context,x,y,w,h,r = 10):
# G D
# F****E
context.move_to(x+r,y) # Move to A
context.line_to(x+w-r,y) # Straight line to B
context.curve_to(x+w,y,x+w,y,x+w,y+r) # Curve to C, Control points are both at Q
context.line_to(x+w,y+h-r) # Move to D
context.curve_to(x+w,y+h,x+w,y+h,x+w-r,y+h) # Curve to E
context.line_to(x+r,y+h) # Line to F
context.curve_to(x,y+h,x,y+h,x,y+h-r) # Curve to G
context.line_to(x,y+r) # Line to H
context.curve_to(x,y,x,y,x+r,y) # Curve to A
context.move_to(x + r, y) # Move to A
context.line_to(x + w - r, y) # Straight line to B
# Curve to C, Control points are both at Q
context.curve_to(x + w, y, x + w, y, x + w, y + r)
context.line_to(x + w, y + h - r) # Move to D
context.curve_to(x + w, y + h, x + w, y + h, x + w - r, y + h) # Curve to E
context.line_to(x + r, y + h) # Line to F
context.curve_to(x, y + h, x, y + h, x, y + h - r) # Curve to G
context.line_to(x, y + r) # Line to H
context.curve_to(x, y, x, y, x + r, y) # Curve to A
return
def model(columns, data):
ret = gtk.ListStore(*columns)
for datum in data:
......@@ -168,16 +182,16 @@ frame_rates = model((str, object), (
))
audio_rates = model((str, int), (
(_("8 KHz"), 8000),
(_("11 KHz"), 11025),
(_("22 KHz"), 22050),
(_("8 KHz"), 8000),
(_("11 KHz"), 11025),
(_("22 KHz"), 22050),
(_("44.1 KHz"), 44100),
(_("48 KHz"), 48000),
(_("96 KHz"), 96000)
(_("48 KHz"), 48000),
(_("96 KHz"), 96000)
))
audio_depths = model((str, int), (
(_("8 bit"), 8),
(_("8 bit"), 8),
(_("16 bit"), 16),
(_("24 bit"), 24),
(_("32 bit"), 32)
......@@ -190,6 +204,7 @@ audio_channels = model((str, int), (
(_("Mono"), 1)
))
def set_combo_value(combo, value, default_index=-1):
model = combo.props.model
for i, row in enumerate(model):
......@@ -198,6 +213,7 @@ def set_combo_value(combo, value, default_index=-1):
return
combo.set_active(default_index)
def get_combo_value(combo):
active = combo.get_active()
return combo.props.model[active][1]
......@@ -32,6 +32,7 @@ from pitivi.ui.point import Point
ARROW = gtk.gdk.Cursor(gtk.gdk.ARROW)
class Controller(object):
"""A controller which implements drag-and-drop bahavior on connected view
......
......@@ -35,6 +35,7 @@ from pitivi.ui.common import LAYER_HEIGHT_EXPANDED, roundedrec
import pitivi.ui.point as point
from pitivi.utils import between
def intersect(b1, b2):
return goocanvas.Bounds(max(b1.x1, b2.x1), max(b1.y1, b2.y1),
min(b1.x2, b2.x2), min(b1.y2, b2.y2))
......@@ -56,6 +57,7 @@ KW_LABEL_VPAD2 = KW_LABEL_VPAD / 2
CURVE_STROKE_WIDTH = 2.0
HAND = gtk.gdk.Cursor(gtk.gdk.HAND2)
class Curve(goocanvas.ItemSimple, goocanvas.Item, View, Zoomable):
__gtype_name__ = 'Curve'
......@@ -123,7 +125,7 @@ class Curve(goocanvas.ItemSimple, goocanvas.Item, View, Zoomable):
interpolator.range) + interpolator.lower
return time, value
def enter(self, item ,target):
def enter(self, item, target):
coords = self.from_item_event(item, self._last_event)
self._kf = self._view.findKeyframe(coords)
self._view.setFocusedKf(self._kf)
......@@ -151,7 +153,8 @@ class Curve(goocanvas.ItemSimple, goocanvas.Item, View, Zoomable):
def _get_height(self):
return self._height
def _set_height (self, value):
def _set_height(self, value):
self._height = value
self._min = CURVE_STROKE_WIDTH / 2
self._max = value - (CURVE_STROKE_WIDTH / 2)
......
......@@ -34,6 +34,7 @@ from pitivi.ui.common import unpack_color, pack_color_32, pack_color_64
import pango
from pitivi.ui.common import PADDING, SPACING
class DynamicWidget(object):
"""An interface which provides a uniform way to get, set, and observe
......@@ -60,15 +61,15 @@ class DynamicWidget(object):
if self.default is not None:
self.setWidgetValue(self.default)
class DefaultWidget(gtk.Label, DynamicWidget):
"""When all hope fails...."""
def __init__(self, default = None, *unused, **kw_unused):
def __init__(self, default=None, *unused, **kw_unused):
gtk.Label.__init__(self, _("Implement Me"))
DynamicWidget.__init__(self, default)
def connectValueChanged(self, callback, *args):
pass
......@@ -87,7 +88,7 @@ class TextWidget(gtk.HBox, DynamicWidget):
__gtype_name__ = 'TextWidget'
__gsignals__ = {
"value-changed" : (
"value-changed": (
gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
(),)
......@@ -96,7 +97,7 @@ class TextWidget(gtk.HBox, DynamicWidget):
__INVALID__ = gtk.gdk.Color(0xFFFF, 0, 0)
__NORMAL__ = gtk.gdk.Color(0, 0, 0)
def __init__(self, matches = None, choices = None, default = None):
def __init__(self, matches=None, choices=None, default=None):
gtk.HBox.__init__(self)
DynamicWidget.__init__(self, default)
......@@ -128,7 +129,7 @@ class TextWidget(gtk.HBox, DynamicWidget):
def connectValueChanged(self, callback, *args):
return self.connect("value-changed", callback, *args)
def setWidgetValue(self, value, send_signal = True):
def setWidgetValue(self, value, send_signal=True):
self.send_signal = send_signal
self.text.set_text(value)
......@@ -177,7 +178,7 @@ class NumericWidget(gtk.HBox, DynamicWidget):
SpinButton is always displayed, while the HScale only appears if both
lower and upper bounds are defined"""
def __init__(self, upper = None, lower = None, default=None):
def __init__(self, upper=None, lower=None, default=None):
gtk.HBox.__init__(self)
DynamicWidget.__init__(self, default)
......@@ -234,6 +235,7 @@ class NumericWidget(gtk.HBox, DynamicWidget):
self.adjustment.set_all(value, minimum, maximum, step, page, 0)
self.spinner.set_adjustment(self.adjustment)
class TimeWidget(TextWidget, DynamicWidget):
""" A widget that contains a time in nanosconds"""
......@@ -255,13 +257,13 @@ class TimeWidget(TextWidget, DynamicWidget):
+ int(ss) * 10e9 \
+ int(xxx) * 10e6
nanosecs = nanosecs / 10 # Compensate the 10 factor of e notation
nanosecs = nanosecs / 10 # Compensate the 10 factor of e notation
return nanosecs
def setWidgetValue(self, value, send_signal = True):
def setWidgetValue(self, value, send_signal=True):
TextWidget.setWidgetValue(self, time_to_string(value),
send_signal = send_signal)
send_signal=send_signal)
def connectFocusEvents(self, focusInCb, focusOutCb):
fIn = self.text.connect("button-press-event", focusInCb)
......@@ -355,6 +357,7 @@ class FractionWidget(TextWidget, DynamicWidget):
denom = float(groups[2][1:])
return gst.Fraction(num, denom)
class ToggleWidget(gtk.CheckButton, DynamicWidget):
"""A gtk.CheckButton which supports the DynamicWidget interface."""
......@@ -372,6 +375,7 @@ class ToggleWidget(gtk.CheckButton, DynamicWidget):
def getWidgetValue(self):
return self.get_active()
class ChoiceWidget(gtk.HBox, DynamicWidget):
"""Abstractly, represents a choice between a list of named values. The
......@@ -414,6 +418,7 @@ class ChoiceWidget(gtk.HBox, DynamicWidget):
else:
self.contents.set_sensitive(True)
class PresetChoiceWidget(gtk.HBox, DynamicWidget):
"""A popup which manages preset settings on a group of widgets supporting
......@@ -547,17 +552,17 @@ class PathWidget(gtk.FileChooserButton, DynamicWidget):
__gtype_name__ = 'PathWidget'
__gsignals__ = {
"value-changed" : (gobject.SIGNAL_RUN_LAST,
"value-changed": (gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
()),
}
def __init__(self, action = gtk.FILE_CHOOSER_ACTION_OPEN, default=None):
def __init__(self, action=gtk.FILE_CHOOSER_ACTION_OPEN, default=None):
DynamicWidget.__init__(self, default)
self.dialog = gtk.FileChooserDialog(
action = action,
buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_CLOSE,
gtk.RESPONSE_CLOSE))
action=action,
buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_CLOSE,
gtk.RESPONSE_CLOSE))
self.dialog.set_default_response(gtk.RESPONSE_OK)
gtk.FileChooserButton.__init__(self, self.dialog)
self.set_title(_("Choose..."))
......@@ -580,9 +585,10 @@ class PathWidget(gtk.FileChooserButton, DynamicWidget):
self.emit("value-changed")
self.dialog.hide()
class ColorWidget(gtk.ColorButton, DynamicWidget):
def __init__(self, value_type=str, default= None):
def __init__(self, value_type=str, default=None):
gtk.ColorButton.__init__(self)
DynamicWidget.__init__(self, default)
self.value_type = value_type
......@@ -619,9 +625,10 @@ class ColorWidget(gtk.ColorButton, DynamicWidget):
return color
return color.to_string()
class FontWidget(gtk.FontButton, DynamicWidget):
def __init__(self, default = None):
def __init__(self, default=None):
gtk.FontButton.__init__(self)
DynamicWidget.__init__(self, default)
self.set_use_font(True)
......@@ -635,9 +642,10 @@ class FontWidget(gtk.FontButton, DynamicWidget):
def getWidgetValue(self):
return self.get_font_name()
class ResolutionWidget(gtk.HBox, DynamicWidget):
def __init__(self, default = None):
def __init__(self, default=None):
gtk.HBox.__init__(self)
DynamicWidget.__init__(self, default)
self.props.spacing = 6
......@@ -695,11 +703,7 @@ if __name__ == '__main__':
gst.Fraction(1, 1),
gst.Fraction(30000, 1001)
),
(
"25:1",
gst.Fraction(30,1),
"30M",
),
("25:1", gst.Fraction(30, 1), "30M", ),
)
),
)
......
......@@ -57,6 +57,7 @@ GlobalSettings.addConfigOption('lastEffectView',
INVISIBLE = gtk.gdk.pixbuf_new_from_file(os.path.join(get_pixmap_dir(),
"invisible.png"))
class EffectList(gtk.VBox, Loggable):
""" Widget for listing effects """
......@@ -77,7 +78,6 @@ class EffectList(gtk.VBox, Loggable):
self._current_effect_name = None
self._current_tooltip_icon = None
#Searchbox and combobox
hfilters = gtk.HBox()
hfilters.set_spacing(SPACING)
......@@ -88,7 +88,6 @@ class EffectList(gtk.VBox, Loggable):
self.effectCategory = gtk.combo_box_new_text()
self.effectType.set_active(VIDEO_EFFECT)
hfilters.pack_start(self.effectType, expand=True)
hfilters.pack_end(self.effectCategory, expand=True)
......@@ -169,14 +168,14 @@ class EffectList(gtk.VBox, Loggable):
self.treeview.connect("motion-notify-event", self._motionNotifyEventCb)
self.treeview.connect("query-tooltip", self._queryTooltipCb)
self.treeview.connect("button-release-event", self._buttonReleaseCb)
self.treeview.drag_source_set(0,[], gtk.gdk.ACTION_COPY)
self.treeview.drag_source_set(0, [], gtk.gdk.ACTION_COPY)
self.treeview.connect("drag_begin", self._dndDragBeginCb)
self.treeview.connect("drag_data_get", self._dndDataGetCb)
self.iconview.connect("button-press-event", self._buttonPressEventCb)
self.iconview.connect("activate-cursor-item", self._enterPressEventCb)
self.iconview.connect("query-tooltip", self._queryTooltipCb)
self.iconview.drag_source_set(0,[], gtk.gdk.ACTION_COPY)
self.iconview.drag_source_set(0, [], gtk.gdk.ACTION_COPY)
self.iconview.connect("motion-notify-event", self._motionNotifyEventCb)
self.iconview.connect("button-release-event", self._buttonReleaseCb)
self.iconview.connect("drag_begin", self._dndDragBeginCb)
......@@ -231,9 +230,9 @@ class EffectList(gtk.VBox, Loggable):
def _addFactories(self, elements, effectType):
for element in elements:
name =element.get_name()
name = element.get_name()
effect = self.app.effects.getFactoryFromName(name)
self.storemodel.append([ effect.getHumanName(),
self.storemodel.append([effect.getHumanName(),
effect.getDescription(), effectType,
effect.getCategories(),
effect, name,
......@@ -297,7 +296,7 @@ class EffectList(gtk.VBox, Loggable):
return view.path_is_selected(path) and len(selection)
return False
def _enterPressEventCb(self, view, event = None):
def _enterPressEventCb(self, view, event=None):
factory_name = self.getSelectedItems()
self.app.gui.clipconfig.effect_expander.addEffectToCurrentSelection(factory_name)
......@@ -395,7 +394,7 @@ class EffectList(gtk.VBox, Loggable):
txt = "<b>%s:</b>\n%s" % (longname, description)
if self.effect_view == SHOW_ICONVIEW:
tooltip.set_icon(None)
else :
else:
tooltip.set_icon(self._current_tooltip_icon)
tooltip.set_markup(txt)
......@@ -434,10 +433,10 @@ class EffectList(gtk.VBox, Loggable):
def _effectCategoryChangedCb(self, combobox):
self.modelFilter.refilter()
def searchEntryChangedCb (self, entry):
def searchEntryChangedCb(self, entry):
self.modelFilter.refilter()
def searchEntryIconClickedCb (self, entry, unused, unsed1):
def searchEntryIconClickedCb(self, entry, unused, unsed1):
entry.set_text("")
def searchEntryDesactvateCb(self, entry, event):
......
......@@ -27,6 +27,7 @@ from pitivi.ui.dynamic import FractionWidget
PROPS_TO_IGNORE = ['name', 'qos', 'silent', 'message']
class EffectsPropertiesHandling:
def __init__(self, action_log):
self.cache_dict = {}
......@@ -65,7 +66,7 @@ class EffectsPropertiesHandling:
return self.cache_dict[effect]
def cleanCache(self, effect):
if self.cache_dict.has_key(effect):
if effect in self.cache_dict:
conf_ui = self.cache_dict.get(effect)
self.cache_dict.pop(effect)
return conf_ui
......@@ -97,7 +98,7 @@ class EffectsPropertiesHandling:
#FIXME Workaround in order to make aspectratiocrop working
if isinstance(value, gst.Fraction):
value = gst.Fraction(int(value.num),int(value.denom))
value = gst.Fraction(int(value.num), int(value.denom))
if value != self._current_element_values.get(prop.name):
self.action_log.begin("Effect property change")
......
......@@ -61,7 +61,7 @@ def extension_for_muxer(muxer):
"""Returns the file extension appropriate for the specified muxer."""
exts = {
"asfmux": "asf",
"avimux" : "avi",
"avimux": "avi",
"ffmux_3g2": "3g2",
"ffmux_avm2": "avm2",
"ffmux_dvd": "vob",
......@@ -77,15 +77,15 @@ def extension_for_muxer(muxer):
"ffmux_vob": "vob",
"flvmux": "flv",
"gppmux": "3gp",
"matroskamux" : "mkv",
"matroskamux": "mkv",
"mj2mux": "mj2",
"mp4mux": "mp4",
"mpegpsmux": "mpeg",
"mpegtsmux": "mpeg",
"mvemux": "mve",
"mxfmux" : "mxf",
"oggmux" : "ogv",
"qtmux" : "mov",
"mxfmux": "mxf",
"oggmux": "ogv",
"qtmux": "mov",
"webmmux": "webm"}
return exts.get(muxer)
......@@ -93,7 +93,7 @@ def extension_for_muxer(muxer):
def factorylist(factories):
"""Create a gtk.ListStore() of sorted, beautified factory names.
@param factories: The factories available for creating the list.
@param factories: The factories available for creating the list.
@type factories: A sequence of gst.ElementFactory instances.
"""
columns = (str, object)
......@@ -371,7 +371,7 @@ class EncodingDialog(Renderer, Loggable):
self.outfile = os.path.join(self.filebutton.get_uri(),
self.fileentry.get_text())
self.progress = EncodingProgressDialog(self.app, self)
self.window.hide() # Hide the rendering settings dialog while rendering
self.window.hide() # Hide the rendering settings dialog while rendering
self.progress.window.show()
self.startAction()
self.progress.connect("cancel", self._cancelRender)
......
......@@ -31,6 +31,7 @@ from gettext import gettext as _
import gobject
from pitivi.signalinterface import Signallable
class EncodingProgressDialog(Signallable):
__signals__ = {
"pause": [],
......
......@@ -146,7 +146,7 @@ class PreviewWidget(gtk.VBox, Loggable):
self.log("Preview request for " + uri)
self.clear_preview()
self.current_selected_uri = uri
if uri in self.preview_cache: # Already discovered
if uri in self.preview_cache: # Already discovered
self.log(uri + " already in cache")
self.show_preview(uri)
elif uri in self.preview_cache_errors:
......@@ -208,7 +208,7 @@ class PreviewWidget(gtk.VBox, Loggable):
self.player.set_state(gst.STATE_PAUSED)
self.clip_duration = factory.duration
self.pos_adj.upper = self.clip_duration
w, h = self.__get_best_size(video.par*video.width, video.height)
w, h = self.__get_best_size(video.par * video.width, video.height)
self.preview_video.set_size_request(w, h)
self.preview_video.show()
self.bbox.show()
......@@ -216,8 +216,8 @@ class PreviewWidget(gtk.VBox, Loggable):
self.seeker.show()
self.b_zoom_in.show()
self.b_zoom_out.show()
self.description = _("<b>Resolution</b>: %dx%d") % (video.par*video.width, video.height) + "\n" + \
_("<b>Duration</b>: %s") % (duration) + "\n"
self.description = _("<b>Resolution</b>: %dx%d") % (video.par * video.width,
video.height) + "\n" + _("<b>Duration</b>: %s") % (duration) + "\n"
else:
self.current_preview_type = 'audio'
self.preview_video.hide()
......
......@@ -34,6 +34,7 @@ from pitivi.configure import get_ui_dir
from pitivi.signalinterface import Signallable
from pitivi.log.loggable import Loggable
class FileListErrorDialog(Signallable, Loggable):
""" Dialog box for showing errors in a list of files """
__signals__ = {
......@@ -78,7 +79,6 @@ class FileListErrorDialog(Signallable, Loggable):
else:
exp = gtk.Expander(reason)
textbuffer = gtk.TextBuffer()
table = textbuffer.get_tag_table()
boldtag = gtk.TextTag()
......
......@@ -33,6 +33,7 @@ from pitivi.log.loggable import Loggable
from pitivi.configure import get_ui_dir
import pitivi.ui.dynamic as dynamic
def make_property_widget(unused_element, prop, value=None):
""" Creates a Widget for the given element property """
# FIXME : implement the case for flags
......@@ -45,7 +46,7 @@ def make_property_widget(unused_element, prop, value=None):
elif (type_name in ['guint64', 'gint64', 'guint', 'gint', 'gfloat',
'gulong', 'gdouble']):
maximum , minimum = None, None
maximum, minimum = None, None
if hasattr(prop, "minimum"):
minimum = prop.minimum
if hasattr(prop, "maximum"):
......@@ -70,6 +71,7 @@ def make_property_widget(unused_element, prop, value=None):
return widget
class GstElementSettingsWidget(gtk.VBox, Loggable):
"""
Widget to view/modify properties of a gst.Element
......@@ -84,7 +86,7 @@ class GstElementSettingsWidget(gtk.VBox, Loggable):
self.buttons = {}
def setElement(self, element, properties={}, ignore=['name'],