Skip to content

Commit

Permalink
Merge pull request #4103 from mbab/hlbp
Browse files Browse the repository at this point in the history
code: rewrite lectio_brevis_prima, remove obsolete now getfromcommune
  • Loading branch information
APMarcello3 authored Oct 17, 2024
2 parents c8d5673 + 77c7fb6 commit ca1bc18
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 50 deletions.
36 changes: 0 additions & 36 deletions web/cgi-bin/horas/specials.pl
Original file line number Diff line number Diff line change
Expand Up @@ -571,42 +571,6 @@ sub getfrompsalterium {
return $w;
}

#*** getfromcommune($name, $ind, $lang, $flag, $buildflag)
# collects and returns [$name $ind] item for the commemorated office from the commune
# if $flag ir collects for vide reference too
# if buildflag sets the building script item
sub getfromcommune {

my $name = shift;
my $ind = shift;
my $lang = shift;
my $flag = shift;
my $buildflag = shift;
my $c = '';

if ($commemoratio{Rule} =~ /ex\s*(C[0-9]+[a-z]*)/) { $c = $1; }
if ($commemoratio{Rule} =~ /vide\s*(C[0-9]+[a-z]*|Sancti\/.*?|Tempora\/.*?)(\s|\;)/ && $flag) { $c = $1; }
if ($hora eq 'Prima' && $rule =~ /(ex|vide)\s*(C[0-9]+[a-z]*|Sancti\/.*?|Tempora\/.*?)(\s|\;)/) { $c = $2; }
if (!$c) { return; }

if ($c =~ /^C/) {
$c = subdirname('Commune', $version) . "$c";
my $fname = "$datafolder/$lang1/$c" . "p.txt";
if ($dayname[0] =~ /Pasc/i && (-e $fname)) { $c .= 'p'; }
}
my %w = %{setupstring($lang, "$c.txt")};
my $v = $w{$name};
if (!$v) { $v = $w{"$name $ind"}; }
if (!$v) { $ind = 4 - $ind; $v = $w{"$name $ind"}; }

if ($v && $name =~ /Ant/i) {
my $source = $w{Name};
$source =~ s/\n//g;
setbuild($source, "$name $ind", 'try');
}
return $v;
}

#*** setbuild1($label, $coment)
# set a red black line into building script
sub setbuild1 {
Expand Down
24 changes: 10 additions & 14 deletions web/cgi-bin/horas/specials/specprima.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sub lectio_brevis_prima {

my $lang = shift;

our ($version, %winner, %winner2, $communetype, %commune, %commune2, $winner, $commune);
our ($version, %winner, %winner2, %commune, %commune2, $winner, $commune);

my %brevis = %{setupstring($lang, 'Psalterium/Prima Special.txt')};
my $name = gettempora("Lectio brevis Prima");
Expand All @@ -16,28 +16,24 @@ sub lectio_brevis_prima {

#look for [Lectio Prima]
if ($version !~ /1955|196/) {
my %w = columnsel($lang) ? %winner : %winner2;
my $b;

if (exists($w{'Lectio Prima'})) {
$b = $w{'Lectio Prima'};
if ($b) { setbuild2("Subst Lectio Prima $winner"); $comment = 3; }
}

if (!$b && $communetype && $communetype eq 'ex' && exists($commune{'Lectio Prima'})) {
if (exists($winner{'Lectio Prima'})) {
$b = columnsel($lang) ? $winner{'Lectio Prima'} : $winner2{'Lectio Prima'};
setbuild2("Subst Lectio Prima $winner");
$comment = 3;
} elsif (exists($commune{'Lectio Prima'})) {
$b = columnsel($lang) ? $commune{'Lectio Prima'} : $commune2{'Lectio Prima'};
if ($b) { setbuild2("Subst Lectio Prima $commune"); $comment = 3; }
}

if (!$b && ($winner =~ /Sancti/ || ($commune && $commune =~ /C10/))) {
$b = getfromcommune("Lectio", "Prima", $lang, 1, 1);
if ($b) { $comment = 4; }
setbuild2("Subst Lectio Prima $commune");
$comment = 4;
}

$brevis = $b || $brevis;
}

$brevis = prayer('benedictio Prima', $lang) . "\n$brevis" unless $version =~ /^Monastic/;
$brevis .= "\n\$Tu autem";

($brevis, $comment);
}

Expand Down

0 comments on commit ca1bc18

Please sign in to comment.