@@ -91,6 +91,10 @@ def __init__(self, parent):
91
91
# e.g. BIBLE:::Jn 3:16; Rm 5:8; Deu 6:4
92
92
# e.g. BIBLE:::KJV:::John 3:16
93
93
# e.g. BIBLE:::KJV:::Jn 3:16; Rm 5:8; Deu 6:4""" ),
94
+ "chapter" : (self .textFormattedChapter , """
95
+ # [KEYWORD] CHAPTER
96
+ # Feature - Open bible versions of a single chapter.
97
+ # Usage - CHAPTER:::[BIBLE_VERSION(S)]:::[BIBLE_CHAPTER]""" ),
94
98
"main" : (self .textMain , """
95
99
# [KEYWORD] MAIN
96
100
# Feature - Open a bible chapter or multiples verses on main view.
@@ -143,6 +147,10 @@ def __init__(self, parent):
143
147
# e.g. COMPARE:::John 3:16
144
148
# e.g. COMPARE:::KJV_NET_CUV:::John 3:16
145
149
# e.g. COMPARE:::KJV_NET_CUV:::John 3:16; Rm 5:8""" ),
150
+ "comparechapter" : (self .textCompareChapter , """
151
+ # [KEYWORD] COMPARECHAPTER
152
+ # Feature - Compare bible versions of a single chapter.
153
+ # Usage - COMPARECHAPTER:::[BIBLE_VERSION(S)]:::[BIBLE_CHAPTER]""" ),
146
154
"sidebyside" : (self .textCompareSideBySide , """
147
155
# [KEYWORD] SIDEBYSIDE
148
156
# Feature - Compare bible versions side by side
@@ -1445,6 +1453,38 @@ def textFormattedBible(self, verse, text, source=""):
1445
1453
content = f"{ content } <br>{ config .mainWindow .divider } <br>{ singleVerse } "
1446
1454
return content
1447
1455
1456
+ def textFormattedChapter (self , command , source ):
1457
+ if command .count (":::" ) == 0 :
1458
+ if config .openBibleInMainViewOnly :
1459
+ updateViewConfig , viewText , * _ = self .getViewConfig ("main" )
1460
+ else :
1461
+ updateViewConfig , viewText , * _ = self .getViewConfig (source )
1462
+ command = "{0}:::{1}" .format (viewText , command )
1463
+ texts , references = self .splitCommand (command )
1464
+ verseList = self .extractAllVerses (references )
1465
+ if not verseList :
1466
+ return self .invalidCommand ()
1467
+ texts = self .getConfirmedTexts (texts )
1468
+ marvelBibles = self .getMarvelBibles ()
1469
+ if not texts :
1470
+ return self .invalidCommand ()
1471
+ else :
1472
+ self .cancelBibleParallels ()
1473
+ text = texts [0 ]
1474
+ if text in marvelBibles :
1475
+ fileItems = marvelBibles [text ][0 ]
1476
+ if os .path .isfile (os .path .join (* fileItems )):
1477
+ content = self .textFormattedBible (verseList [0 ], text , source )
1478
+ return ("main" , content , {})
1479
+ else :
1480
+ databaseInfo = marvelBibles [text ]
1481
+ if self .parent is not None :
1482
+ self .parent .downloadHelper (databaseInfo )
1483
+ return ("" , "" , {})
1484
+ else :
1485
+ content = self .textFormattedBible (verseList [0 ], text , source )
1486
+ return ("main" , content , {})
1487
+
1448
1488
# cmd:::
1449
1489
# run os command
1450
1490
def osCommand (self , command , source ):
@@ -2540,10 +2580,13 @@ def distinctTranslation(self, command, source):
2540
2580
display = " | " .join (translations )
2541
2581
return ("study" , display , {})
2542
2582
2583
+ def getAllFavouriteBibles (self ):
2584
+ return sorted (set ([config .mainText , config .favouriteBible , config .favouriteBible2 , config .favouriteBible3 , config .favouriteBiblePrivate , config .favouriteBiblePrivate2 , config .favouriteBiblePrivate3 ]))
2585
+
2543
2586
# COMPARE:::
2544
2587
def textCompare (self , command , source ):
2545
2588
if command .count (":::" ) == 0 :
2546
- confirmedTexts = [ "ALL" ]
2589
+ confirmedTexts = self . getAllFavouriteBibles ()
2547
2590
verseList = self .extractAllVerses (command )
2548
2591
else :
2549
2592
texts , references = self .splitCommand (command )
@@ -2559,8 +2602,9 @@ def textCompare(self, command, source):
2559
2602
config .mainCssBibleFontStyle = ""
2560
2603
texts = confirmedTexts
2561
2604
if confirmedTexts == ["ALL" ]:
2562
- plainBibleList , formattedBibleList = biblesSqlite .getTwoBibleLists ()
2563
- texts = set (plainBibleList + formattedBibleList )
2605
+ #plainBibleList, formattedBibleList = biblesSqlite.getTwoBibleLists()
2606
+ #texts = set(plainBibleList + formattedBibleList)
2607
+ texts = self .getAllFavouriteBibles ()
2564
2608
for text in texts :
2565
2609
(fontFile , fontSize , css ) = Bible (text ).getFontInfo ()
2566
2610
config .mainCssBibleFontStyle += css
@@ -2569,6 +2613,37 @@ def textCompare(self, command, source):
2569
2613
updateViewConfig (viewText , verseList [- 1 ])
2570
2614
return ("study" if config .compareOnStudyWindow else "main" , verses , {})
2571
2615
2616
+ # COMPARECHAPTER:::
2617
+ def textCompareChapter (self , command , source ):
2618
+ if command .count (":::" ) == 0 :
2619
+ confirmedTexts = self .getAllFavouriteBibles ()
2620
+ verseList = self .extractAllVerses (command )
2621
+ else :
2622
+ texts , references = self .splitCommand (command )
2623
+ confirmedTexts = self .getConfirmedTexts (texts )
2624
+ verseList = self .extractAllVerses (references )
2625
+ if not confirmedTexts or not verseList :
2626
+ return self .invalidCommand ()
2627
+ else :
2628
+ if config .runMode == "terminal" and not confirmedTexts == ["ALL" ]:
2629
+ config .compareParallelList = confirmedTexts
2630
+ config .terminalBibleComparison = True
2631
+ biblesSqlite = BiblesSqlite ()
2632
+ config .mainCssBibleFontStyle = ""
2633
+ texts = confirmedTexts
2634
+ if confirmedTexts == ["ALL" ]:
2635
+ #plainBibleList, formattedBibleList = biblesSqlite.getTwoBibleLists()
2636
+ texts = self .getAllFavouriteBibles ()
2637
+ for text in texts :
2638
+ (fontFile , fontSize , css ) = Bible (text ).getFontInfo ()
2639
+ config .mainCssBibleFontStyle += css
2640
+ #verses = biblesSqlite.compareVerse(verseList, confirmedTexts)
2641
+ b , c , v , * _ = verseList [0 ]
2642
+ verses = biblesSqlite .compareVerseChapter (b , c , v , confirmedTexts )
2643
+ updateViewConfig , viewText , * _ = self .getViewConfig (source )
2644
+ updateViewConfig (viewText , verseList [0 ])
2645
+ return ("study" if config .compareOnStudyWindow else "main" , verses , {})
2646
+
2572
2647
# SIDEBYSIDE:::
2573
2648
def textCompareSideBySide (self , command , source ):
2574
2649
if command .count (":::" ) == 0 :
0 commit comments