File: upload-system-info

package info (click to toggle)
xapp 2.8.13-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,724 kB
  • sloc: ansic: 11,268; python: 1,463; xml: 258; sh: 22; makefile: 9
file content (16 lines) | stat: -rwxr-xr-x 624 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/python3

import subprocess, os

try:
    inxi = subprocess.Popen(['inxi', '-Fxxrzc0'], stdout=subprocess.PIPE)
    pastebin = subprocess.Popen(['/usr/share/xapps-common/bin/pastebin'], stdin=inxi.stdout, stdout=subprocess.PIPE)
    inxi.stdout.close()
    output = pastebin.communicate()[0]
    output = output.split()[0] # if we have more than one URL, only use the first one
    pastebin.wait()
    subprocess.call(['xdg-open', output])
except Exception as e:
    print ("An error occurred while uploading the system information:")
    print (e)
    print ("Please make sure you're connected to the Internet.")