From 8cc2593a14c6aa97e28d112d2e83e663699cc044 Mon Sep 17 00:00:00 2001 From: Muriel de Souza Godoi Date: Fri, 30 Nov 2007 20:18:35 +0000 Subject: Change temp folder permisson to allow activity access --- diff --git a/NEWS b/NEWS index d2f15d1..2b5570b 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +* Change temp folder permisson to allow activity access +* Fix the mime-type folder location + 23 * Add support do ogg Record files @@ -12,6 +15,7 @@ 21 * Temp folders changed for Rainbow compliance #4872, #5069 +* Fix in mode flag which was broken sharing mode #4752 20 diff --git a/icons/application-x-memorize-project.svg b/activity/application-x-memorize-project.svg index a3c7ce0..a3c7ce0 100644 --- a/icons/application-x-memorize-project.svg +++ b/activity/application-x-memorize-project.svg diff --git a/cardlist.py b/cardlist.py index daa9de1..0922d7f 100644 --- a/cardlist.py +++ b/cardlist.py @@ -98,8 +98,9 @@ class CardList(gtk.EventBox): def save_game(self, widget, game_name, equal_pairs, grouped): - tmp_root = join(environ['SUGAR_ACTIVITY_ROOT'], 'tmp') + tmp_root = join(environ['SUGAR_ACTIVITY_ROOT'], 'instance') temp_folder = tempfile.mkdtemp(dir=tmp_root) + os.chmod(temp_folder,0777) temp_img_folder = join(temp_folder, 'images') temp_snd_folder = join(temp_folder, 'sounds') diff --git a/messenger.py b/messenger.py index 375b0ed..72c1691 100644 --- a/messenger.py +++ b/messenger.py @@ -21,7 +21,7 @@ import logging _logger = logging.getLogger('memorize-activity') import tempfile -from os import environ +from os import environ, chmod from os.path import join, getsize, isfile, dirname, basename from dbus.service import method, signal from dbus.gobject_service import ExportedGObject @@ -130,17 +130,18 @@ class Messenger(ExportedGObject): if mode == 'file': self.game.model.read(self.files[path]) - data['path'] = self.game.model.data['path'] - data['pathimg'] = self.game.model.data['pathimg'] - data['pathsnd'] = self.game.model.data['pathsnd'] + if self.game.model.data.has_key('path'): + data['path'] = self.game.model.data['path'] + data['pathimg'] = self.game.model.data['pathimg'] + data['pathsnd'] = self.game.model.data['pathsnd'] self.game.load_remote(grid, data, mode, True) # File transfer methods def file_sender(self, target, filename, title, color): size = getsize(filename) - f = open(filename, 'r+b') - part_size = 4096 + f = open(filename, 'rb') + part_size = 8192 num_parts = (size / part_size) +1 for part in range(num_parts): bytes = f.read(part_size) @@ -171,6 +172,7 @@ class Messenger(ExportedGObject): if part == 1: tmp_root = join(environ['SUGAR_ACTIVITY_ROOT'], 'instance') temp_dir = tempfile.mkdtemp(dir=tmp_root) + chmod(temp_dir,0777) self.temp_file = join(temp_dir, 'game.zip') self.files[filename] = self.temp_file self.f = open(self.temp_file, 'a+b') diff --git a/model.py b/model.py index 816d5de..81e3c11 100644 --- a/model.py +++ b/model.py @@ -18,7 +18,7 @@ # import libxml2 -from os import environ, makedirs +from os import environ, makedirs, chmod from os.path import join, basename, dirname, isdir, split, normpath import logging import random @@ -124,7 +124,7 @@ class Model(object): def read(self, game_file): tmp_root = join(environ['SUGAR_ACTIVITY_ROOT'], 'instance') temp_folder = tempfile.mkdtemp(dir=tmp_root) - + chmod(temp_folder,0777) self.data['key'] = basename(game_file) self.data['game_file'] = game_file self.data['path'] = temp_folder -- cgit v0.9.1