Merge branch 'master' of git+ssh://dev.laptop.org/git/sugar

This commit is contained in:
Marco Pesenti Gritti
2007-09-01 11:59:41 +02:00
11 changed files with 135 additions and 217 deletions
+9 -2
View File
@@ -123,7 +123,7 @@ class ActivityToolbar(gtk.Toolbar):
self._activity.share(private=True)
def _keep_clicked_cb(self, button):
self._activity.save()
self._activity.copy()
def _stop_clicked_cb(self, button):
self._activity.close()
@@ -305,7 +305,7 @@ class Activity(Window, gtk.Container):
elif scope == SHARE_NEIGHBORHOOD:
self.share(private=False)
else:
logging.debug("Unknown share scope %d" % scope)
logging.debug("Unknown share scope %r" % scope)
except KeyError:
pass
elif create_jobject:
@@ -455,6 +455,8 @@ class Activity(Window, gtk.Container):
def save(self):
"""Request that the activity is saved to the Journal."""
logging.debug('Activity.save: %r' % self._jobject.object_id)
if self._updating_jobject:
return
@@ -483,6 +485,11 @@ class Activity(Window, gtk.Container):
reply_handler=self._internal_save_cb,
error_handler=self._internal_save_error_cb)
def copy(self):
logging.debug('Activity.copy: %r' % self._jobject.object_id)
self.save()
self._jobject.object_id = None
def _internal_joined_cb(self, activity, success, err):
"""Callback when join has finished"""
self._shared_activity.disconnect(self._join_id)
+1 -3
View File
@@ -219,11 +219,9 @@ class Bundle:
file_names = zip_file.namelist()
root_dir = self._get_bundle_root_dir(file_names)
icon_path = os.path.join(root_dir, 'activity', self._icon + '.svg')
print icon_path
print file_names
if icon_path in file_names:
icon_data = zip_file.read(icon_path)
temp_file, temp_file_path = tempfile.mkstemp(self._icon)
temp_file, temp_file_path = tempfile.mkstemp(suffix='.svg', prefix=self._icon)
os.write(temp_file, icon_data)
os.close(temp_file)
return temp_file_path
+4
View File
@@ -144,6 +144,10 @@ class ChunkedGlibHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
** [dcbw] modified to send Content-disposition filename too
"""
path = self.translate_path(self.path)
if not path or not os.path.exists(path):
self.send_error(404, "File not found")
return None
f = None
if os.path.isdir(path):
for index in "index.html", "index.htm":