after switching on my brain AFTER svn commit, the dotdesktop_command function works now

git-svn-id: svn://svn.berlios.de/gpodder/trunk@118 b0d088ad-0a06-0410-aad2-9ed5178a7e87
This commit is contained in:
Thomas Perl 2006-06-13 18:55:28 +00:00
parent d30527dd01
commit 05f1ad58c2
1 changed files with 12 additions and 17 deletions

View File

@ -117,24 +117,19 @@ def dotdesktop_command( command, filename):
# http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-0.9.4.html
if command.find( '%U') != -1:
# A list of URLs. (we only need one, anyway..)
commandline = command.replace( '%U', ( '"file://%s"' % (filename) ) )
else if command.find( '%u') != -1:
return command.replace( '%U', ( '"file://%s"' % (filename) ) )
if command.find( '%u') != -1:
# A single URL.
commandline = command.replace( '%u', ( '"file://%s"' % (filename) ) )
else if command.find( '%F') != -1:
# A list of files. (we only need one...)
commandline = command.replace( '%F', filename )
else if command.find( '%f') != -1:
# A single file name, even if multiple files are selected.
commandline = command.replace( '%f', filename )
else:
# default known-good variant: 1st parameter = filename
commandline = '%s "%s"' % ( command, filename )
if libgpodder.isDebugging():
print 'dotdesktop_command provides: %s' % ( commandline )
return commandline
return command.replace( '%u', ( '"file://%s"' % (filename) ) )
if command.find( '%F') != -1:
# A list of files. (we only need one...)
return command.replace( '%F', filename )
if command.find( '%f') != -1:
# A single file name, even if multiple files are selected.
return command.replace( '%f', filename )
# default known-good variant: 1st parameter = filename
return '%s "%s"' % ( command, filename )
# end dotdesktop_command