diff --git a/MAST_tW_PDF_Updater/FilesForUpdates/Exceptions/Exceptions_tWs_from_OSHB.txt b/MAST_tW_PDF_Updater/FilesForUpdates/Exceptions/Exceptions_tWs_from_OSHB.txt index 6c5296e..5a22e9e 100644 --- a/MAST_tW_PDF_Updater/FilesForUpdates/Exceptions/Exceptions_tWs_from_OSHB.txt +++ b/MAST_tW_PDF_Updater/FilesForUpdates/Exceptions/Exceptions_tWs_from_OSHB.txt @@ -664,7 +664,7 @@ Ezra 7:28 3289 counselors Ezra 7:28 2388 || Ezra 7:28 5927 || Ezra 8:1 5927 || -Ezra 8:3 3187 +Ezra 8:3 3187 || Ezra 8:3 2145 Ezra 8:4 2145 Ezra 8:5 2145 diff --git a/MAST_tW_PDF_Updater/FilesForUpdates/Mine.URL.Strong.Verse.OT.2.pl b/MAST_tW_PDF_Updater/FilesForUpdates/Mine.URL.Strong.Verse.OT.2.pl index 76228da..1ec987e 100644 --- a/MAST_tW_PDF_Updater/FilesForUpdates/Mine.URL.Strong.Verse.OT.2.pl +++ b/MAST_tW_PDF_Updater/FilesForUpdates/Mine.URL.Strong.Verse.OT.2.pl @@ -12,12 +12,12 @@ use FindBin '$Bin'; use Cwd ; my ($d) = ("\\"); -my ($workDir, $textEditor, $repoPath, $browser, $blbRef) = ($Bin, "\\"); +my ($workDir, $textEditor, $repoPath, $browser, $blbRef, $tN_page) = ($Bin, "\\"); my %abbr; if ($^O eq "darwin" || $^O eq "linux") {$d = "/"} -open LOG, ">:utf8", "Logs${d}mine_log.log" or die ("$!"); +open LOG, ">:utf8", "$Bin${d}Logs${d}mine_log.log" or die ("$!:\n$Bin$[d}Logs${d}mine_log.log"); while () { chomp; @@ -47,8 +47,8 @@ my ($excFile, $topDir, $txtFile, $dataFile, $displayFile, $filePattern, $sn, $xf "*\.md" ); -my ($missingLine, $bk, $ch, $vs, $ref, $strong, $word, $flag, $tNid, $abbr, $doFlag, $xmlFile, $outputFiles, $lbsBk); -my (%bkAbr, %wa); +my ($missingLine, $bk, $ch, $vs, $ref, $strong, $word, $flag, $tNid, $abbr, $doFlag, $xmlFile, $lbsBk); +my (%bkAbr, %wa, %tW_file); my @tWfiles; find( sub { push @tWfiles, $File::Find::name if ( m/^(.*)$filePattern$/ ) }, $topDir) ; @@ -81,11 +81,13 @@ sub GetUserDefaults { while (my $thisLine = <$defaults>) { chomp $thisLine; if ($thisLine =~ /^Text editor: (.*)$/) { - $textEditor = "\"$1\""; + $textEditor = $1; + if ($^O eq "MSWin32" || $^O eq "MSWin64") {$textEditor =~ s/^(.*)$/"$1"/g;} } elsif ($thisLine =~ /^Repository directory: (.*)$/) { $repoPath = $1 } elsif ($thisLine =~ /^HTML browser: (.*)$/) { - $browser = "\"$1\""; + $browser = $1; + if ($^O eq "MSWin32" || $^O eq "MSWin64") {$textEditor =~ s/^(.*)$/"$1"/g;} } } @@ -133,8 +135,9 @@ sub ParseLine { while (length $ch < $mxl) {$ch =~ s/^/0/} while (length $vs < $mxl) {$vs =~ s/^/0/} $xmlFile = "$repoPath/OSHB/${numBk}.xml"; - say LOG "\n\$wa{$fullBk}/\$ch/\$vs: $wa{$fullBk}/$ch/$vs\nTo system:\n$textEditor $repoPath/en_tn/$wa{$fullBk}/$ch/$vs.md\n"; - if ($^O eq "darwin") {system `$textEditor $repoPath/en_tn/$wa{$fullBk}/$ch/$vs.md`} + $tN_page = "$repoPath/en_tn/$wa{$fullBk}/$ch/${vs}.md"; + say LOG "\n\$wa{$fullBk}/\$ch/\$vs: $wa{$fullBk}/$ch/$vs\nTo system:\n$textEditor $tN_page\n"; + if ($^O eq "darwin") {system `$textEditor $tN_page`} #say "open -a /Applications/Logos.app \"logos4:TextComparison;ref=BibleBHS.$lbsBk${sch}.$svs;res=esv,niv2011,niv,nasb95,nrsv,gs-netbible,nlt,leb,kjv1900\""; if ($^O eq "darwin") {system `open -a /Applications/Logos.app "logos4:TextComparison;ref=BibleNIV.$lbsBk${sch}.$svs;res=esv,niv2011,niv,nasb95,nrsv,gs-netbible,nlt,leb,kjv1900"`} } @@ -228,6 +231,7 @@ sub FindVerse { sub ChecktWPages{ + say "Checking tW pages"; say LOG "<<$word>>"; if ($word eq "") { say "\nThere is no \$word for \$strong = $strong in $ref\n$thisULB\n"; @@ -237,14 +241,16 @@ sub ChecktWPages{ say OUT "

"; foreach my $file ( @tWfiles ) { my $fileText = read_file("$file", binmode => 'utf8'); + my $foundHere; # While finds entries and Strong's numbers while ($fileText =~ /($strong)[^\d]|^(# [^\n]*\b$word\b)/g) { + $foundHere = 1; #system `clear`; my $abb = $file; $abb =~ s/.md$//; say OUT "$abb
\n"; - $outputFiles .= "$file " } + if ($foundHere == 1) {unless (exists $tW_file{$file}) {$tW_file{$file} = $file}} } say OUT "

"; } @@ -264,7 +270,7 @@ sub Finish { my $abb = $file; $abb =~ s/.md$//; say OUT "$abb: $pre$found$post
\n"; - $outputFiles .= "$file " + unless (exists $tW_file{$file}) {$tW_file{$file} = $file} } } say OUT "

"; @@ -278,23 +284,38 @@ sub Finish { my $abb = $file; $abb =~ s/.md$//; say OUT "$abb: $pre$found$post
\n"; - $outputFiles .= "$file " + unless (exists $tW_file{$file}) {$tW_file{$file} = $file} } } say OUT "

"; + my $tW_files; + foreach my $key (sort keys %tW_file) { + $tW_files .= "$key "; + } say "\nOpening .md files."; if ($^O eq "darwin") { system `$browser https://www.blueletterbible.org/lang/lexicon/lexicon.cfm?strongs=$strong`; - system `$textEditor $outputFiles`; + system `$textEditor $tW_files`; system `$textEditor $excFile`;} if ($^O eq "linux") { - system `$browser https://www.blueletterbible.org/lang/lexicon/lexicon.cfm?strongs=$strong &`; - system `$textEditor $outputFiles &`; - system `$textEditor $excFile &`;} + #system `$browser https://www.blueletterbible.org/lang/lexicon/lexicon.cfm?strongs=$strong &`; + say "\$blbRef $blbRef"; + #system `$browser $browser $blbRef &`; + say "\$tW_file: $tW_files"; + #system `$textEditor $tW_files &`; + say "\$excFile: $excFile"; + #system `$textEditor $excFile &`; + open OUT1, ">$Bin${d}Temp${d}ns.sh"; + say OUT1 "$browser --new-window https://www.blueletterbible.org/lang/lexicon/lexicon.cfm?strongs=$strong $blbRef $displayFile & disown"; + say OUT1 "$textEditor --new-window $tW_files $tN_page & disown"; + #say OUT1 "$textEditor $excFile &"; + close OUT1; + #system `cd Temp;. ./ns.sh &` + } if ($^O eq "MSWin32" || $^O eq "MSWin64" ) { system `START "" $browser https://www.blueletterbible.org/lang/lexicon/lexicon.cfm?strongs=$strong`; - say "\$outputFiles: $outputFiles"; - system `START "" $textEditor $outputFiles`; + say "\$tW_file: $tW_files"; + system `START "" $textEditor $tW_files`; say "\$excFile: $excFile"; system `START "" $textEditor $excFile`; $displayFile =~ s/\//\\/g; diff --git a/MAST_tW_PDF_Updater/FilesForUpdates/Temp/ns.sh b/MAST_tW_PDF_Updater/FilesForUpdates/Temp/ns.sh new file mode 100644 index 0000000..de83d90 --- /dev/null +++ b/MAST_tW_PDF_Updater/FilesForUpdates/Temp/ns.sh @@ -0,0 +1,2 @@ +firefox --new-window https://www.blueletterbible.org/lang/lexicon/lexicon.cfm?strongs=H2145 https://www.blueletterbible.org/net/ezr/8/3 /home/henry/Documents/WA_Repo/Tips_and_Hacks/MAST_tW_PDF_Updater/FilesForUpdates/Temp/mine_results.html & disown +komodo --new-window /home/henry/Documents/WA_Repo/en_tw/bible/kt/children.md /home/henry/Documents/WA_Repo/en_tn/ezr/08/03.md & disown diff --git a/MAST_tW_PDF_Updater/FilesForUpdates/User/User_defaults.linux.txt b/MAST_tW_PDF_Updater/FilesForUpdates/User/User_defaults.linux.txt index 646413c..9dae10d 100755 --- a/MAST_tW_PDF_Updater/FilesForUpdates/User/User_defaults.linux.txt +++ b/MAST_tW_PDF_Updater/FilesForUpdates/User/User_defaults.linux.txt @@ -5,7 +5,7 @@ Here are the current defaults the scripts will be looking for. =============== # For Linux -Text editor: gedit +Text editor: komodo HTML browser: firefox Repository directory: /home/henry/Documents/WA_Repo