ó
    ‘óýj–7  ã            
       ó  • S r / SQrSSKrSSKrSSKJr  \R                  " S5      rSrSr	Sr
S	rS
rSrSrSrS\\   S\\\   \\   \\\\4      4   4S jrSS\\   S\S\4S jjrS\4S jr\S:X  a  \R2                  " \" 5       5        gg)a7  Generate diff statistics similar to git's --stat option.

This module provides functionality to parse unified diff output and generate
statistics about changes, including:
- Number of lines added and removed per file
- Binary file detection
- File rename detection
- Formatted output similar to git diff --stat
)ÚdiffstatÚmainÚparse_patché    N)ÚSequences   diff --git a/(.*) b/(.*)s   diff --git a/s   Binary files   rename froms	   rename tos   @@ó   +ó   -ó    ÚlinesÚreturnc                 ó&  • / n/ n/ nS=n=pVSnS=p‰U  GHÀ  n
U
R                  [        5      (       aq  Ub4  UR                  U5        UR                  U5        UR                  X‰45        [        R	                  U
5      nU(       d   eUR                  S5      nSnS=p‰SnSnM�  U
R                  [        5      (       a  U(       a  SnSnM¶  U
R                  [        5      (       a  U(       a  U
SS nMÞ  U
R                  [        5      (       a  U(       a  U(       d   eUSU
SS -  -  nGM  U
R                  [        5      (       a  U(       d  U(       a  SnSnGME  U
R                  [        5      (       a  U(       a  US	-  nGMn  U
R                  [        5      (       a  U(       a  U	S	-  n	GM—  U
R                  [        5      (       a  GM´  U(       d  GM¾  SnGMÃ     Ub4  UR                  U5        UR                  U5        UR                  X‰45        XU4$ )
z¸Parse a git style diff or patch to generate diff stats.

Args:
  lines: list of byte string lines from the diff to be parsed
Returns: A tuple (names, is_binary, counts) of three lists
FNr   é   Té   s    => %sé
   é   )Ú
startswithÚ_GIT_HEADER_STARTÚappendÚ_git_header_nameÚsearchÚgroupÚ_GIT_BINARY_STARTÚ_GIT_RENAMEFROM_STARTÚ_GIT_RENAMETO_STARTÚ_GIT_CHUNK_STARTÚ_GIT_ADDED_STARTÚ_GIT_DELETED_STARTÚ_GIT_UNCHANGED_START)r
   ÚnamesÚ	nametypesÚcountsÚin_patch_chunkÚin_git_headerÚ
binaryfileÚcurrentfileÚaddedÚdeletedÚlineÚms               Ú;/usr/local/lib/python3.13/site-packages/dulwich/diffstat.pyr   r   K   sÂ  € ð €EØ€IØ€FØ27Ð7€NÐ7�]Ø $€KØÐ€EÜˆØ�?‰?Ô,×-Ñ-ØÑ&Ø—‘˜[Ô)Ø× Ñ  Ô,Ø—‘˜uÐ.Ô/Ü ×'Ñ'¨Ó-ˆAÞˆH�1ØŸ'™' !›*ˆKØˆJØÐˆEØ ˆMØ"ŠNØ�_‰_Ô.×/Ñ/¶MØˆJØ!ŠMØ�_‰_Ô2×3Ñ3¾Ø˜r˜s˜)ŠKØ�_‰_Ô0×1Ñ1¶mÞÐ�;Ø˜9 t¨B¨C yÑ0Ñ0‹KØ�_‰_Ô-×.Ñ.¶NÆmØ!ˆNØ!‹MØ�_‰_Ô-×.Ñ.¶>Ø�Q‰J‹EØ�_‰_Ô/×0Ñ0¶^Ø�q‰L‹GØ—‘Ô!5×6Ô6¿>¹>Ø"‹Nñ; ð> ÑØ�‰�[Ô!Ø×Ñ˜Ô$Ø�‰�uÐ&Ô'Ø˜VÐ#Ð#ó    Ú	max_widthc           	      ó¦  • [        U 5      u  p#n/ n/ nSnSn[        U5       HP  u  pšXI   u  p›UR                  U	5        UR                  U5        [        U[	        U
5      5      n[        X‰U-   5      nMR     Sn[	        [        U5      5      n[        U5       GH�  u  pžX9   nS[        U5      R                  S5      -   S-   [        U5      R                  S5      -   S-   nS[        U5      R                  S5      -   S-   nU(       Gd
  Sn[	        US-  5      n[        S	UU-
  5      nUU:  a  S
XY   -  SXi   -  -   nO�[        XY   5      U-  U-  n[        Xi   5      U-  U-  nS=nnXY   S:”  a#  [        U5      nUS:X  a  SUs=:  a  S:  a  O  OSnXi   S:”  a#  [        U5      nUS:X  a  SUs=:  a  S:  a  O  OSnS
[        U5      -  S[        U5      -  -   nUU[        X)   5      [        XY   Xi   -   5      R                  S5      U4-  -  nGMz  UU[        X)   5      S4-  -  nGM’     US[	        U5      [        U5      [        U5      4-  -  nU$ )aZ  Generate summary statistics from a git style diff ala (git diff tag1 tag2 --stat).

Args:
  lines: list of byte string "lines" from the diff to be parsed
  max_width: maximum line length for generating the summary
             statistics (default 80)
Returns: A byte string that lists the changed files with change
         counts and histogram.
r   r*   s    %-Úasciis   s | %s   s %s
s   s | %s
)r*   r*   r*   r   r   r   r   s   Bins4    %d files changed, %d insertions(+), %d deletions(-))r   Ú	enumerater   ÚmaxÚlenÚstrÚencodeÚfloatÚintÚbytesÚsum)r
   r+   r   r   r    ÚinsertÚdeleteÚnamelenÚmaxdiffÚiÚfilenameÚdÚoutputÚstatlenÚnr#   ÚformatÚ	binformatÚhistÚwidthÚ	histwidthÚiratioÚdratioÚiwidthÚdwidths                            r)   r   r   ‚   s�  € ô  +¨5Ó1Ñ€E�fØ€FØ€FØ€GØ€GÜ  Ö'‰ˆØ‰y‰ˆØ�‰�aÔØ�‰�aÔÜ�gœs 8›}Ó-ˆÜ�g 1™uÓ%Šñ (ð €FÜ”#�g“,Ó€GÜ˜%× ‰ˆØ‘\ˆ
ð Ü�'‹l×!Ñ! 'Ó*ñ+àñô �'‹l×!Ñ! 'Ó*ñ+ð ñ	ð 	ð œS ›\×0Ñ0°Ó9Ñ9¸KÑGˆ	ßØˆDä˜ Ñ0Ó1ˆEÜ˜A˜y¨5Ñ0Ó1ˆIØ˜Ó"Ø˜f™iÑ'¨$°±Ñ*:Ñ:‘ä ¡	Ó*¨WÑ4¸	ÑA�Ü ¡	Ó*¨WÑ4¸	ÑA�Ø"#Ð#�˜ð ‘9˜q“=Ü  ›[�FØ “{ q¨6¥~°A¦~Ø!"˜ð ‘9˜q“=Ü  ›[�FØ “{ q¨6¥~°A¦~Ø!"˜Øœc &›kÑ)¨D´3°v³;Ñ,>Ñ>�Ø�fÜ�e‘h“Ü�F‘I ¡	Ñ)Ó*×1Ñ1°'Ó:Øð ñ ñ ‹Fð �i¤5¨©£?°FÐ";Ñ;Ñ;‹FñY !ð\ ÐEÜˆE‹
ÜˆF‹ÜˆF‹ðIñ ñ €Fð
 €Mr*   c                  óN  • [         R                  n [        [         R                  5      S:”  ac  U S   nSn[        US5       nUR	                  5       nSSS5        UR                  S5      n[        U5      n[        UR                  S5      5        gSnS	n[        UR                  S5      5      nXW:X  a  [        S
5        g[        S5        [        S5        [        UR                  S5      5        [        S5        [        UR                  S5      5        g! , (       d  f       NÊ= f)zWMain entry point for diffstat command line tool.

Returns:
  Exit code (0 for success)
r   r*   ÚrbNó   
zutf-8r   sÐ  
diff --git a/docs/qt512.7_remove_bad_workaround.patch b/docs/qt512.7_remove_bad_workaround.patch
new file mode 100644
index 00000000..64e34192
--- /dev/null
+++ b/docs/qt512.7_remove_bad_workaround.patch
@@ -0,0 +1,15 @@
+--- qtbase/src/gui/kernel/qwindow.cpp.orig     2019-12-12 09:15:59.000000000 -0500
++++ qtbase/src/gui/kernel/qwindow.cpp  2020-01-10 10:36:53.000000000 -0500
+@@ -218,12 +218,6 @@
+     QGuiApplicationPrivate::window_list.removeAll(this);
+     if (!QGuiApplicationPrivate::is_app_closing)
+         QGuiApplicationPrivate::instance()->modalWindowList.removeOne(this);
+-
+-    // focus_window is normally cleared in destroy(), but the window may in
+-    // some cases end up becoming the focus window again. Clear it again
+-    // here as a workaround. See QTBUG-75326.
+-    if (QGuiApplicationPrivate::focus_window == this)
+-        QGuiApplicationPrivate::focus_window = 0;
+ }
+
+ void QWindowPrivate::init(QScreen *targetScreen)
diff --git a/docs/testplugin_v017.zip b/docs/testplugin_v017.zip
new file mode 100644
index 00000000..a4cf4c4c
Binary files /dev/null and b/docs/testplugin_v017.zip differ
diff --git a/ci_scripts/macgddeploy.py b/ci_scripts/gddeploy.py
similarity index 73%
rename from ci_scripts/macgddeploy.py
rename to ci_scripts/gddeploy.py
index a512d075..f9dacd33 100644
--- a/ci_scripts/macgddeploy.py
+++ b/ci_scripts/gddeploy.py
@@ -1,19 +1,32 @@
 #!/usr/bin/env python3

 import os
+import sys
 import subprocess
 import datetime
 import shutil
+import glob

 gparent = os.path.expandvars('$GDRIVE_DIR')
 grefresh_token = os.path.expandvars('$GDRIVE_REFRESH_TOKEN')

-travis_branch = os.path.expandvars('$TRAVIS_BRANCH')
-travis_commit = os.path.expandvars('$TRAVIS_COMMIT')
-travis_build_number = os.path.expandvars('$TRAVIS_BUILD_NUMBER')
+if sys.platform.lower().startswith('darwin'):
+    travis_branch = os.path.expandvars('$TRAVIS_BRANCH')
+    travis_commit = os.path.expandvars('$TRAVIS_COMMIT')
+    travis_build_number = os.path.expandvars('$TRAVIS_BUILD_NUMBER')
+
+    origfilename = './bin/Sigil.tar.xz'
+    newfilename = './bin/Sigil-{}-{}-build_num-{}.tar.xz'.format(travis_branch, travis_commit[:7],travis_build_number)
+else:
+    appveyor_branch = os.path.expandvars('$APPVEYOR_REPO_BRANCH')
+    appveyor_commit = os.path.expandvars('$APPVEYOR_REPO_COMMIT')
+    appveyor_build_number = os.path.expandvars('$APPVEYOR_BUILD_NUMBER')
+    names = glob.glob('.\installer\Sigil-*-Setup.exe')
+    if not names:
+        exit(1)
+    origfilename = names[0]
+    newfilename = '.\installer\Sigil-{}-{}-build_num-{}-Setup.exe'.format(appveyor_branch, appveyor_commit[:7], appveyor_build_number)

-origfilename = './bin/Sigil.tar.xz'
-newfilename = './bin/Sigil-{}-{}-build_num-{}.tar.xz'.format(travis_branch, travis_commit[:7],travis_build_number)
 shutil.copy2(origfilename, newfilename)

 folder_name = datetime.date.today()
diff --git a/docs/qt512.6_backport_009abcd_fix.patch b/docs/qt512.6_backport_009abcd_fix.patch
deleted file mode 100644
index f4724347..00000000
--- a/docs/qt512.6_backport_009abcd_fix.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- qtbase/src/widgets/kernel/qwidget.cpp.orig 2019-11-08 10:57:07.000000000 -0500
-+++ qtbase/src/widgets/kernel/qwidget.cpp      2019-12-11 12:32:24.000000000 -0500
-@@ -8934,6 +8934,23 @@
-         }
-     }
-     switch (event->type()) {
-+    case QEvent::PlatformSurface: {
-+        // Sync up QWidget's view of whether or not the widget has been created
-+        switch (static_cast<QPlatformSurfaceEvent*>(event)->surfaceEventType()) {
-+        case QPlatformSurfaceEvent::SurfaceCreated:
-+            if (!testAttribute(Qt::WA_WState_Created))
-+                create();
-+            break;
-+        case QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed:
-+            if (testAttribute(Qt::WA_WState_Created)) {
-+                // Child windows have already been destroyed by QWindow,
-+                // so we skip them here.
-+                destroy(false, false);
-+            }
-+            break;
-+        }
-+        break;
-+    }
-     case QEvent::MouseMove:
-         mouseMoveEvent((QMouseEvent*)event);
-         break;
diff --git a/docs/Building_Sigil_On_MacOSX.txt b/docs/Building_Sigil_On_MacOSX.txt
index 3b41fd80..64914c78 100644
--- a/docs/Building_Sigil_On_MacOSX.txt
+++ b/docs/Building_Sigil_On_MacOSX.txt
@@ -113,7 +113,7 @@ install_name_tool -add_rpath @loader_path/../../Frameworks ./bin/Sigil.app/Content
 
 # To test if the newly bundled python 3 version of Sigil is working properly ypou can do the following:
 
-1. download testplugin_v014.zip from https://github.com/Sigil-Ebook/Sigil/tree/master/docs
+1. download testplugin_v017.zip from https://github.com/Sigil-Ebook/Sigil/tree/master/docs
 2. open Sigil.app to the normal nearly blank template epub it generates when opened
 3. use Plugins->Manage Plugins menu and make sure the "Use Bundled Python" checkbox is checked
 4. use the "Add Plugin" button to navigate to and add testplugin.zip and then hit "Okay" to exit the Manage Plugins Dialog
s}   docs/qt512.7_remove_bad_workaround.patch            | 15 ++++++++++++
 docs/testplugin_v017.zip                            | Bin
 ci_scripts/macgddeploy.py => ci_scripts/gddeploy.py |  0 
 docs/qt512.6_backport_009abcd_fix.patch             | 26 ---------------------
 docs/Building_Sigil_On_MacOSX.txt                   |  2 +-
 5 files changed, 16 insertions(+), 27 deletions(-)zself test passedzself test failedz	Received:z	Expected:éÿÿÿÿ)	ÚsysÚargvr0   ÚopenÚreadÚsplitr   ÚprintÚdecode)rO   ÚdiffpathÚdataÚfr
   ÚresultÚselftestÚ
testoutputs           r)   r   r   Ï   só   € ô �8‰8€Dä
Œ3�8‰8ƒ}�qÓØ˜‘7ˆØˆÜ�(˜DÔ! QØ—6‘6“8ˆD÷ "à—
‘
˜5Ó!ˆÜ˜%“ˆÜˆf�m‰m˜GÓ$Ô%Øðv€Hðp7€Jô �h—n‘n UÓ+Ó,€FØÓÜÐ Ô!ØÜ	Ð
ÔÜ	ˆ+ÔÜ	ˆ&�-‰-˜Ó
 Ô!Ü	ˆ+ÔÜ	ˆ*×
Ñ
˜GÓ
$Ô%Ø÷m "Õ!ús   ÁDÄ
D$Ú__main__)éP   )Ú__doc__Ú__all__ÚrerN   Úcollections.abcr   Úcompiler   r   r   r   r   r   r   r   r   r5   ÚtupleÚlistÚboolr4   r   r   r   Ú__name__Úexit© r*   r)   Ú<module>rh      sé   ðñHò€ó 
Û 
Ý $ð
 —:’:Ð:Ó;Ð à$Ð Ø"Ð Ø&Ð Ø"Ð ØÐ ØÐ ØÐ ØÐ ð2$Ø�E‰?ð2$à
ˆ4�‰;˜˜T™
 D¨¨s°C¨x©Ñ$9Ð9Ñ:ô2$ñnJ�H˜U‘Oð J°ð J¸Uõ JðZaˆcô aðH ˆzÓØ‡H‚H‰T‹VÕð r*   