tools v6.0.5

This commit is contained in:
Apprentice Alf
2013-04-24 19:28:20 +01:00
parent cd2d74601a
commit a399d3b7bd
13 changed files with 305 additions and 26 deletions

View File

@@ -24,7 +24,7 @@
<key>CFBundleExecutable</key>
<string>droplet</string>
<key>CFBundleGetInfoString</key>
<string>DeDRM AppleScript 6.0.4. Written 20102013 by Apprentice Alf and others.</string>
<string>DeDRM AppleScript 6.0.5. Written 20102013 by Apprentice Alf and others.</string>
<key>CFBundleIconFile</key>
<string>DeDRM</string>
<key>CFBundleIdentifier</key>
@@ -36,7 +36,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>6.0.4</string>
<string>6.0.5</string>
<key>CFBundleSignature</key>
<string>dplt</string>
<key>LSRequiresCarbon</key>

View File

@@ -34,7 +34,7 @@ Decrypt DRMed ebooks.
"""
PLUGIN_NAME = u"DeDRM"
PLUGIN_VERSION_TUPLE = (6, 0, 2)
PLUGIN_VERSION_TUPLE = (6, 0, 5)
PLUGIN_VERSION = u".".join([unicode(str(x)) for x in PLUGIN_VERSION_TUPLE])
# Include an html helpfile in the plugin's zipfile with the following name.
RESOURCE_NAME = PLUGIN_NAME + '_Help.htm'

View File

@@ -6,7 +6,7 @@ from __future__ import with_statement
__license__ = 'GPL v3'
# Standard Python modules.
import os, traceback
import os, traceback, json
# PyQT4 modules (part of calibre).
from PyQt4.Qt import (Qt, QWidget, QHBoxLayout, QVBoxLayout, QLabel, QLineEdit,
@@ -178,8 +178,8 @@ class ManageKeysDialog(QDialog):
self.create_key = create_key
self.keyfile_ext = keyfile_ext
self.import_key = (keyfile_ext != u"")
self.binary_file = (keyfile_ext == u".der")
self.json_file = (keyfile_ext == u".k4i")
self.binary_file = (keyfile_ext == u"der")
self.json_file = (keyfile_ext == u"k4i")
self.wineprefix = wineprefix
self.setWindowTitle("{0} {1}: Manage {2}s".format(PLUGIN_NAME, PLUGIN_VERSION, self.key_type_name))
@@ -676,7 +676,7 @@ class AddAdeptDialog(QDialog):
from calibre_plugins.dedrm.adobekey import adeptkeys
defaultkeys = adeptkeys()
else: # linux
else: # linux
from wineutils import WineGetKeys
scriptpath = os.path.join(parent.parent.alfdir,u"adobekey.py")

View File

@@ -71,7 +71,7 @@ def unicode_argv():
argvencoding = sys.stdin.encoding
if argvencoding == None:
argvencoding = 'utf-8'
return [arg if (type(arg) == unicode) else unicode(arg,argvencoding) for arg in sys.argv]
return [arg if (type(arg) == unicode) else unicode(arg, argvencoding) for arg in sys.argv]
#global switch
debug = False
@@ -92,12 +92,12 @@ class DrmException(Exception):
def zipUpDir(myzip, tdir, localname):
currentdir = tdir
if localname != u"":
currentdir = os.path.join(currentdir,localname)
currentdir = os.path.join(currentdir, localname)
list = os.listdir(currentdir)
for file in list:
afilename = file
localfilePath = os.path.join(localname, afilename)
realfilePath = os.path.join(currentdir,file)
realfilePath = os.path.join(currentdir, file)
if os.path.isfile(realfilePath):
myzip.write(realfilePath, localfilePath)
elif os.path.isdir(realfilePath):
@@ -116,7 +116,7 @@ def bookReadEncodedNumber(fo):
data = ord(fo.read(1))
if data >= 0x80:
datax = (data & 0x7F)
while data >= 0x80 :
while data >= 0x80:
data = ord(fo.read(1))
datax = (datax <<7) + (data & 0x7F)
data = datax