-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwrapper.py
38 lines (32 loc) · 1.3 KB
/
wrapper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from Tkinter import *
# this is not complete for testing is only here for persnonal developement/use
import subprocess
#TODO figure out how to pass a string from python to a shell command subprocess
def show_entry_fields():
myPath = e1.get()
print("Destination: %s" % (myPath))
def Mount():
print "Mounting"
subprocess.call(['./rip.sh -m'], shell=True)
def Copy():
print "Copying"
myPath = e1.get()
subprocess.call(['./rip.sh -c'], shell=True)
def Unmount():
print "Unmounting"
subprocess.call(['./rip.sh -u'], shell=True)
def Clean():
print "Cleaning"
subprocess.call(['./rip.sh -x'], shell=True)
master = Tk()
Label(master, text="Destination:").grid(row=0, column=0)
master.wm_title("SD-Ripper")
e1 = Entry(master)
e1.grid(row=0, column=1)
Button(master, text='Mount', command=Mount).grid(row=2, column=0, sticky=W, pady=4)
Button(master, text='Copy', command=Copy).grid(row=2, column=1, sticky=W, pady=4)
Button(master, text='Unmount', command=Unmount).grid(row=3, column=0, sticky=W, pady=4)
Button(master, text='Clean', command=Clean).grid(row=3, column=1, sticky=W, pady=4)
Button(master, text='Quit', command=master.quit).grid(row=4, column=0, sticky=W, pady=4)
Button(master, text='Show', command=show_entry_fields).grid(row=4, column=1, sticky=W, pady=4)
mainloop( )