Pastebin: Added support for fpaste
Clement Lefebvre
7 years ago
21 | 21 |
content = str_args
|
22 | 22 |
|
23 | 23 |
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"))
|
0 | 0 |
#!/usr/bin/python3
|
1 | 1 |
|
2 | |
import subprocess
|
|
2 |
import subprocess, os
|
3 | 3 |
|
4 | 4 |
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)
|
6 | 6 |
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()
|
10 | 10 |
subprocess.call(['xdg-open', output])
|