Exemplo n.º 1
0
    def _matchFactoryStreams(self, factory, old_factory):
        old_streams = old_factory.getOutputStreams()
        streams = factory.getOutputStreams()
        self.debug("matching factory streams old (%s) %s new (%s) %s",
                   len(old_streams), old_streams, len(streams), streams)
        if len(old_streams) != len(streams):
            raise FormatterError("cant find all streams")

        stream_map = match_stream_groups_map(old_streams, streams)
        self.debug("stream map (%s) %s", len(stream_map), stream_map)
        if len(stream_map) != len(old_streams):
            raise FormatterError("streams don't match")

        return stream_map
Exemplo n.º 2
0
    def _discovererDiscoveryErrorCb(self, discoverer, uri, error, detail,
                                    project, sources, uris, closure):
        if uri not in uris:
            # someone else is using discoverer, this signal isn't for us
            return

        self.emit("new-project-failed", uri,
                  FormatterError("%s: %s" % (error, detail)))
Exemplo n.º 3
0
    def _discovererDiscoveryErrorCb(self, discoverer, uri, error, detail,
                                    project, sources, uris, closure,
                                    project_uri):
        if uri not in uris:
            # someone else is using discoverer, this signal isn't for us
            return

        message = _("Failed loading %(uri)s.") % {"uri": uri}
        message += "\n\n%s" % error
        if detail:
            message += "\n\n%s" % detail
        formatter_error = FormatterError(message)
        self.emit("new-project-failed", project_uri, formatter_error)
Exemplo n.º 4
0
    def save(self, location=None, overwrite=False):
        """
        Save the project to the given location.

        @param location: The location to write to. If not specified, the
        current project location will be used (if set).
        @type location: C{URI}
        @param overwrite: Whether to overwrite existing location.
        @type overwrite: C{bool}
        """
        # import here to break circular import
        from pitivi.formatters.format import save_project
        from pitivi.formatters.base import FormatterError

        self.log("saving...")
        location = location or self.uri

        if location == None:
            raise FormatterError("Location unknown")

        save_project(self, location or self.uri, self.format, overwrite)

        self.uri = location
Exemplo n.º 5
0
 def _loadProject(self, location, project=None):
     raise FormatterError()