Fix missing maim.py file in update pypi package
Bugfix after last testrun
This commit is contained in:
Ozzie Isaacs 2022-05-01 10:25:07 +02:00
parent 813d303ea7
commit 12f3a13d1d
3 changed files with 203 additions and 199 deletions

View File

@ -804,8 +804,8 @@ def save_cover_from_url(url, book_path):
elif use_advocate:
img = advocate.get(url, timeout=(10, 200), allow_redirects=False) # ToDo: Error Handling
else:
log.error("python modul advocate is not installed but is needed")
return False, _("Python modul 'advocate' is not installed but is needed for cover downloads")
log.error("python module advocate is not installed but is needed")
return False, _("Python module 'advocate' is not installed but is needed for cover downloads")
img.raise_for_status()
return save_cover(img, book_path)
except (socket.gaierror,

View File

@ -266,8 +266,9 @@ class Updater(threading.Thread):
if additional_path:
exclude.append(additional_path)
exclude = tuple(exclude)
# check if we are in a package, rename cps.py to __init__.py
# check if we are in a package, rename cps.py to __init__.py and __main__.py
if constants.HOME_CONFIG:
shutil.copy(os.path.join(source, 'cps.py'), os.path.join(source, '__main__.py'))
shutil.move(os.path.join(source, 'cps.py'), os.path.join(source, '__init__.py'))
for root, dirs, files in os.walk(destination, topdown=True):

View File

@ -37,20 +37,20 @@
<div class="row">
<div class="col-xs-6 col-md-6 col-sm-offset-3" style="margin-top:50px;">
<p class='text-justify attribute'><strong>Start Time: </strong>2022-04-29 21:17:05</p>
<p class='text-justify attribute'><strong>Start Time: </strong>2022-04-30 21:05:13</p>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-md-6 col-sm-offset-3">
<p class='text-justify attribute'><strong>Stop Time: </strong>2022-04-30 03:15:20</p>
<p class='text-justify attribute'><strong>Stop Time: </strong>2022-05-01 02:54:00</p>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-md-6 col-sm-offset-3">
<p class='text-justify attribute'><strong>Duration: </strong>5h 5 min</p>
<p class='text-justify attribute'><strong>Duration: </strong>4h 55 min</p>
</div>
</div>
</div>
@ -600,8 +600,8 @@
<tr id="su" class="failClass">
<td>TestEbookConvertCalibreGDrive</td>
<td class="text-center">7</td>
<td class="text-center">5</td>
<td class="text-center">2</td>
<td class="text-center">6</td>
<td class="text-center">1</td>
<td class="text-center">0</td>
<td class="text-center">0</td>
<td class="text-center">
@ -611,31 +611,11 @@
<tr id="ft7.1" class="none bg-danger">
<tr id='pt7.1' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestEbookConvertCalibreGDrive - test_convert_email</div>
</td>
<td colspan='6'>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft7.1')">FAIL</a>
</div>
<!--css div popup start-->
<div id="div_ft7.1" class="popup_window test_output" style="display:block;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus="this.blur();"
onclick="document.getElementById('div_ft7.1').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File &#34;/home/ozzie/Development/calibre-web-test/test/test_ebook_convert_gdrive.py&#34;, line 198, in test_convert_email
self.assertTrue(&#34;E-mail&#34; in ret[-1][&#39;task&#39;])
AssertionError: False is not true</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
@ -702,7 +682,7 @@ AssertionError: False is not true</pre>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File &#34;/home/ozzie/Development/calibre-web-test/test/test_ebook_convert_gdrive.py&#34;, line 442, in test_thumbnail_cache
File &#34;/home/ozzie/Development/calibre-web-test/test/test_ebook_convert_gdrive.py&#34;, line 443, in test_thumbnail_cache
self.assertEqual(10*2, count_files(thumbnail_cache_path))
AssertionError: 20 != 0</pre>
</div>
@ -1662,11 +1642,11 @@ AssertionError: 20 != 0</pre>
<tr id="su" class="failClass">
<tr id="su" class="passClass">
<td>TestEditBooksOnGdrive</td>
<td class="text-center">18</td>
<td class="text-center">17</td>
<td class="text-center">1</td>
<td class="text-center">18</td>
<td class="text-center">0</td>
<td class="text-center">0</td>
<td class="text-center">0</td>
<td class="text-center">
@ -1829,31 +1809,11 @@ AssertionError: 20 != 0</pre>
<tr id="ft16.18" class="none bg-danger">
<tr id='pt16.18' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestEditBooksOnGdrive - test_watch_metadata</div>
</td>
<td colspan='6'>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft16.18')">FAIL</a>
</div>
<!--css div popup start-->
<div id="div_ft16.18" class="popup_window test_output" style="display:block;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus="this.blur();"
onclick="document.getElementById('div_ft16.18').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File &#34;/home/ozzie/Development/calibre-web-test/test/test_edit_ebooks_gdrive.py&#34;, line 931, in test_watch_metadata
self.assertNotIn(&#39;series&#39;, book)
AssertionError: &#39;series&#39; unexpectedly found in {&#39;id&#39;: 5, &#39;reader&#39;: [], &#39;title&#39;: &#39;testbook&#39;, &#39;author&#39;: [&#39;John Döe&#39;], &#39;rating&#39;: 0, &#39;languages&#39;: [&#39;English&#39;], &#39;identifier&#39;: [], &#39;cover&#39;: &#39;/cover/5/og?c=1651263008&#39;, &#39;tag&#39;: [], &#39;publisher&#39;: [&#39;Randomhäus&#39;], &#39;pubdate&#39;: &#39;Jan 19, 2017&#39;, &#39;comment&#39;: &#39;Lorem ipsum dolor sit amet, consectetuer adipiscing elit.Aenean commodo ligula eget dolor.Aenean massa.Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.Nulla consequat massa quis enim.Donec pede justo, fringilla vel, aliquet nec, vulputate&#39;, &#39;add_shelf&#39;: [], &#39;del_shelf&#39;: [], &#39;edit_enable&#39;: True, &#39;kindle&#39;: None, &#39;kindlebtn&#39;: None, &#39;download&#39;: [&#39;EPUB (6.7 kB)&#39;], &#39;read&#39;: False, &#39;archived&#39;: False, &#39;series_all&#39;: &#39;Book 1 of test&#39;, &#39;series_index&#39;: &#39;1&#39;, &#39;series&#39;: &#39;test&#39;, &#39;cust_columns&#39;: []}</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
@ -3662,8 +3622,8 @@ AssertionError: &#39;series&#39; unexpectedly found in {&#39;id&#39;: 5, &#39;re
<tr id="su" class="failClass">
<td>TestThumbnails</td>
<td class="text-center">8</td>
<td class="text-center">6</td>
<td class="text-center">1</td>
<td class="text-center">5</td>
<td class="text-center">2</td>
<td class="text-center">0</td>
<td class="text-center">1</td>
<td class="text-center">
@ -3700,11 +3660,31 @@ AssertionError: &#39;series&#39; unexpectedly found in {&#39;id&#39;: 5, &#39;re
<tr id='pt43.4' class='hiddenRow bg-success'>
<tr id="ft43.4" class="none bg-danger">
<td>
<div class='testcase'>TestThumbnails - test_cover_change_on_upload_new_cover</div>
</td>
<td colspan='6' align='center'>PASS</td>
<td colspan='6'>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft43.4')">FAIL</a>
</div>
<!--css div popup start-->
<div id="div_ft43.4" class="popup_window test_output" style="display:block;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus="this.blur();"
onclick="document.getElementById('div_ft43.4').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File &#34;/home/ozzie/Development/calibre-web-test/test/test_thumbnails.py&#34;, line 135, in test_cover_change_on_upload_new_cover
self.assertGreaterEqual(diff(BytesIO(updated_cover), BytesIO(original_cover), delete_diff_file=True), 0.05)
AssertionError: 0.038404302739168276 not greater than or equal to 0.05</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
</tr>
@ -3753,9 +3733,9 @@ AssertionError: &#39;series&#39; unexpectedly found in {&#39;id&#39;: 5, &#39;re
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File &#34;/home/ozzie/Development/calibre-web-test/test/test_thumbnails.py&#34;, line 310, in test_sideloaded_book
self.assertAlmostEqual(diff(BytesIO(list_cover), BytesIO(old_list_cover), delete_diff_file=True), 0.0,
AssertionError: 0.005138437597261127 != 0.0 within 0.0001 delta (0.005138437597261127 difference)</pre>
File &#34;/home/ozzie/Development/calibre-web-test/test/test_thumbnails.py&#34;, line 308, in test_sideloaded_book
self.assertGreaterEqual(diff(BytesIO(cover), BytesIO(old_cover), delete_diff_file=True), 0.04)
AssertionError: 0.03724830839072722 not greater than or equal to 0.04</pre>
</div>
<div class="clearfix"></div>
</div>
@ -3766,12 +3746,12 @@ AssertionError: 0.005138437597261127 != 0.0 within 0.0001 delta (0.0051384375972
<tr id="su" class="errorClass">
<tr id="su" class="skipClass">
<td>TestUpdater</td>
<td class="text-center">9</td>
<td class="text-center">4</td>
<td class="text-center">3</td>
<td class="text-center">1</td>
<td class="text-center">8</td>
<td class="text-center">0</td>
<td class="text-center">0</td>
<td class="text-center">1</td>
<td class="text-center">
<a onclick="showClassDetail('c44', 9)">Detail</a>
@ -3789,33 +3769,11 @@ AssertionError: 0.005138437597261127 != 0.0 within 0.0001 delta (0.0051384375972
<tr id="et44.2" class="none bg-info">
<tr id='pt44.2' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestUpdater - test_check_update_nightly_request_errors</div>
</td>
<td colspan='6'>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_et44.2')">ERROR</a>
</div>
<!--css div popup start-->
<div id="div_et44.2" class="popup_window test_output" style="display:block;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus="this.blur();"
onclick="document.getElementById('div_et44.2').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File &#34;/home/ozzie/Development/calibre-web-test/test/test_updater.py&#34;, line 268, in test_check_update_nightly_request_errors
self.check_updater(&#39;Could not fetch&#39;, &#34;alert&#34;)
File &#34;/home/ozzie/Development/calibre-web-test/test/test_updater.py&#34;, line 76, in check_updater
self.assertTrue(responsetext in self.check_element_on_page((By.ID, &#34;message&#34;)).text)
AttributeError: &#39;bool&#39; object has no attribute &#39;text&#39;</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
@ -3838,60 +3796,20 @@ AttributeError: &#39;bool&#39; object has no attribute &#39;text&#39;</pre>
<tr id="ft44.5" class="none bg-danger">
<tr id='pt44.5' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestUpdater - test_perform_update</div>
</td>
<td colspan='6'>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft44.5')">FAIL</a>
</div>
<!--css div popup start-->
<div id="div_ft44.5" class="popup_window test_output" style="display:block;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus="this.blur();"
onclick="document.getElementById('div_ft44.5').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File &#34;/home/ozzie/Development/calibre-web-test/test/test_updater.py&#34;, line 363, in test_perform_update
self.assertTrue(thumbail_cache_path)
AssertionError: False is not true</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id="ft44.6" class="none bg-danger">
<tr id='pt44.6' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestUpdater - test_perform_update_stable_errors</div>
</td>
<td colspan='6'>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft44.6')">FAIL</a>
</div>
<!--css div popup start-->
<div id="div_ft44.6" class="popup_window test_output" style="display:block;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus="this.blur();"
onclick="document.getElementById('div_ft44.6').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File &#34;/home/ozzie/Development/calibre-web-test/test/test_updater.py&#34;, line 321, in test_perform_update_stable_errors
self.assertTrue(&#39;HTTP Error&#39; in self.check_element_on_page((By.ID, &#34;DialogContent&#34;)).text)
AssertionError: False is not true</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
@ -3931,31 +3849,11 @@ AssertionError: False is not true</pre>
<tr id="ft44.9" class="none bg-danger">
<tr id='pt44.9' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestUpdater - test_update_write_protect</div>
</td>
<td colspan='6'>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft44.9')">FAIL</a>
</div>
<!--css div popup start-->
<div id="div_ft44.9" class="popup_window test_output" style="display:block;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus="this.blur();"
onclick="document.getElementById('div_ft44.9').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File &#34;/home/ozzie/Development/calibre-web-test/test/test_updater.py&#34;, line 424, in test_update_write_protect
self.assertTrue(&#39;Update failed&#39; in self.check_element_on_page((By.ID, &#34;DialogContent&#34;)).text)
AssertionError: False is not true</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
@ -4747,65 +4645,170 @@ AssertionError: False is not true</pre>
<tr id="su" class="errorClass">
<td>_ErrorHolder</td>
<td class="text-center">1</td>
<tr id="su" class="passClass">
<td>TestCalibreHelper</td>
<td class="text-center">16</td>
<td class="text-center">16</td>
<td class="text-center">0</td>
<td class="text-center">0</td>
<td class="text-center">1</td>
<td class="text-center">0</td>
<td class="text-center">
<a onclick="showClassDetail('c50', 1)">Detail</a>
<a onclick="showClassDetail('c50', 16)">Detail</a>
</td>
</tr>
<tr id="et50.1" class="none bg-info">
<tr id='pt50.1' class='hiddenRow bg-success'>
<td>
<div class='testcase'>setUpClass (test_zz_helper)</div>
<div class='testcase'>TestCalibreHelper - test_author_sort</div>
</td>
<td colspan='6'>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_et50.1')">ERROR</a>
</div>
<!--css div popup start-->
<div id="div_et50.1" class="popup_window test_output" style="display:block;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus="this.blur();"
onclick="document.getElementById('div_et50.1').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File &#34;/home/ozzie/Development/calibre-web-test/test/test_zz_helper.py&#34;, line 30, in setUpClass
from cps import cli_param
File &#34;/home/ozzie/Development/calibre-web/cps/__init__.py&#34;, line 29, in &lt;module&gt;
from .MyLoginManager import MyLoginManager
File &#34;/home/ozzie/Development/calibre-web/cps/MyLoginManager.py&#34;, line 24, in &lt;module&gt;
from flask_login import LoginManager
File &#34;/home/ozzie/Development/calibre-web-test/venv/lib/python3.8/site-packages/flask_login/__init__.py&#34;, line 16, in &lt;module&gt;
from .login_manager import LoginManager
File &#34;/home/ozzie/Development/calibre-web-test/venv/lib/python3.8/site-packages/flask_login/login_manager.py&#34;, line 24, in &lt;module&gt;
from .utils import (login_url as make_login_url, _create_identifier,
File &#34;/home/ozzie/Development/calibre-web-test/venv/lib/python3.8/site-packages/flask_login/utils.py&#34;, line 13, in &lt;module&gt;
from werkzeug.security import safe_str_cmp
ImportError: cannot import name &#39;safe_str_cmp&#39; from &#39;werkzeug.security&#39; (/home/ozzie/Development/calibre-web-test/venv/lib/python3.8/site-packages/werkzeug/security.py)</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt50.2' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestCalibreHelper - test_author_sort_comma</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt50.3' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestCalibreHelper - test_author_sort_junior</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt50.4' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestCalibreHelper - test_author_sort_oneword</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt50.5' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestCalibreHelper - test_author_sort_roman</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt50.6' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestCalibreHelper - test_check_Limit_Length</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt50.7' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestCalibreHelper - test_check_char_replacement</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt50.8' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestCalibreHelper - test_check_chinese_Characters</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt50.9' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestCalibreHelper - test_check_deg_eur_replacement</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt50.10' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestCalibreHelper - test_check_doubleS</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt50.11' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestCalibreHelper - test_check_finish_Dot</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt50.12' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestCalibreHelper - test_check_high23</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt50.13' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestCalibreHelper - test_check_umlauts</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt50.14' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestCalibreHelper - test_random_password</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt50.15' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestCalibreHelper - test_split_authors</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt50.16' class='hiddenRow bg-success'>
<td>
<div class='testcase'>TestCalibreHelper - test_whitespaces</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='total_row' class="text-center bg-grey">
<td>Total</td>
<td>408</td>
<td>392</td>
<td>7</td>
<td>2</td>
<td>423</td>
<td>413</td>
<td>3</td>
<td>0</td>
<td>7</td>
<td>&nbsp;</td>
</tr>
@ -5254,7 +5257,7 @@ ImportError: cannot import name &#39;safe_str_cmp&#39; from &#39;werkzeug.securi
</div>
<script>
drawCircle(392, 7, 2, 7);
drawCircle(413, 3, 0, 7);
showCase(5);
</script>