3 import os, subprocess, sys, urlparse
6 # Thanks to the vast knowledge of Laurence Withers (lwithers) and this message:
7 # http://mail.python.org/pipermail/python-list/2006-November/587523.html
9 null = os.open(os.devnull,os.O_WRONLY)
10 for i in range(3): os.dup2(null,i)
15 if __name__ == '__main__':
17 u = urlparse.urlparse(uri)
18 if u.scheme == 'mailto':
19 detach_open(['xterm', '-e', 'mail %s' % u.path])
20 elif u.scheme == 'xmpp':
21 detach_open(['gajim-remote', 'open_chat', uri])
22 elif u.scheme == 'git':
23 detach_open(['git', 'clone', uri], cwd=os.path.expanduser('~/src'))