Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/model.py
diff options
context:
space:
mode:
Diffstat (limited to 'model.py')
-rwxr-xr-x[-rw-r--r--]model.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/model.py b/model.py
index 1af2487..78a3366 100644..100755
--- a/model.py
+++ b/model.py
@@ -277,7 +277,7 @@ class Model:
def save_photo(self, pixbuf):
recd = self.createNewRecorded(constants.TYPE_PHOTO)
- imgpath = os.path.join(Instance.instancePath, recd.mediaFilename)
+ imgpath = os.path.join(self.activity.Instance.get_path(), recd.mediaFilename)
pixbuf.save(imgpath, "jpeg")
pixbuf = utils.generate_thumbnail(pixbuf)
@@ -292,7 +292,7 @@ class Model:
# called from gstreamer thread
def save_video(self, path, still):
recd = self.createNewRecorded(constants.TYPE_VIDEO)
- os.rename(path, os.path.join(Instance.instancePath, recd.mediaFilename))
+ os.rename(path, os.path.join(self.activity.Instance.get_path(), recd.mediaFilename))
still = utils.generate_thumbnail(still)
still.save(recd.make_thumb_path(), "png")
@@ -304,10 +304,10 @@ class Model:
def save_audio(self, path, still):
recd = self.createNewRecorded(constants.TYPE_AUDIO)
- os.rename(path, os.path.join(Instance.instancePath, recd.mediaFilename))
+ os.rename(path, os.path.join(self.activity.Instance.get_path(), recd.mediaFilename))
if still:
- image_path = os.path.join(Instance.instancePath, "audioPicture.png")
+ image_path = os.path.join(self.activity.Instance.get_path(), "audioPicture.png")
image_path = utils.getUniqueFilepath(image_path, 0)
still.save(image_path, "png")
recd.audioImageFilename = os.path.basename(image_path)
@@ -363,10 +363,10 @@ class Model:
return None
def createNewRecorded(self, type):
- recd = Recorded()
+ recd = Recorded(self.activity)
recd.recorderName = self.get_nickname()
- recd.recorderHash = Instance.keyHashPrintable
+ recd.recorderHash = self.activity.Instance.keyHashPrintable
#to create a file, use the hardware_id+time *and* check if available or not
nowtime = int(time.time())
@@ -376,7 +376,7 @@ class Model:
mediaThumbFilename = str(recd.recorderHash) + "_" + str(recd.time)
mediaFilename = mediaThumbFilename
mediaFilename = mediaFilename + "." + constants.MEDIA_INFO[type]['ext']
- mediaFilepath = os.path.join( Instance.instancePath, mediaFilename )
+ mediaFilepath = os.path.join( self.activity.Instance.get_path(), mediaFilename )
mediaFilepath = utils.getUniqueFilepath( mediaFilepath, 0 )
recd.mediaFilename = os.path.basename( mediaFilepath )
@@ -398,13 +398,13 @@ class Model:
#load the thumbfile
if recd.thumbFilename:
- thumbFile = os.path.join(Instance.instancePath, recd.thumbFilename)
+ thumbFile = os.path.join(self.activity.Instance.get_path(), recd.thumbFilename)
recd.thumbBytes = os.stat(thumbFile)[6]
recd.tags = ""
#load the mediafile
- mediaFile = os.path.join(Instance.instancePath, recd.mediaFilename)
+ mediaFile = os.path.join(self.activity.Instance.get_path(), recd.mediaFilename)
mBytes = os.stat(mediaFile)[6]
recd.mediaBytes = mBytes