Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BannerFunction to PackageInfo.g #2598

Merged
merged 1 commit into from
Sep 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/package.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ InstallGlobalFunction( DefaultPackageBannerString, function( inforec )
Append( str, inforec.PackageWWWHome );
Append( str, "\n" );
fi;

# temporary hack, in some package names with umlauts are in HTML encoding
str := Concatenation(sep, RecodeForCurrentTerminal(str), sep);
str:= ReplacedString( str, "ä", RecodeForCurrentTerminal("ä") );
Expand Down Expand Up @@ -1331,7 +1331,9 @@ BindGlobal( "LoadPackage_ReadImplementationParts",

# If the component `BannerString' is bound in `info' then we print
# this string, otherwise we print the default banner string.
if IsBound( info.BannerString ) then
if IsBound( info.BannerFunction ) then
bannerstring:= RecodeForCurrentTerminal(info.BannerFunction(info));
elif IsBound( info.BannerString ) then
bannerstring:= RecodeForCurrentTerminal(info.BannerString);
else
bannerstring:= DefaultPackageBannerString( info );
Expand Down Expand Up @@ -2280,6 +2282,7 @@ InstallGlobalFunction( ValidatePackageInfo, function( info )
fi;
fi;
TestMandat( record, "AvailabilityTest", IsFunction, "a function" );
TestOption( record, "BannerFunction", IsFunction, "a function" );
TestOption( record, "BannerString", IsString, "a string" );
TestOption( record, "TestFile", IsFilename,
"a string denoting a relative path to a readable file" );
Expand Down