polite-garden-50641
07/07/2020, 8:57 PMpants.engine.fs.Digest
) representing a single (text) file, how do I read the contents of the file into memory (string) ? or get a file-like object ?hundreds-father-404
07/07/2020, 8:58 PMawait Get(FileContent, Digest, my_digest)
Or possibly await Get(FilesContent, ..)
(plural), then get the first element of FilesContent
witty-crayon-22786
07/07/2020, 9:11 PMwitty-crayon-22786
07/07/2020, 9:11 PMSnapshot
might contain exactly one file, but it might not.witty-crayon-22786
07/07/2020, 9:12 PMwitty-crayon-22786
07/07/2020, 9:12 PMpolite-garden-50641
07/07/2020, 10:35 PMpolite-garden-50641
07/07/2020, 10:35 PMmy_digest = config_snapshot.digest
config_content = await Get(FileContent, my_digest)
polite-garden-50641
07/07/2020, 10:35 PMpolite-garden-50641
07/07/2020, 10:35 PMconfig_content = await Get(FileContent, Digest, my_digest)
polite-garden-50641
07/07/2020, 10:35 PMpolite-garden-50641
07/07/2020, 10:36 PMhundreds-father-404
07/07/2020, 10:36 PMFilesContent
, pluralpolite-garden-50641
07/07/2020, 10:37 PMconfig_content = await Get(FilesContent, Digest, my_digest)
polite-garden-50641
07/07/2020, 10:38 PMhundreds-father-404
07/07/2020, 10:38 PMwitty-crayon-22786
07/07/2020, 10:38 PMwitty-crayon-22786
07/07/2020, 10:39 PMhundreds-father-404
07/07/2020, 10:39 PMFileContent
and FilesContent
aren’t good names. Too subtle the differencepolite-garden-50641
07/07/2020, 10:39 PMpolite-garden-50641
07/07/2020, 10:40 PMwitty-crayon-22786
07/07/2020, 10:40 PMwitty-crayon-22786
07/07/2020, 10:41 PMwitty-crayon-22786
07/07/2020, 10:41 PMwitty-crayon-22786
07/07/2020, 10:41 PMhundreds-father-404
07/07/2020, 10:41 PMFileContent
and FileContentCollection
hundreds-father-404
07/07/2020, 10:42 PMwitty-crayon-22786
07/07/2020, 10:42 PMwitty-crayon-22786
07/07/2020, 10:42 PMis_executable
bool…witty-crayon-22786
07/07/2020, 10:43 PMInputFilesContent
.polite-garden-50641
07/07/2020, 10:43 PMpolite-garden-50641
07/07/2020, 10:43 PMpolite-garden-50641
07/07/2020, 10:44 PMwitty-crayon-22786
07/07/2020, 10:45 PMhundreds-father-404
07/08/2020, 12:29 AMInputFilesContent
?
* CreateDigest
* CreateFileContentCollection
* CreateFileContent
It would look like:
await Get(Digest, CreateDigest([FileContent(..), FileContent(..)])
hundreds-father-404
07/08/2020, 12:30 AMFilesContent
to FileContentCollection
polite-garden-50641
07/08/2020, 12:32 AMhundreds-father-404
07/08/2020, 12:32 AMawait Get(P, S)
. I know that’s clunky, but that’s the constraint of the systemhundreds-father-404
07/08/2020, 12:33 AMpolite-garden-50641
07/08/2020, 12:33 AMInputFilesContent([FileContent(".coveragerc", config_content.encode())])
I should be able to just do InputFilesContent.create_file(".coveragerc", config_content)
hundreds-father-404
07/08/2020, 12:34 AMInputFilesContent
, that’s fine.
We still need to do await Get(Digest, InputFilesContent, my_input_files_content)
at the end of the day, though. I’m wondering what is a better name than InputFilesContent
polite-garden-50641
07/08/2020, 12:34 AMpolite-garden-50641
07/08/2020, 12:35 AMInputFilesContent
? can't we infer that from my_input_files_content
?hundreds-father-404
07/08/2020, 12:36 AMawait Get(Digest, InputFilesContent, my_input_files_content)
or the abbreviated inline constructor-style:
await Get(Digest, InputFilesContent([FileContent(..)])
hundreds-father-404
07/08/2020, 12:37 AMInputFilesContent -> Digest
. Just like we parse the type hints of your @rule
function signaturepolite-garden-50641
07/08/2020, 12:41 AM