diff options
author | Laurence Kedward <laurence.kedward@bristol.ac.uk> | 2021-11-28 11:24:41 +0000 |
---|---|---|
committer | Laurence Kedward <laurence.kedward@bristol.ac.uk> | 2021-11-29 11:56:02 +0000 |
commit | 6aba40db1385007e0bf4e9c2b9b4afe8bb105593 (patch) | |
tree | 54836c2be079d9ace9719f10251fc1c00a301cd7 /src/fpm_backend_output.f90 | |
parent | 4556e7a4435c6ef2da8782c033229e06e91b6a4e (diff) | |
download | fpm-6aba40db1385007e0bf4e9c2b9b4afe8bb105593.tar.gz fpm-6aba40db1385007e0bf4e9c2b9b4afe8bb105593.zip |
Apply suggestion: don't use TBP for new constructors
Diffstat (limited to 'src/fpm_backend_output.f90')
-rw-r--r-- | src/fpm_backend_output.f90 | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/fpm_backend_output.f90 b/src/fpm_backend_output.f90 index 8c7fd7d..2cc8597 100644 --- a/src/fpm_backend_output.f90 +++ b/src/fpm_backend_output.f90 @@ -35,8 +35,6 @@ type build_progress_t !> Queue of scheduled build targets
type(build_target_ptr), pointer :: target_queue(:)
contains
- !> Initialise build progress object
- procedure :: init => output_init
!> Output 'compiling' status for build target
procedure :: compiling_status => output_status_compiling
!> Output 'complete' status for build target
@@ -45,16 +43,21 @@ contains procedure :: success => output_progress_success
end type build_progress_t
+!> Constructor for build_progress_t
+interface build_progress_t
+ procedure :: new_build_progress
+end interface build_progress_t
+
contains
- !> Initialise build progress object
- subroutine output_init(progress,target_queue,plain_mode)
- !> Progress object to initialise
- class(build_progress_t), intent(out) :: progress
+ !> Initialise a new build progress object
+ function new_build_progress(target_queue,plain_mode) result(progress)
!> The queue of scheduled targets
type(build_target_ptr), intent(in), target :: target_queue(:)
!> Enable 'plain' output for progress object
logical, intent(in), optional :: plain_mode
+ !> Progress object to initialise
+ type(build_progress_t) :: progress
if (plain_mode) then
call attr_mode('plain')
@@ -62,15 +65,16 @@ contains call attr_mode('color')
end if
- call progress%console%init(plain_mode)
+ progress%console = console_t(plain_mode)
progress%n_target = size(target_queue,1)
progress%target_queue => target_queue
progress%plain_mode = plain_mode
+ progress%n_complete = 0
allocate(progress%output_lines(progress%n_target))
- end subroutine output_init
+ end function new_build_progress
!> Output 'compiling' status for build target and overall percentage progress
subroutine output_status_compiling(progress, queue_index)
|