[Bug 706768] New: [pitivi]=?UTF-8?Q?=C2=A0Allow=20using=20GES=20Project?='s save function with no timeline object

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Sun Aug 25 15:20:44 PDT 2013


https://bugzilla.gnome.org/show_bug.cgi?id=706768
  GStreamer | gst-editing-services | git

           Summary: [pitivi] Allow using GES Project's save function with
                    no timeline object
    Classification: Platform
           Product: GStreamer
           Version: git
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: minor
          Priority: Normal
         Component: gst-editing-services
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: nekohayo at gmail.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Here's a fun usecase in Pitivi. You need one valid xges project and one invalid
one. To generate the invalid one, just 'echo "nope.png" > fake-project.xges'.

1. Load the valid xges project in Pitivi
2. Try loading fake-project.xges
3. Wait ~10 seconds

Result: in addition to the (normal) error dialog that says that the project
you're trying to load is invalid... you will eventually get a *second* error
dialog that is quite a bit more cryptic:

> Unable to save project "fake-project.xges~"
> Argument 1 does not allow None as a value

The ~ at the end indicates that this is actually caused by the automated backup
feature trying to save... so here's where this happens: inside the saveProject
method in pitivi's project.py, if we print the various values at that point in
time:

>        print "backup is:", backup
>        print "\turi is:", uri
>        print "\tcurrent is:", self.current
>        print "\tcurrent uri is:", self.current.uri
>        print "\tcurrent timeline is:", self.current.timeline

...we get:

> backup is: True
>	uri is: [...] fake-project.xges~
>	current is: <Project object at 0x2e1fa00>
>	current uri is: [...] fake-project.xges
>	current timeline is: None

And so, the reason why we get the cryptic
"Argument 1 does not allow None as a value" error when trying to do
"self.current.save(self.current.timeline, uri, formatter_type, overwrite)"

...is, as far as I can tell, because self.current.timeline is None. I think
it's considered argument #1 because argument #0 would be the instance of GES
Project that is implicitly passed by Python?



So. In the end, my understanding is that GES Project's "save" method does not
allow saving a project that has no timeline instance at all.

While I *could* put something like:

    if backup and self.current.timeline is None:
        return

...that does feel like a horrible, dirty hack. So I'd like to avoid that if
possible.

> <Mathieu_Du> Yes, you should not [have to] do that I believe. Just let the code as it is and open an issue we'll have a look at it in due time

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list