diff options
author | Martin Poirier <theeth@yahoo.com> | 2012-01-23 05:36:40 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2012-01-23 05:36:40 +0400 |
commit | 0d51c81902d6c287e28cb4589077f9cb37777917 (patch) | |
tree | 8355b6ea9b24b40e41fb83ce0356bb204e3b1126 /netrender/model.py | |
parent | d52ad87af7632d84fd5f96aa1392ece1e703974a (diff) |
netrender
new jquery-based web interface developed by Philippe Van Hecke (great thanks)
Works in parallel with the existing html interface (both have a link pointing to the other) which might very well be phased out at some point.
Diffstat (limited to 'netrender/model.py')
-rw-r--r-- | netrender/model.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/netrender/model.py b/netrender/model.py index ec91587b..d4d00bbf 100644 --- a/netrender/model.py +++ b/netrender/model.py @@ -185,6 +185,7 @@ class RenderFile: self.start = start self.end = end self.force = False + def serialize(self): return { @@ -195,6 +196,7 @@ class RenderFile: "end": self.end, "signature": self.signature, "force": self.force + } @staticmethod @@ -319,10 +321,10 @@ class RenderJob: else: return None - def serialize(self, frames = None): + def serialize(self, frames = None,withFiles=True,withFrames=True): min_frame = min((f.number for f in frames)) if frames else -1 max_frame = max((f.number for f in frames)) if frames else -1 - return { + data={ "id": self.id, "type": self.type, "subtype": self.subtype, @@ -330,8 +332,6 @@ class RenderJob: "category": self.category, "tags": tuple(self.tags), "status": self.status, - "files": [f.serialize() for f in self.files if f.start == -1 or not frames or (f.start <= max_frame and f.end >= min_frame)], - "frames": [f.serialize() for f in self.frames if not frames or f in frames], "chunks": self.chunks, "priority": self.priority, "usage": self.usage, @@ -341,7 +341,13 @@ class RenderJob: "resolution": self.resolution, "render": self.render } - + if (withFiles): + data["files"]=[f.serialize() for f in self.files if f.start == -1 or not frames or (f.start <= max_frame and f.end >= min_frame)] + + if (withFrames): + data["frames"]=[f.serialize() for f in self.frames if not frames or f in frames] + + return data @staticmethod def materialize(data): if not data: |