NAT Playground use ui for log

This commit is contained in:
2022-06-27 18:38:20 +00:00
parent 1962d99526
commit 309c027ba5
2 changed files with 12 additions and 4 deletions

View File

@@ -188,6 +188,17 @@
(flatten (for name names
(CreateEntry name))))
(defCommand CreateMediaEntry [medium (Text null) name (Text null)]
[(archive.createEntry ->e {
(addComponent archive e Name name)
(addTags archive e ["media" medium])})])
(defCommand CreateMediaEntries [medium (Text null) names (VarText null)]
// createEntry returns a list, so these lists must be flattened
(flatten (for name names
(CreateEntry name))))
// TODO use Tag and VarTag arg types for AddTags and RemoveTags
(defCommand AddTags [entries (SelectedEntries 1 null)
tagsToAdd (VarText null)]
(doFor e entries

View File

@@ -21,10 +21,7 @@
(.urlDecode (url.withoutDirectory))
// Some symbols shouldn't be decoded because they're invalid in file systems!
"\"" "%22"))]
// TODO write a macro that either does both print and displayMessage if a ui is available
(when ui
(ui.displayMessage "Downloading $title image: $url"))
(print url "downloading")
(log ui "Downloading $title image: $url")
(assertProcess "curl" ["--output" filePath url])
filePath)))
// Trigger the creation of a new Images component including the wikipedia images