[nat] rename archiveController commands to capital names
This commit is contained in:
@@ -134,34 +134,35 @@
|
|||||||
&mut :ChangeSet lastChangeSet []
|
&mut :ChangeSet lastChangeSet []
|
||||||
:Map<String,Command> commands (new Map)]
|
:Map<String,Command> commands (new Map)]
|
||||||
|
|
||||||
(defCommand selectEntry [e OneEntry]
|
(defCommand SelectEntry [e OneEntry]
|
||||||
(set selectedEntries [e]) [])
|
(set selectedEntries [e]) [])
|
||||||
|
|
||||||
(defCommand selectEntries [entries (Entries null null)]
|
(defCommand SelectEntries [entries (Entries null null)]
|
||||||
(set selectedEntries entries) [])
|
(set selectedEntries entries) [])
|
||||||
|
|
||||||
(defCommand selectAllEntries []
|
(defCommand SelectAllEntries []
|
||||||
(set selectedEntries (for =>id e archive.entries e)) [])
|
(set selectedEntries (for =>id e archive.entries e)) [])
|
||||||
|
|
||||||
(defCommand selectLastChangeSet []
|
(defCommand SelectLastChangeSet []
|
||||||
(set selectedEntries lastChangeSet) [])
|
(set selectedEntries lastChangeSet) [])
|
||||||
|
|
||||||
(defCommand printSelectedEntries [entries (SelectedEntries null null)]
|
(defCommand PrintSelectedEntries [entries (SelectedEntries null null)]
|
||||||
(doFor e entries (ui.displayMessage (archive.fullString e))) [])
|
(doFor e entries (ui.displayMessage (archive.fullString e))) [])
|
||||||
|
|
||||||
(defCommand printComponent [entries (SelectedEntries null null)
|
(defCommand PrintComponent [entries (SelectedEntries null null)
|
||||||
componentType (Text null)]
|
componentType (Text null)]
|
||||||
(doFor e entries (ui.displayMessage (archive.componentData e componentType))) [])
|
(doFor e entries (ui.displayMessage (archive.componentData e componentType))) [])
|
||||||
|
|
||||||
(defCommand createEntry [name (Text null)]
|
(defCommand CreateEntry [name (Text null)]
|
||||||
[(archive.createEntry ->e
|
[(archive.createEntry ->e
|
||||||
(addComponent archive e Name name))])
|
(addComponent archive e Name name))])
|
||||||
|
|
||||||
(defCommand createEntries [names (VarText null)]
|
(defCommand CreateEntries [names (VarText null)]
|
||||||
|
// createEntry returns a list, so these lists must be flattened
|
||||||
(flatten (for name names
|
(flatten (for name names
|
||||||
(createEntry name))))
|
(CreateEntry name))))
|
||||||
|
|
||||||
(defCommand addTags [entries (SelectedEntries 1 null)
|
(defCommand AddTags [entries (SelectedEntries 1 null)
|
||||||
tagsToAdd (VarText null)]
|
tagsToAdd (VarText null)]
|
||||||
(doFor e entries
|
(doFor e entries
|
||||||
(withWritableEntry archive e
|
(withWritableEntry archive e
|
||||||
@@ -171,7 +172,7 @@
|
|||||||
(addComponent archive e Tags (for tag tagsToAdd =>tag 1)))))
|
(addComponent archive e Tags (for tag tagsToAdd =>tag 1)))))
|
||||||
entries) // TODO this includes entries that already had the tag in the changeset
|
entries) // TODO this includes entries that already had the tag in the changeset
|
||||||
|
|
||||||
(defCommand removeTags [entries (SelectedEntries 1 null)
|
(defCommand RemoveTags [entries (SelectedEntries 1 null)
|
||||||
tagsToRemove (VarText null)]
|
tagsToRemove (VarText null)]
|
||||||
(doFor e entries
|
(doFor e entries
|
||||||
(withWritableEntry archive e
|
(withWritableEntry archive e
|
||||||
@@ -180,13 +181,13 @@
|
|||||||
(doFor tag tagsToRemove (tags.remove tag))))))
|
(doFor tag tagsToRemove (tags.remove tag))))))
|
||||||
entries) // TODO this includes entries that didn't have the tag in the changeset
|
entries) // TODO this includes entries that didn't have the tag in the changeset
|
||||||
|
|
||||||
(defCommand selectByTags [tagsBoolExp (Text null)]
|
(defCommand SelectByTags [tagsBoolExp (Text null)]
|
||||||
(selectEntries (filter archive.entries ->e (tagsMatch archive e tagsBoolExp))))
|
(SelectEntries (filter archive.entries ->e (tagsMatch archive e tagsBoolExp))))
|
||||||
|
|
||||||
(defCommand selectByComponents [componentsBoolExp (Text null)]
|
(defCommand SelectByComponents [componentsBoolExp (Text null)]
|
||||||
(selectEntries (filter archive.entries ->e (componentsMatch e componentsBoolExp))))
|
(SelectEntries (filter archive.entries ->e (componentsMatch e componentsBoolExp))))
|
||||||
|
|
||||||
(defCommand attachFiles [entries (SelectedEntries 1 null)
|
(defCommand AttachFiles [entries (SelectedEntries 1 null)
|
||||||
// TODO add File and Files as an argument type for commands, ArchiveUI
|
// TODO add File and Files as an argument type for commands, ArchiveUI
|
||||||
// TODO make tkinter file browser externs and use tkinter as the file picking mechanism for CLI
|
// TODO make tkinter file browser externs and use tkinter as the file picking mechanism for CLI
|
||||||
files (VarText null)]
|
files (VarText null)]
|
||||||
|
@@ -4,9 +4,11 @@ import kiss.Kiss;
|
|||||||
import kiss.Prelude;
|
import kiss.Prelude;
|
||||||
import nat.BoolExpInterp;
|
import nat.BoolExpInterp;
|
||||||
import nat.Archive;
|
import nat.Archive;
|
||||||
|
import nat.ArchiveController;
|
||||||
import nat.Lib;
|
import nat.Lib;
|
||||||
import nat.components.*;
|
import nat.components.*;
|
||||||
import nat.systems.*;
|
import nat.systems.*;
|
||||||
|
import uuid.Uuid;
|
||||||
|
|
||||||
@:build(kiss.Kiss.build())
|
@:build(kiss.Kiss.build())
|
||||||
class TestMain {}
|
class TestMain {}
|
||||||
|
@@ -28,7 +28,12 @@
|
|||||||
[author Author
|
[author Author
|
||||||
name Name]
|
name Name]
|
||||||
(assert (= author "Rafael Krux"))
|
(assert (= author "Rafael Krux"))
|
||||||
(assert (= name "Adventure"))))
|
(assert (= name "Adventure")))
|
||||||
|
|
||||||
(let [wikipedia (new MediaWikiSystem "https://en.wikipedia.org/w/api.php" null null 1)]
|
(let [wikipedia (new MediaWikiSystem "https://en.wikipedia.org/w/api.php" null null 1)]
|
||||||
~(wikipedia.queryImageUrls (wikipedia.queryImageTitles ["Phoenix Wright"])))
|
~(wikipedia.queryImageUrls (wikipedia.queryImageTitles ["Phoenix Wright"])))
|
||||||
|
|
||||||
|
// TODO make a dummy UI for this, instead of passing null
|
||||||
|
(let [controller (new ArchiveController archive null)]
|
||||||
|
// TODO test controller
|
||||||
|
0))
|
||||||
|
Reference in New Issue
Block a user