Skip to contents

Reads in the app state from yaml files.

Usage

DM_mk_preload(state)

Arguments

state

DM state object

Value

list with the following elements

  • isgood: Boolean indicating the exit status of the function.

  • msgs: Messages to be passed back to the user.

  • yaml_list: Lists with preload components.

Examples

sess_res = DM_test_mksession()
#> → ASM: including file
#> → ASM:   source: file.path(system.file(package="onbrand"), "templates", "report.docx")
#> → ASM:   dest:   file.path("config","report.docx")
#> → ASM: including file
#> → ASM:   source: file.path(system.file(package="onbrand"), "templates", "report.pptx")
#> → ASM:   dest:   file.path("config","report.pptx")
#> → ASM: including file
#> → ASM:   source: file.path(system.file(package="onbrand"), "templates", "report.yaml")
#> → ASM:   dest:   file.path("config","report.yaml")
#> → ASM: State initialized
#> → ASM: setting word placeholders: 
#> → ASM:   -> setting docx ph: HEADERLEFT = left header
#> → ASM:   -> setting docx ph: HEADERRIGHT = right header
#> → ASM:   -> setting docx ph: FOOTERLEFT = left footer
#> → ASM: module isgood: TRUE
#> → DM: including file
#> → DM:   source: file.path(system.file(package="onbrand"), "templates", "report.docx")
#> → DM:   dest:   file.path("config","report.docx")
#> → DM: including file
#> → DM:   source: file.path(system.file(package="onbrand"), "templates", "report.pptx")
#> → DM:   dest:   file.path("config","report.pptx")
#> → DM: including file
#> → DM:   source: file.path(system.file(package="onbrand"), "templates", "report.yaml")
#> → DM:   dest:   file.path("config","report.yaml")
#> → DM: module checksum updated: 441abbd92e02d893eb5136ccdfcc717d
#> → DM: State initialized
#> → DM: ds checksum updated: 641fcbc6616d24d05acded4317a3bb12
#> → DM: module checksum updated: 5c077c5702479f330bf233040eb4a51b
#> → DM: adding preload sources
#> → DM:  - file added: TEST_DATA.xlsx
#> → DM: added: TEST_DATA.xlsx
#> → DM:  - url added: https://raw.githubusercontent.com/john-harrold/formods/refs/heads/master/inst/test_data/SDTM_PC.csv
#> → DM: url added: https://raw.githubusercontent.com/john-harrold/formods/refs/heads/master/inst/test_data/SDTM_PC.csv
#> → DM:  - url added: https://raw.githubusercontent.com/john-harrold/formods/refs/heads/master/inst/test_data/SDTM_EX.csv
#> → DM: url added: https://raw.githubusercontent.com/john-harrold/formods/refs/heads/master/inst/test_data/SDTM_EX.csv
#> → DM:  - url added: https://raw.githubusercontent.com/john-harrold/formods/refs/heads/master/inst/test_data/SDTM_DM.csv
#> → DM: url added: https://raw.githubusercontent.com/john-harrold/formods/refs/heads/master/inst/test_data/SDTM_DM.csv
#> → DM: loading element idx: 1
#> → DM: ds checksum updated: 90805ca6c41a39696e1572d9b0a75868
#> → DM: module checksum updated: e23d5c825540acc0ebc26cb74c8b151a
#> → DM: added element idx: 1
#> → DM: loading element idx: 2
#> → DM: ds checksum updated: a1a54da72b55a00e0dc024ca18fe097d
#> → DM: module checksum updated: 4a510fc35bc32956b8f55454d4e27980
#> → DM: added element idx: 2
#> → DM: loading element idx: 3
#> → DM: ds checksum updated: 32bc6e74773d31449781445f6c9bb738
#> → DM: module checksum updated: 67a7f82a9fbae1ac2f087c29cd06066f
#> → DM: added element idx: 3
#> → DM: loading element idx: 4
#> → DM: ds checksum updated: 87d43c4dc095e8c0d403b0c729769f9a
#> → DM: module checksum updated: ccc56ef49257fbd9894e355e013a127b
#> → DM: added element idx: 4
#> → DM: module isgood: TRUE
#> → # preload_complete is good: TRUE ------------------------------------------
state = sess_res$state
res = DM_mk_preload(state)
#> → DM: saving source (1) data/DM/TEST_DATA.xlsx
#> → DM: saving source (2) https://raw.githubusercontent.com/john-harrold/formods/refs/heads/master/inst/test_data/SDTM_PC.csv
#> → DM: saving source (3) https://raw.githubusercontent.com/john-harrold/formods/refs/heads/master/inst/test_data/SDTM_EX.csv
#> → DM: saving source (4) https://raw.githubusercontent.com/john-harrold/formods/refs/heads/master/inst/test_data/SDTM_DM.csv
#> → DM: saving element (1) Excel (from file)
#> → DM: saving element (2) STDM PC (url)
#> → DM: saving element (3) STDM EX (url)
#> → DM: saving element (5) STDM DM (url)
#> → DM: mk_preload isgood: TRUE