tools v5.1

alfcrypto added to DeDRM plugin
This commit is contained in:
Apprentice Alf
2012-05-16 17:15:43 +01:00
parent 07e532f59c
commit 2c95633fcd
63 changed files with 6776 additions and 5314 deletions

View File

@@ -36,6 +36,7 @@ __license__ = 'GPL v3'
import sys
import os
os.environ['PYTHONIOENCODING'] = "utf-8"
import re
import shutil
import Tkinter

View File

@@ -4,6 +4,7 @@
import sys
sys.path.append('lib')
import os, os.path, urllib
os.environ['PYTHONIOENCODING'] = "utf-8"
import subprocess
from subprocess import Popen, PIPE, STDOUT
import subasyncio
@@ -73,7 +74,6 @@ class MainDialog(Tkinter.Frame):
# post output from subprocess in scrolled text widget
def showCmdOutput(self, msg):
if msg and msg !='':
msg = msg.encode('utf-8')
if sys.platform.startswith('win'):
msg = msg.replace('\r\n','\n')
self.stext.insert(Tkconstants.END,msg)
@@ -83,14 +83,19 @@ class MainDialog(Tkinter.Frame):
# run as a subprocess via pipes and collect stdout
def pidrdr(self, serial):
# os.putenv('PYTHONUNBUFFERED', '1')
cmdline = 'python ./lib/kindlepid.py "' + serial + '"'
pengine = sys.executable
if pengine is None or pengine == '':
pengine = "python"
pengine = os.path.normpath(pengine)
cmdline = pengine + ' ./lib/kindlepid.py "' + serial + '"'
if sys.platform[0:3] == 'win':
search_path = os.environ['PATH']
search_path = search_path.lower()
if search_path.find('python') >= 0:
cmdline = 'python lib\kindlepid.py "' + serial + '"'
else :
cmdline = 'lib\kindlepid.py "' + serial + '"'
# search_path = os.environ['PATH']
# search_path = search_path.lower()
# if search_path.find('python') >= 0:
# cmdline = 'python lib\kindlepid.py "' + serial + '"'
# else :
# cmdline = 'lib\kindlepid.py "' + serial + '"'
cmdline = pengine + ' lib\\kindlepid.py "' + serial + '"'
cmdline = cmdline.encode(sys.getfilesystemencoding())
p2 = Process(cmdline, shell=True, bufsize=1, stdin=None, stdout=PIPE, stderr=PIPE, close_fds=False)
return p2
@@ -116,7 +121,6 @@ class MainDialog(Tkinter.Frame):
log += 'Serial = "' + serial + '"\n'
log += '\n\n'
log += 'Please Wait ...\n\n'
log = log.encode('utf-8')
self.stext.insert(Tkconstants.END,log)
self.p2 = self.pidrdr(serial)

View File

@@ -4,6 +4,7 @@
import sys
sys.path.append('lib')
import os, os.path, urllib
os.environ['PYTHONIOENCODING'] = "utf-8"
import subprocess
from subprocess import Popen, PIPE, STDOUT
import subasyncio
@@ -89,7 +90,6 @@ class MainDialog(Tkinter.Frame):
# post output from subprocess in scrolled text widget
def showCmdOutput(self, msg):
if msg and msg !='':
msg = msg.encode('utf-8')
if sys.platform.startswith('win'):
msg = msg.replace('\r\n','\n')
self.stext.insert(Tkconstants.END,msg)
@@ -98,15 +98,20 @@ class MainDialog(Tkinter.Frame):
# run as a subprocess via pipes and collect stdout
def mobirdr(self, infile, outfile, pidnum):
pengine = sys.executable
if pengine is None or pengine == '':
pengine = "python"
pengine = os.path.normpath(pengine)
# os.putenv('PYTHONUNBUFFERED', '1')
cmdline = 'python ./lib/mobidedrm.py "' + infile + '" "' + outfile + '" "' + pidnum + '"'
cmdline = pengine + ' ./lib/mobidedrm.py "' + infile + '" "' + outfile + '" "' + pidnum + '"'
if sys.platform[0:3] == 'win':
search_path = os.environ['PATH']
search_path = search_path.lower()
if search_path.find('python') >= 0:
cmdline = 'python lib\mobidedrm.py "' + infile + '" "' + outfile + '" "' + pidnum + '"'
else :
cmdline = 'lib\mobidedrm.py "' + infile + '" "' + outfile + '" "' + pidnum + '"'
# search_path = os.environ['PATH']
# search_path = search_path.lower()
# if search_path.find('python') >= 0:
# cmdline = 'python lib\mobidedrm.py "' + infile + '" "' + outfile + '" "' + pidnum + '"'
# else :
# cmdline = 'lib\mobidedrm.py "' + infile + '" "' + outfile + '" "' + pidnum + '"'
cmdline = pengine + ' lib\\mobidedrm.py "' + infile + '" "' + outfile + '" "' + pidnum + '"'
cmdline = cmdline.encode(sys.getfilesystemencoding())
p2 = Process(cmdline, shell=True, bufsize=1, stdin=None, stdout=PIPE, stderr=PIPE, close_fds=False)
@@ -173,7 +178,6 @@ class MainDialog(Tkinter.Frame):
log += 'PID = "' + pidnum + '"\n'
log += '\n\n'
log += 'Please Wait ...\n\n'
log = log.encode('utf-8')
self.stext.insert(Tkconstants.END,log)
self.p2 = self.mobirdr(mobipath, outpath, pidnum)