Merge pull request #983 from cclauss/patch-1

GitHub Action: There is no requirements.txt
pull/850/head^2
Apprentice Harper 4 years ago committed by GitHub
commit a107742191
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,9 +7,9 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [macos-latest] os: [macos-latest]
python-version: [2.7, 3.8] python-version: [2.7] # , 3.8]
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1 uses: actions/setup-python@v1
with: with:
@ -17,7 +17,7 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install flake8 pytest -r requirements.txt pip install flake8 pytest # -r requirements.txt
#- name: Check formatting with black #- name: Check formatting with black
# if: matrix.python-version == '3.8' # if: matrix.python-version == '3.8'
# run: | # run: |
@ -26,9 +26,9 @@ jobs:
- name: Lint with flake8 - name: Lint with flake8
run: | run: |
# stop the build if there are Python syntax errors or undefined names # stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics flake8 . --builtins=_,I --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics flake8 . --builtins=_,I --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
#- name: Test with pytest #- name: Test with pytest
# run: pytest # run: pytest
#- name: Run doctests with pytest #- name: Run doctests with pytest

@ -87,6 +87,11 @@ import zipfile
import traceback import traceback
from zipfile import ZipFile from zipfile import ZipFile
import erdr2pml
import ineptpdf
import k4mobidedrm
import zipfix
class DeDRMError(Exception): class DeDRMError(Exception):
pass pass

@ -48,7 +48,7 @@ from __future__ import with_statement
__version__ = '1.01' __version__ = '1.01'
import sys, struct, os import sys, struct, os, traceback
import zlib import zlib
import zipfile import zipfile
import xml.etree.ElementTree as etree import xml.etree.ElementTree as etree

@ -1,6 +1,8 @@
#! /usr/bin/python #! /usr/bin/python
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
from .convert2xml import encodeNumber
class Unbuffered: class Unbuffered:
def __init__(self, stream): def __init__(self, stream):
self.stream = stream self.stream = stream

@ -40,6 +40,12 @@ from struct import pack, unpack, unpack_from
import json import json
import getopt import getopt
try:
RegError
except NameError:
class RegError(Exception):
pass
# Routines common to Mac and PC # Routines common to Mac and PC
# Wrap a stream so that output gets flushed immediately # Wrap a stream so that output gets flushed immediately
@ -1302,7 +1308,7 @@ elif isosx:
uuids = [] uuids = []
uuidnum = os.getenv('MYUUIDNUMBER') uuidnum = os.getenv('MYUUIDNUMBER')
if uuidnum != None: if uuidnum != None:
uuids.append(strip(uuidnum)) uuids.append(uuidnum.strip())
cmdline = '/usr/sbin/ioreg -l -S -w 0 -r -c AppleAHCIDiskDriver' cmdline = '/usr/sbin/ioreg -l -S -w 0 -r -c AppleAHCIDiskDriver'
cmdline = cmdline.encode(sys.getfilesystemencoding()) cmdline = cmdline.encode(sys.getfilesystemencoding())
p = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False) p = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)

@ -524,7 +524,7 @@ def cli_main():
else: else:
infile = argv[1] infile = argv[1]
outfile = argv[2] outfile = argv[2]
if len(argv) is 4: if len(argv) == 4:
pidlist = argv[3].split(',') pidlist = argv[3].split(',')
else: else:
pidlist = [] pidlist = []

@ -11,7 +11,7 @@ def load_pycrypto():
class DES(object): class DES(object):
def __init__(self, key): def __init__(self, key):
if len(key) != 8 : if len(key) != 8 :
raise Error('DES improper key used') raise ValueError('DES improper key used')
self.key = key self.key = key
self._des = _DES.new(key,_DES.MODE_ECB) self._des = _DES.new(key,_DES.MODE_ECB)
def desdecrypt(self, data): def desdecrypt(self, data):

@ -114,6 +114,7 @@ def decryptpdf(infile, outdir, rscpath):
def decryptpdb(infile, outdir, rscpath): def decryptpdb(infile, outdir, rscpath):
errlog = ''
outname = os.path.splitext(os.path.basename(infile))[0] + ".pmlz" outname = os.path.splitext(os.path.basename(infile))[0] + ".pmlz"
outpath = os.path.join(outdir, outname) outpath = os.path.join(outdir, outname)
rv = 1 rv = 1
@ -141,6 +142,7 @@ def decryptpdb(infile, outdir, rscpath):
def decryptk4mobi(infile, outdir, rscpath): def decryptk4mobi(infile, outdir, rscpath):
errlog = ''
rv = 1 rv = 1
pidnums = [] pidnums = []
pidspath = os.path.join(rscpath,'pidlist.txt') pidspath = os.path.join(rscpath,'pidlist.txt')

@ -3,6 +3,8 @@
from __future__ import with_statement from __future__ import with_statement
from ignoblekeygen import generate_key
__license__ = 'GPL v3' __license__ = 'GPL v3'
DETAILED_MESSAGE = \ DETAILED_MESSAGE = \

@ -6,7 +6,7 @@ from __future__ import with_statement
__license__ = 'GPL v3' __license__ = 'GPL v3'
# Standard Python modules. # Standard Python modules.
import os, sys, re, hashlib import os, sys, re, hashlib, traceback
from calibre_plugins.dedrm.__init__ import PLUGIN_NAME, PLUGIN_VERSION from calibre_plugins.dedrm.__init__ import PLUGIN_NAME, PLUGIN_VERSION
def WineGetKeys(scriptpath, extension, wineprefix=""): def WineGetKeys(scriptpath, extension, wineprefix=""):

@ -8,6 +8,7 @@ __copyright__ = '2012, David Forrester <davidfor@internode.on.net>'
__docformat__ = 'restructuredtext en' __docformat__ = 'restructuredtext en'
import os, time, re, sys import os, time, re, sys
from datetime import datetime
try: try:
from PyQt5.Qt import (Qt, QIcon, QPixmap, QLabel, QDialog, QHBoxLayout, QProgressBar, from PyQt5.Qt import (Qt, QIcon, QPixmap, QLabel, QDialog, QHBoxLayout, QProgressBar,
QTableWidgetItem, QFont, QLineEdit, QComboBox, QTableWidgetItem, QFont, QLineEdit, QComboBox,

@ -145,28 +145,6 @@ class ManageKeysDialog(QDialog):
self.listy.clear() self.listy.clear()
self.populate_list() self.populate_list()
def rename_key(self):
if not self.listy.currentItem():
errmsg = u"No {0} selected to rename. Highlight a keyfile first.".format(self.key_type_name)
r = error_dialog(None, "{0} {1}".format(PLUGIN_NAME, PLUGIN_VERSION),
_(errmsg), show=True, show_copy_button=False)
return
d = RenameKeyDialog(self)
d.exec_()
if d.result() != d.Accepted:
# rename cancelled or moot.
return
keyname = unicode(self.listy.currentItem().text())
if not question_dialog(self, "{0} {1}: Confirm Rename".format(PLUGIN_NAME, PLUGIN_VERSION), u"Do you really want to rename the {2} named <strong>{0}</strong> to <strong>{1}</strong>?".format(keyname,d.key_name,self.key_type_name), show_copy_button=False, default_yes=False):
return
self.plugin_keys[d.key_name] = self.plugin_keys[keyname]
del self.plugin_keys[keyname]
self.listy.clear()
self.populate_list()
def delete_key(self): def delete_key(self):
if not self.listy.currentItem(): if not self.listy.currentItem():
return return

Loading…
Cancel
Save