[pitivi] A bunch more minor fixes
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi] A bunch more minor fixes
- Date: Fri, 17 Apr 2009 09:34:54 -0400 (EDT)
commit 018e4e6fb21ced268ce0bd067a0a49d991167670
Author: Edward Hervey <bilboed bilboed com>
Date: Sat Feb 14 01:41:20 2009 +0100
A bunch more minor fixes
---
pitivi/formatters/base.py | 20 +++++++++++++++-----
pitivi/formatters/format.py | 4 +++-
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/pitivi/formatters/base.py b/pitivi/formatters/base.py
index e1d402d..a3c1992 100644
--- a/pitivi/formatters/base.py
+++ b/pitivi/formatters/base.py
@@ -31,7 +31,7 @@ class FormatterError(Exception):
class FormatterLoadError(FormatterError):
pass
-class FormatterStoreError(FormatterError):
+class FormatterSaveError(FormatterError):
pass
# FIXME : How do we handle interaction with the UI ??
@@ -43,11 +43,11 @@ class Formatter(object):
Provides convenience methods for storing and loading
Project files.
- @cvar description: Description of the formatter.
+ @cvar description: Description of the format.
@type description: C{str}
"""
- description = "Base formatter"
+ description = "Description of the format"
def loadProject(self, location):
"""
@@ -71,7 +71,7 @@ class Formatter(object):
@type location: L{str}
@param location: The location where to store the project. Needs to be
an absolute URI.
- @raise FormatterStoreError: If the file couldn't be properly stored.
+ @raise FormatterSaveError: If the file couldn't be properly stored.
"""
raise FormatterSaveError("No Saving feature")
@@ -86,8 +86,18 @@ class Formatter(object):
"""
raise NotImplementedError
+class LoadOnlyFormatter(Formatter):
+ def saveProject(self, project, location):
+ raise FormatterSaveError("No Saving feature")
+
+
+class SaveOnlyFormatter(Formatter):
+ def saveProject(self, project, location):
+ raise FormatterSaveError("No Saving feature")
+
+
class DefaultFormatter(Formatter):
- description = "Default Formatter"
+ description = "PiTiVi default file format"
pass
diff --git a/pitivi/formatters/format.py b/pitivi/formatters/format.py
index d7cf9ce..1930182 100644
--- a/pitivi/formatters/format.py
+++ b/pitivi/formatters/format.py
@@ -23,6 +23,8 @@
High-level tools for using Formatters
"""
+# FIXME : We need a registry of all available formatters
+
def load_project(uri, formatter=None):
"""
Load the project from the given location.
@@ -54,7 +56,7 @@ def save_project(project, uri, formatter=None):
@type formatter: C{Formatter}
@param formatter: The C{Formatter} to use to store the project if specified.
If it is not specified, then it will be saved at its original format.
- @raise FormatterStoreError: If the file couldn't be properly stored.
+ @raise FormatterSaveError: If the file couldn't be properly stored.
@return: Whether the file was successfully stored
@rtype: L{bool}
"""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]