11# https://github.com/JuliaLang/julia/blob/fae0d0ad3e5d9804533435fe81f4eaac819895af/stdlib/REPL/src/REPL.jl#L1727C1-L1795C4
22
3- function banner (io:: IO = stdout ; short = false )
4- if Base. GIT_VERSION_INFO. tagged_commit
5- commit_string = Base. TAGGED_RELEASE_BANNER
6- elseif isempty (Base. GIT_VERSION_INFO. commit)
7- commit_string = " "
8- else
9- days = Int (floor ((ccall (:jl_clock_now , Float64, ()) - Base. GIT_VERSION_INFO. fork_master_timestamp) / (60 * 60 * 24 )))
10- days = max (0 , days)
11- unit = days == 1 ? " day" : " days"
12- distance = Base. GIT_VERSION_INFO. fork_master_distance
13- commit = Base. GIT_VERSION_INFO. commit_short
3+ function __PythonCall_banner (io:: IO = stdout )
4+ banner_opt = begin
5+ opts = Base. JLOptions ()
6+ b = opts. banner
7+ auto = b == - 1
8+ b == 0 || (auto && ! interactiveinput) ? :no :
9+ b == 1 || (auto && interactiveinput) ? :yes :
10+ :short # b == 2
11+ end
1412
15- if distance == 0
16- commit_string = " Commit $(commit) ($(days) $(unit) old master)"
17- else
18- branch = Base. GIT_VERSION_INFO. branch
19- commit_string = " $(branch) /$(commit) (fork: $(distance) commits, $(days) $(unit) )"
20- end
13+ if banner_opt == :no
14+ return
2115 end
2216
23- commit_date = isempty (Base . GIT_VERSION_INFO . date_string) ? " " : " ( $( split (Base . GIT_VERSION_INFO . date_string)[ 1 ]) ) "
17+ short = banner_opt == :short
2418
2519 if get (io, :color , false ):: Bool
2620 c = Base. text_colors
@@ -34,8 +28,8 @@ function banner(io::IO = stdout; short = false)
3428
3529 if short
3630 print (io,"""
37- $(d3) o$(tx) | Version $(VERSION ) PythonCall: $(PythonCall . VERSION )
38- $(d2) o$(tx) $(d4) o$(tx) | $(commit_string )
31+ $(d3) o$(tx) | Julia $(VERSION )
32+ $(d2) o$(tx) $(d4) o$(tx) $(c[ :bold ] * jc) o $(tx) | PythonCall $(PythonCall . VERSION )
3933 """ )
4034 else
4135 print (io,""" $(d3) _$(tx)
@@ -52,8 +46,8 @@ function banner(io::IO = stdout; short = false)
5246 else
5347 if short
5448 print (io,"""
55- o | Version $(VERSION ) PythonCall: $(PythonCall . VERSION )
56- o o | $(commit_string )
49+ o | Julia $(VERSION )
50+ o o o | PythonCall $(PythonCall . VERSION )
5751 """ )
5852 else
5953 print (io,"""
@@ -68,4 +62,4 @@ function banner(io::IO = stdout; short = false)
6862 """ )
6963 end
7064 end
71- end
65+ end
0 commit comments