[pitivi] Debug: Use ',' insted of '%' so that we avoid inte
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi] Debug: Use ',' insted of '%' so that we avoid inte
- Date: Tue, 3 Mar 2009 05:51:29 -0500 (EST)
commit 511a47739c147d2a142d4d472782596c929ebccb
Author: Edward Hervey <bilboed bilboed com>
Date: Tue Mar 3 11:47:05 2009 +0100
Debug: Use ',' insted of '%' so that we avoid interpreting arguments if we don't output debug.
---
pitivi/action.py | 2 +-
pitivi/application.py | 2 +-
pitivi/device.py | 12 ++++++------
pitivi/discoverer.py | 22 +++++++++++-----------
pitivi/encode.py | 16 ++++++++--------
pitivi/factories/base.py | 8 ++++----
pitivi/factories/file.py | 6 +++---
pitivi/pipeline.py | 10 +++++-----
pitivi/plumber.py | 2 +-
pitivi/previewer.py | 7 +++++--
pitivi/project.py | 18 +++++++++---------
pitivi/settings.py | 4 ++--
pitivi/sourcelist.py | 4 ++--
pitivi/threads.py | 6 +++---
pitivi/ui/filelisterrordialog.py | 2 +-
pitivi/ui/gstwidget.py | 8 ++++----
pitivi/ui/mainwindow.py | 9 ++++++---
pitivi/ui/netstream_managerdialog.py | 1 -
pitivi/ui/ruler.py | 2 +-
pitivi/ui/sourcelist.py | 14 +++++++-------
pitivi/ui/viewer.py | 32 ++++++++++++++++----------------
21 files changed, 96 insertions(+), 91 deletions(-)
diff --git a/pitivi/action.py b/pitivi/action.py
index 5ea179b..b574c29 100644
--- a/pitivi/action.py
+++ b/pitivi/action.py
@@ -430,7 +430,7 @@ class Action(object, Signallable, Loggable):
compat = consumer.getInputStreams(type(producer_stream))
# in case of ambiguity, raise an exception
if len(compat) > 1:
- self.warning("%r" % compat)
+ self.warning("%r", compat)
raise ActionError("Too many compatible streams in consumer")
if len(compat) == 1:
self.debug(" Got a compatible stream !")
diff --git a/pitivi/application.py b/pitivi/application.py
index 2b66a8e..608dfd4 100644
--- a/pitivi/application.py
+++ b/pitivi/application.py
@@ -134,7 +134,7 @@ class Pitivi(object, Loggable, Signallable):
def loadProject(self, uri=None, filepath=None):
""" Load the given file through it's uri or filepath """
- self.info("uri:%s, filepath:%s" % (uri, filepath))
+ self.info("uri:%s, filepath:%s", uri, filepath)
if not uri and not filepath:
self.emit("new-project-failed", _("No location given."),
uri)
diff --git a/pitivi/device.py b/pitivi/device.py
index 1d0c481..334ad68 100644
--- a/pitivi/device.py
+++ b/pitivi/device.py
@@ -187,7 +187,7 @@ class HalDeviceProbe(DeviceProbe):
info = devobject.GetProperty("info.product")
srcdev = V4LSourceDeviceFactory(device=location,
displayname=info)
- self.debug("Valid source %r" % dev)
+ self.debug("Valid source %r", dev)
self._sources['video'][device_udi] = srcdev
self.emit("device-added", srcdev)
elif devobject.QueryCapability("alsa"):
@@ -197,24 +197,24 @@ class HalDeviceProbe(DeviceProbe):
device = devobject.GetProperty("alsa.device")
info = devobject.GetProperty("alsa.card_id")
if alsatype == "capture":
- self.debug("Valid source %r" % dev)
+ self.debug("Valid source %r", dev)
self._sources['audio'][device_udi] = AlsaSourceDeviceFactory(card=card,
device=device,
displayname=info)
self.emit("device-added", self._sources['audio'][device_udi])
elif alsatype == "playback":
- self.debug("Valid sink %r" % dev)
+ self.debug("Valid sink %r", dev)
self._sinks[device_udi] = AlsaSinkDeviceFactory(card=card,
device=device,
displayname=info)
self.emit("device-added", self._sinks[device_udi])
def _deviceAddedCb(self, device_udi, *unused_args):
- self.debug("udi:%r" % device_udi)
+ self.debug("udi:%r", device_udi)
self._processUDI(device_udi)
def _deviceRemovedCb(self, device_udi, *unused_args):
- self.debug("udi:%r" % device_udi)
+ self.debug("udi:%r", device_udi)
for k in ('audio', 'video'):
if self._sources[k].has_key(device_udi):
dev = self._sources[k][device_udi]
@@ -329,4 +329,4 @@ class V4LSourceDeviceFactory(SourceDeviceFactory):
v.set_state(gst.STATE_NULL)
return
v.set_state(gst.STATE_NULL)
- self.warning("Could not probe %s" % self._device)
+ self.warning("Could not probe %s", self._device)
diff --git a/pitivi/discoverer.py b/pitivi/discoverer.py
index fc00389..d9db400 100644
--- a/pitivi/discoverer.py
+++ b/pitivi/discoverer.py
@@ -100,18 +100,18 @@ class Discoverer(object, Signallable, Loggable):
if self.pipeline is not None:
self.info("before setting to NULL")
res = self.pipeline.set_state(gst.STATE_NULL)
- self.info("after setting to NULL : %s" % res)
+ self.info("after setting to NULL : %s", res)
def addFile(self, filename):
""" queue a filename to be discovered """
- self.info("filename: %s" % filename)
+ self.info("filename: %s", filename)
self.queue.append(filename)
if not self.working:
self._startAnalysis()
def addFiles(self, filenames):
""" queue a list of filenames to be discovered """
- self.info("filenames : %s" % filenames)
+ self.info("filenames : %s", filenames)
self.queue.extend(filenames)
if self.queue and not self.working:
self._startAnalysis()
@@ -213,7 +213,7 @@ class Discoverer(object, Signallable, Loggable):
self.emit('finished_analyzing', factory)
- self.info("Cleaning up after finished analyzing %s" % self.current_uri)
+ self.info("Cleaning up after finished analyzing %s", self.current_uri)
self._resetState()
self.queue.pop(0)
@@ -269,14 +269,14 @@ class Discoverer(object, Signallable, Loggable):
Sets up a pipeline to analyze the given uri
"""
self.current_uri = self.queue[0]
- self.info("Analyzing %s" % self.current_uri)
+ self.info("Analyzing %s", self.current_uri)
# setup graph and start analyzing
self.pipeline = gst.Pipeline("Discoverer-%s" % self.current_uri)
source = self._createSource()
if not source:
- self.warning("This is not a media file: %s" % self.current_uri)
+ self.warning("This is not a media file: %s", self.current_uri)
self.error = _("No available source handler.")
self.error_debug = _("You do not have a GStreamer source element to handle protocol '%s'") % gst.uri_get_protocol(self.current_uri)
self._finishAnalysis()
@@ -334,7 +334,7 @@ class Discoverer(object, Signallable, Loggable):
self._finishAnalysis()
def _busMessageElementCb(self, unused_bus, message):
- self.debug("Element message %s" % message.structure.to_string())
+ self.debug("Element message %s", message.structure.to_string())
if message.structure.get_name() == "redirect":
self.warning("We don't implement redirections currently, ignoring file")
if self.error is None:
@@ -355,7 +355,7 @@ class Discoverer(object, Signallable, Loggable):
return
state_change = message.parse_state_changed()
- self.log("%s:%s" % ( message.src, state_change))
+ self.log("%s:%s", message.src, state_change)
prev, new, pending = state_change
if prev == gst.STATE_READY and new == gst.STATE_PAUSED and \
@@ -370,7 +370,7 @@ class Discoverer(object, Signallable, Loggable):
self._finishAnalysis()
def _busMessageTagCb(self, unused_bus, message):
- self.debug("Got tags %s" % message.structure.to_string())
+ self.debug("Got tags %s", message.structure.to_string())
self.current_tags.append(message.parse_tag())
def _maybeQueryDuration(self, pad):
@@ -391,7 +391,7 @@ class Discoverer(object, Signallable, Loggable):
def _newVideoPadCb(self, pad, stream):
""" a new video pad was found """
- self.debug("pad %s" % pad)
+ self.debug("pad %s", pad)
queue = gst.element_factory_make("queue")
queue.props.max_size_bytes = 5 * 1024 * 1024
@@ -426,7 +426,7 @@ class Discoverer(object, Signallable, Loggable):
self._newVideoPadCb(ghost, stream)
def _newDecodedPadCb(self, unused_element, pad, is_last):
- self.info("pad:%s caps:%s is_last:%s" % (pad, pad.get_caps(), is_last))
+ self.info("pad:%s caps:%s is_last:%s", pad, pad.get_caps(), is_last)
# try to get the duration
# NOTE: this gets the duration only once, usually for the first stream.
diff --git a/pitivi/encode.py b/pitivi/encode.py
index 8350d32..24434b5 100644
--- a/pitivi/encode.py
+++ b/pitivi/encode.py
@@ -98,7 +98,7 @@ class RenderFactory(OperationFactory):
OperationFactory.__init__(self, *args, **kwargs)
# add input streams according to the settings
for i in range(len(settings.settings)):
- self.debug("Adding stream %d %r" % (i, settings.settings[i].input_stream))
+ self.debug("Adding stream %d %r", i, settings.settings[i].input_stream)
self.addInputStream(settings.settings[i].input_stream)
def _makeBin(self, *args):
@@ -201,16 +201,16 @@ def get_compatible_sink_pad(factoryname, caps):
"""
factory = gst.registry_get_default().lookup_feature(factoryname)
if factory == None:
- log.warning("encode","%s is not a valid factoryname" % factoryname)
+ log.warning("encode","%s is not a valid factoryname", factoryname)
return None
res = []
sinkpads = [x for x in factory.get_static_pad_templates() if x.direction == gst.PAD_SINK]
for p in sinkpads:
c = p.get_caps()
- log.log("encode","sinkcaps %s" % c.to_string())
+ log.log("encode","sinkcaps %s", c.to_string())
inter = caps.intersect(c)
- log.log("encode","intersection %s" % inter.to_string())
+ log.log("encode","intersection %s", inter.to_string())
if inter:
res.append(p.name_template)
if len(res) > 0:
@@ -221,18 +221,18 @@ def get_compatible_sink_caps(factoryname, caps):
"""
Returns the compatible caps between 'caps' and the sink pad caps of 'factoryname'
"""
- log.log("encode","factoryname : %s , caps : %s" % (factoryname, caps.to_string()))
+ log.log("encode","factoryname : %s , caps : %s", factoryname, caps.to_string())
factory = gst.registry_get_default().lookup_feature(factoryname)
if factory == None:
- log.warning("encode","%s is not a valid factoryname" % factoryname)
+ log.warning("encode","%s is not a valid factoryname", factoryname)
return None
res = []
sinkcaps = [x.get_caps() for x in factory.get_static_pad_templates() if x.direction == gst.PAD_SINK]
for c in sinkcaps:
- log.log("encode","sinkcaps %s" % c.to_string())
+ log.log("encode","sinkcaps %s", c.to_string())
inter = caps.intersect(c)
- log.log("encode","intersection %s" % inter.to_string())
+ log.log("encode","intersection %s", inter.to_string())
if inter:
res.append(inter)
diff --git a/pitivi/factories/base.py b/pitivi/factories/base.py
index d68cecd..639a3b3 100644
--- a/pitivi/factories/base.py
+++ b/pitivi/factories/base.py
@@ -66,7 +66,7 @@ class ObjectFactory(object, Signallable, Loggable):
def __init__(self, name="", displayname=""):
Loggable.__init__(self)
- self.info("name:%s" % name)
+ self.info("name:%s", name)
self.parent = None
self.name = name
self.displayname = displayname
@@ -227,9 +227,9 @@ class SourceFactory(ObjectFactory):
"""
compatible_stream = None
- self.debug("stream %r" % output_stream)
+ self.debug("stream %r", output_stream)
if output_stream is not None:
- self.debug("streams %r" % self.output_streams)
+ self.debug("streams %r", self.output_streams)
for stream in self.output_streams:
if output_stream.isCompatible(stream):
compatible_stream = stream
@@ -309,7 +309,7 @@ class SinkFactory(ObjectFactory):
@see: L{releaseBin}
"""
- self.debug("stream %r" % input_stream)
+ self.debug("stream %r", input_stream)
compatible_stream = None
if input_stream is not None:
self.debug("Streams %r", self.input_streams)
diff --git a/pitivi/factories/file.py b/pitivi/factories/file.py
index 5bc5125..d76d85b 100644
--- a/pitivi/factories/file.py
+++ b/pitivi/factories/file.py
@@ -44,7 +44,7 @@ class FileSourceFactory(URISourceFactoryMixin, RandomAccessSourceFactory):
RandomAccessSourceFactory.__init__(self, name, displayname)
def _releaseBin(self, bin):
- self.debug("releasing %r" % bin)
+ self.debug("releasing %r", bin)
if hasattr(bin, 'decodebin'):
try:
bin.decodebin.disconnect_by_func(self._dbinPadAddedCb)
@@ -67,7 +67,7 @@ class PictureFileSourceFactory(FileSourceFactory):
ffscale_factory = 'ffvideoscale'
def _makeStreamBin(self, output_stream):
- self.debug("making picture bin for %s" % self.name)
+ self.debug("making picture bin for %s", self.name)
res = gst.Bin("picture-%s" % self.name)
# use ffvideoscale only if available AND width < 2048
if output_stream.width < 2048:
@@ -91,7 +91,7 @@ class PictureFileSourceFactory(FileSourceFactory):
scale, freeze, res)
dbin.connect("pad-removed", self._dbinPadRemovedCb,
scale, freeze, res)
- self.debug("Returning %r" % res)
+ self.debug("Returning %r", res)
res.decodebin = dbin
return res
diff --git a/pitivi/pipeline.py b/pitivi/pipeline.py
index 1614204..d038cce 100644
--- a/pitivi/pipeline.py
+++ b/pitivi/pipeline.py
@@ -341,24 +341,24 @@ class Pipeline(object, Signallable, Loggable):
@rtype: L{long}
@raise PipelineError: If the position couldn't be obtained.
"""
- self.log("format %r" % format)
+ self.log("format %r", format)
try:
cur, format = self._pipeline.query_position(format)
except:
raise PipelineError("Couldn't get position")
- self.log("Got position %s" % gst.TIME_ARGS(cur))
+ self.log("Got position %s", gst.TIME_ARGS(cur))
return cur
def getDuration(self, format=gst.FORMAT_TIME):
"""
Get the duration of the C{Pipeline}.
"""
- self.log("format %r" % format)
+ self.log("format %r", format)
try:
dur, format = self._pipeline.query_duration(format)
except:
raise PipelineError("Couldn't get duration")
- self.log("Got duration %s" % gst.TIME_ARGS(dur))
+ self.log("Got duration %s", gst.TIME_ARGS(dur))
self.emit("duration-changed", dur)
return dur
@@ -777,7 +777,7 @@ class Pipeline(object, Signallable, Loggable):
## Private methods
def _busMessageCb(self, unused_bus, message):
- self.info("%s [%r]" % (message.type, message.src))
+ self.info("%s [%r]" , message.type, message.src)
if message.type == gst.MESSAGE_EOS:
self.emit('eos')
elif message.type == gst.MESSAGE_STATE_CHANGED and message.src == self._pipeline:
diff --git a/pitivi/plumber.py b/pitivi/plumber.py
index 7fbb4a3..1d6f6a3 100644
--- a/pitivi/plumber.py
+++ b/pitivi/plumber.py
@@ -59,7 +59,7 @@ class DefaultVideoSink(SinkFactory):
autovideosink.info("doesn't implement XOverlay interface")
self._realsink = autovideosink.get_by_interface(interfaces.XOverlay)
if not self._realsink:
- self.info("%s" % list(autovideosink.elements()))
+ self.info("%s", list(autovideosink.elements()))
autovideosink.warning("couldn't even find an XOverlay within!!!")
else:
self._realsink.info("implements XOverlay interface")
diff --git a/pitivi/previewer.py b/pitivi/previewer.py
index 98fd1a1..312a27d 100644
--- a/pitivi/previewer.py
+++ b/pitivi/previewer.py
@@ -39,6 +39,8 @@ from pitivi.settings import GlobalSettings
import pitivi.instance as instance
from pitivi.ui.zoominterface import Zoomable
+from pitivi.log.loggable import Loggable
+
GlobalSettings.addConfigSection("thumbnailing")
GlobalSettings.addConfigOption("thumbnailSpacingHint",
section="thumbnailing",
@@ -75,7 +77,7 @@ def get_preview_for_object(trackobject):
previewers[key] = DefaultPreviewer(factory, stream_)
return previewers[key]
-class Previewer(object, Signallable):
+class Previewer(object, Signallable, Loggable):
__signals__ = {
"update" : ("segment",),
@@ -88,6 +90,7 @@ class Previewer(object, Signallable):
__DEFAULT_THUMB__ = "processing-clip.png"
def __init__(self, factory, stream_):
+ Loggable.__init__(self)
# create default thumbnail
path = os.path.join(get_pixmap_dir(), self.__DEFAULT_THUMB__)
self.default_thumb = cairo.ImageSurface.create_from_png(path)
@@ -295,7 +298,7 @@ class RandomAccessVideoPreviewer(RandomAccessPreviewer):
def _startThumbnail(self, timestamp):
RandomAccessPreviewer._startThumbnail(self, timestamp)
- gst.log("timestamp : %s" % gst.TIME_ARGS(timestamp))
+ self.log("timestamp : %s", gst.TIME_ARGS(timestamp))
self.videopipeline.seek(1.0,
gst.FORMAT_TIME, gst.SEEK_FLAG_FLUSH | gst.SEEK_FLAG_ACCURATE,
gst.SEEK_TYPE_SET, timestamp,
diff --git a/pitivi/project.py b/pitivi/project.py
index 3be854d..a4be1a2 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -86,7 +86,7 @@ class Project(Serializable, Signallable, Loggable):
uri : the uri of the project
"""
Loggable.__init__(self)
- self.log("name:%s, uri:%s" % (name, uri))
+ self.log("name:%s, uri:%s", name, uri)
self.name = name
self.settings = None
self.description = ""
@@ -142,7 +142,7 @@ class Project(Serializable, Signallable, Loggable):
loads the project from a file
Private method, use load() instead
"""
- self.log("uri:%s" % self.uri)
+ self.log("uri:%s", self.uri)
self.debug("Creating timeline")
# FIXME : This should be discovered !
saveformat = "pickle"
@@ -169,7 +169,7 @@ class Project(Serializable, Signallable, Loggable):
if uri_is_valid(self.uri):
path = gst.uri_get_location(self.uri)
else:
- self.warning("uri '%s' is invalid, aborting save" % self.uri)
+ self.warning("uri '%s' is invalid, aborting save", self.uri)
return False
#TODO: a bit more sophisticated overwite detection
@@ -200,7 +200,7 @@ class Project(Serializable, Signallable, Loggable):
self.log("requesting for a uri to save to...")
saveres = self.emit("save-uri-requested")
if saveres == None or saveres == True:
- self.log("'save-uri-requested' returned True, self.uri:%s" % self.uri)
+ self.log("'save-uri-requested' returned True, self.uri:%s", self.uri)
if self.uri:
return self._save()
@@ -221,18 +221,18 @@ class Project(Serializable, Signallable, Loggable):
def setUri(self, uri, format=None):
""" Set the location to which this project will be stored """
- self.log("uri:%s, format:%s" % (uri, format))
+ self.log("uri:%s, format:%s", uri, format)
if not self.uri == uri:
- self.log("updating self.uri, previously:%s" % self.uri)
+ self.log("updating self.uri, previously:%s", self.uri)
self.uri = uri
self.urichanged = True
if not format or not self.format == format:
- self.log("updating save format, previously:%s" % self.format)
+ self.log("updating save format, previously:%s", self.format)
if not format:
path = gst.uri_get_location(uri)
ext = os.path.splitext(path)[1]
- self.log("Based on file extension, format is %s" % format)
+ self.log("Based on file extension, format is %s", format)
format = ProjectSaver.getFormat(ext)
self.format = format
@@ -249,7 +249,7 @@ class Project(Serializable, Signallable, Loggable):
Sets the given settings as the project's settings.
If settings is None, the current settings will be unset
"""
- self.log("Setting %s as the project's settings" % settings)
+ self.log("Setting %s as the project's settings", settings)
if self.settings:
self.settings.disconnect(self.settingssigid)
self.settings = settings
diff --git a/pitivi/settings.py b/pitivi/settings.py
index 1fd3fd4..0862283 100644
--- a/pitivi/settings.py
+++ b/pitivi/settings.py
@@ -481,7 +481,7 @@ class ExportSettings(Serializable, Signallable, Loggable):
def setVideoProperties(self, width=-1, height=-1, framerate=-1, par=-1):
""" Set the video width, height and framerate """
- self.info("set_video_props %d x %d @ %r fps" % (width, height, framerate))
+ self.info("set_video_props %d x %d @ %r fps", width, height, framerate)
changed = False
if not width == -1 and not width == self.videowidth:
self.videowidth = width
@@ -500,7 +500,7 @@ class ExportSettings(Serializable, Signallable, Loggable):
def setAudioProperties(self, nbchanns=-1, rate=-1, depth=-1):
""" Set the number of audio channels, rate and depth """
- self.info("%d x %dHz %dbits" % (nbchanns, rate, depth))
+ self.info("%d x %dHz %dbits", nbchanns, rate, depth)
changed = False
if not nbchanns == -1 and not nbchanns == self.audiochannels:
self.audiochannels = nbchanns
diff --git a/pitivi/sourcelist.py b/pitivi/sourcelist.py
index d0002f1..1a93f96 100644
--- a/pitivi/sourcelist.py
+++ b/pitivi/sourcelist.py
@@ -55,7 +55,7 @@ class SourceList(Serializable, Signallable, Loggable):
def __init__(self, project=None):
Loggable.__init__(self)
- self.log("new sourcelist for project %s" % project)
+ self.log("new sourcelist for project %s", project)
self.project = project
self.sources = {}
self.tempsources = {}
@@ -140,7 +140,7 @@ class SourceList(Serializable, Signallable, Loggable):
Add an objectfactory for the given uri.
"""
if uri in self and self[uri]:
- raise Exception("We already have an objectfactory for uri %s" % uri)
+ raise Exception("We already have an objectfactory for uri %s", uri)
self.sources[uri] = factory
self.emit("file_added", factory)
diff --git a/pitivi/threads.py b/pitivi/threads.py
index b6e804a..72cadf8 100644
--- a/pitivi/threads.py
+++ b/pitivi/threads.py
@@ -87,7 +87,7 @@ class ThreadMaster(object, Loggable):
# IDEA : We might need a limit of concurrent threads ?
# ... or some priorities ?
# FIXME : we should only accept subclasses of our Thread class
- self.log("Adding thread of type %r" % threadclass)
+ self.log("Adding thread of type %r", threadclass)
thread = threadclass(*args)
thread.connect("done", self._threadDoneCb)
self.threads.append(thread)
@@ -96,7 +96,7 @@ class ThreadMaster(object, Loggable):
self.log("started !")
def _threadDoneCb(self, thread):
- self.log("thread %r is done" % thread)
+ self.log("thread %r is done", thread)
self.threads.remove(thread)
def stopAllThreads(self):
@@ -105,7 +105,7 @@ class ThreadMaster(object, Loggable):
joinedthreads = 0
while(joinedthreads < len(self.threads)):
for thread in self.threads:
- self.log("Trying to stop thread %r" % thread)
+ self.log("Trying to stop thread %r", thread)
try:
thread.join()
joinedthreads += 1
diff --git a/pitivi/ui/filelisterrordialog.py b/pitivi/ui/filelisterrordialog.py
index a5aa78e..1576cc4 100644
--- a/pitivi/ui/filelisterrordialog.py
+++ b/pitivi/ui/filelisterrordialog.py
@@ -54,7 +54,7 @@ class FileListErrorDialog(GladeWindow, Signallable, Loggable):
give a string identifying the reason why the file failed to be
discovered
"""
- self.debug("Uri:%s, reason:%s, extra:%s" % (uri, reason, extra))
+ self.debug("Uri:%s, reason:%s, extra:%s", uri, reason, extra)
exp = self._createFileExpander(uri, reason, extra)
self.errorvbox.pack_start(exp)
exp.show_all()
diff --git a/pitivi/ui/gstwidget.py b/pitivi/ui/gstwidget.py
index 963d738..d7df7bb 100644
--- a/pitivi/ui/gstwidget.py
+++ b/pitivi/ui/gstwidget.py
@@ -98,7 +98,7 @@ def make_property_widget(unused_element, prop, value=None):
idx = 0
for key, val in prop.enum_class.__enum_values__.iteritems():
- log.log("gstwidget", "adding %s / %s" % (val.value_name, val))
+ log.log("gstwidget", "adding %s / %s", val.value_name, val)
model.append([val.value_name, val])
if val == value:
selected = idx
@@ -126,7 +126,7 @@ class GstElementSettingsWidget(gtk.VBox, Loggable):
def setElement(self, element, properties={}, ignore=['name']):
""" Set given element on Widget, with optional properties """
- self.info("element:%s, properties:%s" % (element, properties))
+ self.info("element:%s, properties:%s", element, properties)
self.element = element
self.ignore = ignore
self.properties = {} #key:name, value:widget
@@ -176,11 +176,11 @@ class GstElementSettingsDialog(GladeWindow, Loggable):
def __init__(self, elementfactory, properties={}):
GladeWindow.__init__(self)
Loggable.__init__(self)
- self.debug("factory:%s, properties:%s" % (elementfactory, properties))
+ self.debug("factory:%s, properties:%s", elementfactory, properties)
self.factory = elementfactory
self.element = self.factory.create("elementsettings")
if not self.element:
- self.warning("Couldn't create element from factory %s" % self.factory)
+ self.warning("Couldn't create element from factory %s", self.factory)
self.desclabel = self.widgets["descriptionlabel"]
self.authlabel = self.widgets["authorlabel"]
self.properties = properties
diff --git a/pitivi/ui/mainwindow.py b/pitivi/ui/mainwindow.py
index be7e371..ea2503e 100644
--- a/pitivi/ui/mainwindow.py
+++ b/pitivi/ui/mainwindow.py
@@ -636,7 +636,7 @@ class PitiviMainWindow(gtk.Window, Loggable):
format = chooser.get_filter().get_name()
if format == _("Detect Automatically"):
format = None
- self.log("uri:%s , format:%s" % (uri, format))
+ self.log("uri:%s , format:%s", uri, format)
project.setUri(uri, format)
ret = True
else:
@@ -650,7 +650,7 @@ class PitiviMainWindow(gtk.Window, Loggable):
selection, targetType, ctime):
# FIXME : This should be handled by the main application who knows how
# to switch between pipelines.
- self.info("context:%s, targetType:%s" % (context, targetType))
+ self.info("context:%s, targetType:%s", context, targetType)
if targetType == dnd.TYPE_URI_LIST:
uri = selection.data.strip().split("\n")[0].strip()
elif targetType == dnd.TYPE_PITIVI_FILESOURCE:
@@ -677,7 +677,7 @@ class PitiviMainWindow(gtk.Window, Loggable):
def _timelineDragMotionCb(self, unused_layout, unused_context, x, y, timestamp):
# FIXME: temporarily add source to timeline, and put it in drag mode
# so user can see where it will go
- self.info("SimpleTimeline x:%d , source would go at %d" % (x, 0))
+ self.info("SimpleTimeline x:%d , source would go at %d", x, 0)
def _timelineDragDataReceivedCb(self, unused_layout, context, x, y,
selection, targetType, timestamp):
@@ -696,11 +696,14 @@ class PitiviMainWindow(gtk.Window, Loggable):
def _timelineRulerSeekCb(self, ruler, position):
+ self.debug("position:%s", gst.TIME_ARGS (position))
if not hasattr(self.project, 'view_action'):
self.project.view_action = ViewAction()
self.project.view_action.addProducers(self.project.factory)
self.viewer.setAction(self.project.view_action)
self.viewer.setPipeline(self.project.pipeline)
+ # everything above only needs to be done if the viewer isn't already
+ # set to the pipeline.
self.project.pipeline.pause()
try:
self.project.pipeline.seek(position)
diff --git a/pitivi/ui/netstream_managerdialog.py b/pitivi/ui/netstream_managerdialog.py
index b5fcf91..2fcd34f 100644
--- a/pitivi/ui/netstream_managerdialog.py
+++ b/pitivi/ui/netstream_managerdialog.py
@@ -149,7 +149,6 @@ class NetstreamManagerDialog(object):
elif t == gst.MESSAGE_ERROR:
err, debug = message.parse_error()
- print "Error: %s" % err, debug
if self.player:
self.player.set_state(gst.STATE_NULL)
self.capture_btn.set_label("Capture")
diff --git a/pitivi/ui/ruler.py b/pitivi/ui/ruler.py
index d6eacbd..c205dc7 100644
--- a/pitivi/ui/ruler.py
+++ b/pitivi/ui/ruler.py
@@ -86,7 +86,7 @@ class ScaleRuler(gtk.Layout, Zoomable, Loggable):
## timeline position changed method
def timelinePositionChanged(self, value, unused_frame=None):
- self.debug("value : %r" % value)
+ self.debug("value : %r", value)
ppos = max(self.nsToPixel(self.position) - 1, 0)
self.position = value
npos = max(self.nsToPixel(self.position) - 1, 0)
diff --git a/pitivi/ui/sourcelist.py b/pitivi/ui/sourcelist.py
index da00c9a..e194e6f 100644
--- a/pitivi/ui/sourcelist.py
+++ b/pitivi/ui/sourcelist.py
@@ -387,11 +387,11 @@ class SourceList(gtk.VBox, Loggable):
if video and video[0].thumbnail:
thumbnail_file = video[0].thumbnail
try:
- self.debug("attempting to open thumbnail file '%s'" %
+ self.debug("attempting to open thumbnail file '%s'",
thumbnail_file)
pixbuf = gtk.gdk.pixbuf_new_from_file(thumbnail_file)
except:
- self.error("Failure to create thumbnail from file '%s'" %
+ self.error("Failure to create thumbnail from file '%s'",
thumbnail_file)
thumbnail = self.videofilepixbuf
else:
@@ -465,7 +465,7 @@ class SourceList(gtk.VBox, Loggable):
## Import Sources Dialog Box callbacks
def _dialogBoxResponseCb(self, dialogbox, response, select_folders):
- self.debug("response:%r" % response)
+ self.debug("response:%r", response)
if response == gtk.RESPONSE_OK:
lastfolder = dialogbox.get_current_folder()
instance.PiTiVi.settings.lastImportFolder = lastfolder
@@ -515,7 +515,7 @@ class SourceList(gtk.VBox, Loggable):
return
path = paths[0]
factory = model[path][COL_FACTORY]
- self.debug("Let's play %s" % factory.name)
+ self.debug("Let's play %s", factory.name)
self.error("FIXME : IMPLEMENT PROPER TEMPORARY PLAYBACK USING PIPELINE/ACTION")
def _treeViewButtonPressEventCb(self, unused_treeview, event):
@@ -532,7 +532,7 @@ class SourceList(gtk.VBox, Loggable):
self._connectToProject(project)
# synchronize the storemodel with the new project's sourcelist
for uri, factory in project.sources:
- self.log("loading uri %s" % uri)
+ self.log("loading uri %s", uri)
self._addFactory(factory)
def _newProjectFailedCb(self, unused_pitivi, unused_reason,
@@ -555,7 +555,7 @@ class SourceList(gtk.VBox, Loggable):
# or it's on local system with "file://"
return os.path.isfile(path)
- self.debug("targettype:%d, selection.data:%r" % (targettype, selection.data))
+ self.debug("targettype:%d, selection.data:%r", targettype, selection.data)
directories = []
if targettype == dnd.TYPE_URI_LIST:
incoming = [unquote(x.strip('\x00')) for x in selection.data.strip().split("\r\n") if x.strip('\x00')]
@@ -587,7 +587,7 @@ class SourceList(gtk.VBox, Loggable):
def _dndDataGetCb(self, unused_widget, unused_context, selection,
targettype, unused_eventtime):
- self.info("data get, type:%d" % targettype)
+ self.info("data get, type:%d", targettype)
uris = self.getSelectedItems()
if len(uris) < 1:
return
diff --git a/pitivi/ui/viewer.py b/pitivi/ui/viewer.py
index f6e0ce1..3000b67 100644
--- a/pitivi/ui/viewer.py
+++ b/pitivi/ui/viewer.py
@@ -79,7 +79,7 @@ class PitiviViewer(gtk.VBox, Loggable):
@param pipeline: The Pipeline to switch to.
@type pipeline: L{Pipeline}.
"""
- self.debug("self.pipeline:%r, pipeline:%r" % (self.pipeline, pipeline))
+ self.debug("self.pipeline:%r, pipeline:%r", self.pipeline, pipeline)
if pipeline is not None and pipeline == self.pipeline:
return
@@ -103,7 +103,7 @@ class PitiviViewer(gtk.VBox, Loggable):
will be used.
@type action: L{ViewAction} or C{None}
"""
- self.debug("self.action:%r, action:%r" % (self.action, action))
+ self.debug("self.action:%r, action:%r", self.action, action)
if action is not None and action == self.action:
return
@@ -116,7 +116,7 @@ class PitiviViewer(gtk.VBox, Loggable):
self._connectToAction(action)
def _connectToPipeline(self, pipeline):
- self.debug("pipeline:%r" % pipeline)
+ self.debug("pipeline:%r", pipeline)
if self.pipeline != None:
raise ViewerError("previous pipeline wasn't disconnected")
self.pipeline = pipeline
@@ -134,7 +134,7 @@ class PitiviViewer(gtk.VBox, Loggable):
self.action.activate()
def _disconnectFromPipeline(self):
- self.debug("pipeline:%r" % self.pipeline)
+ self.debug("pipeline:%r", self.pipeline)
if self.pipeline == None:
# silently return, there's nothing to disconnect from
return
@@ -153,7 +153,7 @@ class PitiviViewer(gtk.VBox, Loggable):
self.pipeline = None
def _connectToAction(self, action):
- self.debug("action: %r" % action)
+ self.debug("action: %r", action)
# not sure what we need to do ...
self.action = action
# FIXME: fix this properly?
@@ -164,7 +164,7 @@ class PitiviViewer(gtk.VBox, Loggable):
self.action = None
def _setUiActive(self, active=True):
- self.debug("active %r" % active)
+ self.debug("active %r", active)
self.set_sensitive(active)
if self._haveUI:
for item in [self.slider, self.rewind_button, self.back_button,
@@ -248,7 +248,7 @@ class PitiviViewer(gtk.VBox, Loggable):
def setDisplayAspectRatio(self, ratio):
""" Sets the DAR of the Viewer to the given ratio """
- self.debug("Setting ratio of %f [%r]" % (float(ratio), ratio))
+ self.debug("Setting ratio of %f [%r]", float(ratio), ratio)
try:
self.aframe.set_property("ratio", float(ratio))
except:
@@ -283,7 +283,7 @@ class PitiviViewer(gtk.VBox, Loggable):
return False
def _sliderButtonReleaseCb(self, slider, unused_event):
- self.info("slider button release at %s" % time_to_string(long(slider.get_value())))
+ self.info("slider button release at %s", time_to_string(long(slider.get_value())))
self.moving_slider = False
if self.valuechangedid:
slider.disconnect(self.valuechangedid)
@@ -313,7 +313,7 @@ class PitiviViewer(gtk.VBox, Loggable):
self._doSeek(seekvalue)
else:
# frame scrolling, frame by frame
- self.info("scroll direction:%s" % event.direction)
+ self.info("scroll direction:%s", event.direction)
if event.direction in [gtk.gdk.SCROLL_LEFT, gtk.gdk.SCROLL_DOWN]:
self.info("scrolling backward")
seekvalue = max(self.current_frame - 1, 0)
@@ -323,15 +323,15 @@ class PitiviViewer(gtk.VBox, Loggable):
self._doSeek(seekvalue, gst.FORMAT_DEFAULT)
def _seekTimeoutCb(self):
- self.debug("requested_time %s" % gst.TIME_ARGS(self.requested_time))
+ self.debug("requested_time %s", gst.TIME_ARGS(self.requested_time))
self.currentlySeeking = False
if (self.requested_time != gst.CLOCK_TIME_NONE) and (self.current_time != self.requested_time):
self._doSeek(self.requested_time)
return False
def _doSeek(self, value, format=gst.FORMAT_TIME):
- self.debug("%s , currentlySeeking:%r" % (gst.TIME_ARGS(value),
- self.currentlySeeking))
+ self.debug("%s , currentlySeeking:%r", gst.TIME_ARGS(value),
+ self.currentlySeeking)
if not self.currentlySeeking:
self.currentlySeeking = True
try:
@@ -347,7 +347,7 @@ class PitiviViewer(gtk.VBox, Loggable):
self.requested_time = value
def _newTime(self, value, frame=-1):
- self.info("value:%s, frame:%d" % (gst.TIME_ARGS(value), frame))
+ self.info("value:%s, frame:%d", gst.TIME_ARGS(value), frame)
self.current_time = value
self.current_frame = frame
try:
@@ -364,7 +364,7 @@ class PitiviViewer(gtk.VBox, Loggable):
## active Timeline calllbacks
def _durationChangedCb(self, unused_pipeline, duration):
- self.debug("duration : %s" % gst.TIME_ARGS(duration))
+ self.debug("duration : %s", gst.TIME_ARGS(duration))
position = self.posadjust.get_value()
if duration < position:
self.posadjust.set_value(float(duration))
@@ -403,7 +403,7 @@ class PitiviViewer(gtk.VBox, Loggable):
self._newTime(pos)
def _currentStateCb(self, unused_pipeline, state):
- self.info("current state changed : %s" % state)
+ self.info("current state changed : %s", state)
if state == int(gst.STATE_PLAYING):
self.playpause_button.setPause()
elif state == int(gst.STATE_PAUSED):
@@ -414,7 +414,7 @@ class PitiviViewer(gtk.VBox, Loggable):
def _elementMessageCb(self, unused_pipeline, message):
name = message.structure.get_name()
- self.log('message:%s / %s' % (message, name))
+ self.log('message:%s / %s', message, name)
if name == 'prepare-xwindow-id':
self.drawingarea.set_xwindow_id()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]