Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/recorded.py
diff options
context:
space:
mode:
authorerikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0>2007-10-31 16:27:45 (GMT)
committer erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0>2007-10-31 16:27:45 (GMT)
commit1ab6b11c83d527bdd02f04cccc34ef00b0494912 (patch)
tree1e2f8b2046be9a64523f3aba46fb02d0d5291369 /recorded.py
parent6e20a3af2331fc524f356c981e308dd1373af112 (diff)
refactoring
git-svn-id: http://mediamods.com/public-svn/camera-activity/Record.activity@785 574bc980-5f2d-0410-acbc-c8f9f0eb14e0
Diffstat (limited to 'recorded.py')
-rw-r--r--recorded.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/recorded.py b/recorded.py
index 48a670c..0346e9a 100644
--- a/recorded.py
+++ b/recorded.py
@@ -22,6 +22,8 @@ import os
import gtk
from gtk import gdk
+from instance import Instance
+
class Recorded:
def __init__( self, pca ):
@@ -99,7 +101,7 @@ class Recorded:
#just taken, so it is in the tempSessionDir
#so load file, convert to pixbuf, and return it here...
thumbPixbuf = None
- thumbFilepath = os.path.join(self.ca.tempPath, self.thumbFilename)
+ thumbFilepath = os.path.join(Instance.tmpPath, self.thumbFilename)
if ( os.path.isfile(thumbFilepath) ):
thumbPixbuf = gtk.gdk.pixbuf_new_from_file(thumbFilepath)
return thumbPixbuf
@@ -118,7 +120,7 @@ class Recorded:
#just taken, so it is in the tempSessionDir
#so load file, convert to pixbuf, and return it here...
thumbPixbuf = None
- thumbFilepath = os.path.join(self.ca.tempPath, self.thumbFilename)
+ thumbFilepath = os.path.join(Instance.tmpPath, self.thumbFilename)
if ( os.path.isfile(thumbFilepath) ):
return thumbFilepath
else:
@@ -129,7 +131,7 @@ class Recorded:
return None
img = self.pixbufFromString( self.datastoreOb.metadata['preview'] )
- thumbFilepath = os.path.join( self.ca.tempPath, "thumb.png")
+ thumbFilepath = os.path.join( Instance.tmpPath, "thumb.png")
thumbFilepath = self.ca.m.getUniqueFilepath(thumbFilepath, 0)
img.save(thumbFilepath, "png", {} )
return thumbFilepath
@@ -152,7 +154,7 @@ class Recorded:
def getAudioImageFilepath( self ):
if (self.audioImageFilename != None):
- audioFilepath = os.path.join(self.ca.tempPath, self.audioImageFilename)
+ audioFilepath = os.path.join(Instance.tmpPath, self.audioImageFilename)
return os.path.abspath(audioFilepath)
else:
return self.getThumbFilepath()
@@ -162,12 +164,12 @@ class Recorded:
if (self.datastoreId == None):
if (not self.buddy):
#just taken by you, so it is in the tempSessionDir
- mediaFilepath = os.path.join(self.ca.tempPath, self.mediaFilename)
+ mediaFilepath = os.path.join(Instance.tmpPath, self.mediaFilename)
return os.path.abspath(mediaFilepath)
else:
if (self.downloadedFromBuddy):
#the user has requested the high-res version, and it has downloaded
- mediaFilepath = os.path.join(self.ca.tempPath, self.mediaFilename)
+ mediaFilepath = os.path.join(Instance.tmpPath, self.mediaFilename)
return os.path.abspath(mediaFilepath)
else:
if (meshRequired):
@@ -185,13 +187,13 @@ class Recorded:
else:
if self.mediaFilename == None:
ext = self.ca.m.mediaTypes[self.type][self.ca.keyExt]
- recdPath = os.path.join(self.ca.tempPath, "recdFile_"+self.mediaMd5+"."+ext)
+ recdPath = os.path.join(Instance.tmpPath, "recdFile_"+self.mediaMd5+"."+ext)
recdPath = self.ca.m.getUniqueFilepath(recdPath, 0)
self.mediaFilename = os.path.basename(recdPath)
- mediaFilepath = os.path.join(self.ca.tempPath, self.mediaFilename)
+ mediaFilepath = os.path.join(Instance.tmpPath, self.mediaFilename)
return os.path.abspath(mediaFilepath)
else:
- mediaFilepath = os.path.join(self.ca.tempPath, self.mediaFilename)
+ mediaFilepath = os.path.join(Instance.tmpPath, self.mediaFilename)
return os.path.abspath(mediaFilepath)
else: #pulling from the datastore, regardless of who took it, cause we got it