Codebase list xapp / 0f28d18
Pastebin: Added support for fpaste Clement Lefebvre 7 years ago
2 changed file(s) with 9 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
2121 content = str_args
2222
2323 if content != "":
24 p = subprocess.Popen(["/usr/bin/gist-paste"], stdin=subprocess.PIPE)
25 p.communicate(content.encode("UTF-8"))
24 for paster in ['/usr/bin/gist-paste', '/usr/bin/fpaste']:
25 if os.path.exists(paster):
26 p = subprocess.Popen([paster], stdin=subprocess.PIPE)
27 p.communicate(content.encode("UTF-8"))
00 #!/usr/bin/python3
11
2 import subprocess
2 import subprocess, os
33
44 inxi = subprocess.Popen(['inxi', '-Fxxrzc0'], stdout=subprocess.PIPE)
5 gist = subprocess.Popen(['gist-paste'], stdin=inxi.stdout, stdout=subprocess.PIPE)
5 pastebin = subprocess.Popen(['/usr/bin/pastebin'], stdin=inxi.stdout, stdout=subprocess.PIPE)
66 inxi.stdout.close()
7 output = gist.communicate()[0]
8 gist.wait()
9
7 output = pastebin.communicate()[0]
8 output = output.split()[0] # if we have more than one URL, only use the first one
9 pastebin.wait()
1010 subprocess.call(['xdg-open', output])