diff options
author | erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0> | 2007-10-31 22:09:28 (GMT) |
---|---|---|
committer | erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0> | 2007-10-31 22:09:28 (GMT) |
commit | b784a928f5f1ce70e4320d60a8f722e90ac7a1c4 (patch) | |
tree | 39e81de108a543f0f366efc869be2871c3181075 /model.py | |
parent | 803eadcc9173d85ade6215bba1242536b578293f (diff) |
refactoring fixes
git-svn-id: http://mediamods.com/public-svn/camera-activity/Record.activity@796 574bc980-5f2d-0410-acbc-c8f9f0eb14e0
Diffstat (limited to 'model.py')
-rw-r--r-- | model.py | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -43,6 +43,7 @@ from sugar.datastore import datastore import sugar.env from constants import Constants +from instance import Instance from recorded import Recorded from color import Color import _camera @@ -195,7 +196,7 @@ class Model: thumbImg.write_to_png(thumbPath) imagePath = os.path.join(Instance.tmpPath, "audioPicture.png") - imagePath = self.getUniqueFilepath( imagePath, 0 ) + imagePath = utils.getUniqueFilepath( imagePath, 0 ) pixbuf.save( imagePath, "png", {} ) recd.audioImageFilename = os.path.basename(imagePath) @@ -274,7 +275,7 @@ class Model: self.ca._logger.debug('meshShareRecd: we have a recTube') recdXml = self.ca.getRecdXmlString(recd) self.ca._logger.debug('meshShareRecd: created XML') - self.ca.recTube.notifyBudsOfNewRecd( Instance.hashedKey, recdXml ) + self.ca.recTube.notifyBudsOfNewRecd( Instance.keyHashPrintable, recdXml ) self.ca._logger.debug('meshShareRecd: notifyBuds') @@ -341,8 +342,8 @@ class Model: def createNewRecorded( self, type ): recd = Recorded( self.ca ) - recd.recorderName = self.ca.nickName - recd.recorderHash = self.ca.hashedKey + recd.recorderName = Instance.nickName + recd.recorderHash = Instance.keyHashPrintable #to create a file, use the hardware_id+time *and* check if available or not nowtime = int(time.time()) @@ -351,17 +352,17 @@ class Model: mediaThumbFilename = str(recd.recorderHash) + "_" + str(recd.time) mediaFilename = mediaThumbFilename - mediaFilename = mediaFilename + "." + self.mediaTypes[type][self.ca.keyExt] + mediaFilename = mediaFilename + "." + self.mediaTypes[type][Constants.keyExt] mediaFilepath = os.path.join( Instance.tmpPath, mediaFilename ) - mediaFilepath = self.getUniqueFilepath( mediaFilepath, 0 ) + mediaFilepath = utils.getUniqueFilepath( mediaFilepath, 0 ) recd.mediaFilename = os.path.basename( mediaFilepath ) thumbFilename = mediaThumbFilename + "_thumb.jpg" thumbFilepath = os.path.join( Instance.tmpPath, thumbFilename ) - thumbFilepath = self.getUniqueFilepath( thumbFilepath, 0 ) + thumbFilepath = utils.getUniqueFilepath( thumbFilepath, 0 ) recd.thumbFilename = os.path.basename( thumbFilepath ) - stringType = self.mediaTypes[type][self.ca.keyIstr] + stringType = self.mediaTypes[type][Constants.keyIstr] recd.title = Constants.istrBy % {"1":stringType, "2":str(recd.recorderName)} recd.colorStroke = Instance.colorStroke |