From 8fc4e97fa131b4cd4bc5b0a474696cad762e39bd Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Thu, 17 Sep 2009 11:26:09 +0000 Subject: Use basename for uploaded files by default in copy-to-journal script #1372 --- diff --git a/bin/copy-to-journal b/bin/copy-to-journal index ce72f2b..cf2cf20 100755 --- a/bin/copy-to-journal +++ b/bin/copy-to-journal @@ -10,6 +10,7 @@ import sys import os import optparse +from gettext import gettext as _ if os.path.exists("/tmp/olpc-session-bus"): os.environ["DBUS_SESSION_BUS_ADDRESS"] = "unix:path=/tmp/olpc-session-bus" @@ -68,11 +69,13 @@ if __name__ == "__main__": if options.title: entry.metadata['title'] = options.title else: - entry.metadata['title'] = fname + entry.metadata['title'] = os.path.basename(fname) # Use the description given, otherwise leave it blank. if options.description: entry.metadata['description'] = options.description + else: + entry.metadata['description'] = _('From: %s') % fname # Lastly, if any tags are given, combine them into a single string # and save them. -- cgit v0.9.1