[00:10] if I have a path to a .desktop file, what's the best way of launching that program from a python app? Do I have to open it and parse it for the Exec key myself? [00:11] aquarius: you could possibly use python-xdg to parse the .desktop file, I don't know if it'd be worth it though [00:13] well... "Parse"? :) for line in open("/path/to/desktop.file"): if line.startswith("Exec="): subprocess.check_call([line[5:]]) [00:13] heh. [00:13] not if, for example, the exec line specifies a parameter [00:13] or if it's broken over two lines [00:13] which would need the % arguments stripped off :) [00:13] etc, etc, etc :) [00:14] this is why I was hoping someone else had already done the hard work ;) [00:15] aquarius, add shell=True and it'll work with parameters. But what do you mean broken over two lines? Is that legal in .desktop-files? [00:15] jo-erlend, yeah, I am pretty sure there's a line-break thing [00:15] am looking at pyxdg [00:15] oh. I didn't know that. [00:15] gio.AppInfo is the way to launch it, I think [00:15] python-xdg has a DesktopEntry class with a getExec() method, probably the closest you'll get :) [00:16] but I still need to load the individual details with pyxdg to pass them to gio. Bah [00:16] wish gio.AppInfo had a load_desktop_file method. [00:16] it used to be that you could just call 'xdg-open blah.desktop' & it'd run it [00:24] btw... I've forgotten how to get outputs of commands as lines when running subprocess. Anyone? [01:01] jo-erlend, http://docs.python.org/library/subprocess.html#replacing-bin-sh-shell-backquote [08:20] morning [08:39] morning. :) [09:32] hi === johnoxton_ is now known as johnoxton === johnoxton_ is now known as johnoxton