├── .gitignore ├── LICENSE ├── LICENSE.electron-filesystem ├── README ├── bin └── tasker.clp ├── data └── README ├── etc ├── README ├── skel │ ├── README │ └── bootstrap.clp └── sys.clp ├── lib ├── README ├── import │ └── import.clp └── tasker │ ├── Frontend.clp │ ├── Note.clp │ └── Task.clp └── share └── shell └── tasker.sh /.gitignore: -------------------------------------------------------------------------------- 1 | src/github.com/DrItanium/electron 2 | bin/electron 3 | bin/tasker 4 | *.o 5 | *.swp 6 | data/*.tasks 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | tasker 2 | Copyright (c) 2013, Joshua Scoggins 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of tasker nor the 13 | names of its contributors may be used to endorse or promote products 14 | derived from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL Joshua Scoggins BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ============================================================================== 27 | 28 | This software uses the electron-filesystem. The license for it can be found in 29 | LICENSE.electron-filesystem 30 | -------------------------------------------------------------------------------- /LICENSE.electron-filesystem: -------------------------------------------------------------------------------- 1 | electron-filesystem 2 | Copyright (c) 2013, Joshua Scoggins 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of electron-filesystem nor the 13 | names of its contributors may be used to endorse or promote products 14 | derived from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL Joshua Scoggins BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Tasker is a library/tool for keeping track of tasks. 2 | 3 | It is meant to be quite simple so the actual library consists of two classes 4 | and a small number of messages. 5 | 6 | A task consists of a series of notes and is able to be opened, closed, 7 | postponed, and reopened. A note is an immutable piece of information that is 8 | attached to a task to give it context 9 | 10 | This tool now depends on electron with environment variable support. It also 11 | now uses the electron filesystem to make it a self-contained application. 12 | ============================================================================== 13 | The README accompanying the electron-filesystem: 14 | 15 | 16 | This is the default filesystem that I use to write self contained programs that 17 | use electron. This is possible due to the inclusion of shell variable access in 18 | newer versions of electron. 19 | 20 | 21 | The default file system is as follows 22 | 23 | bin/ - binaries, shell scripts, and initializer electron code 24 | lib/ - electron library code (use the import command to take advantage of it) 25 | etc/ - contains files that define program variables and other such things 26 | data/ - contains files generated by the program 27 | src/ - contains the electron source code. DO NOT PUT YOUR ELECTRON FILES HERE. 28 | IF YOU DO THEN YOU'RE RESPONSIBLE FOR GETTING IT INTO THE LIB FOLDER 29 | 30 | It should be noted that it is up to the programmer to customize this base 31 | filesystem to suit their needs. 32 | -------------------------------------------------------------------------------- /bin/tasker.clp: -------------------------------------------------------------------------------- 1 | ;------------------------------------------------------------------------------ 2 | ;tasker 3 | ;Copyright (c) 2013, Joshua Scoggins 4 | ;All rights reserved. 5 | ; 6 | ;Redistribution and use in source and binary forms, with or without 7 | ;modification, are permitted provided that the following conditions are met: 8 | ; * Redistributions of source code must retain the above copyright 9 | ; notice, this list of conditions and the following disclaimer. 10 | ; * Redistributions in binary form must reproduce the above copyright 11 | ; notice, this list of conditions and the following disclaimer in the 12 | ; documentation and/or other materials provided with the distribution. 13 | ; * Neither the name of tasker nor the 14 | ; names of its contributors may be used to endorse or promote products 15 | ; derived from this software without specific prior written permission. 16 | ; 17 | ;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ;ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | ;WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | ;DISCLAIMED. IN NO EVENT SHALL Joshua Scoggins BE LIABLE FOR ANY 21 | ;DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | ;(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | ;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | ;ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | ;(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | ;SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ;------------------------------------------------------------------------------ 28 | ; tasker.clp - Bootstraps the file system and loads sys.clp. It also loads the 29 | ; tasker code 30 | ; 31 | ; This file has to be batched 32 | ;------------------------------------------------------------------------------ 33 | (defglobal MAIN 34 | ; Change the value of this global to change the name of the 35 | ; corresponding shell variable. 36 | ?*electron-fs-root* = TaskerFSRoot 37 | ; Use this to make sure that we fail out if we can't bootstrap 38 | ?*fsys* = (progn (bind ?result (get-shell-variable ?*electron-fs-root*)) 39 | (if (not ?result) then 40 | (printout t "ERROR: " ?*electron-fs-root* " not defined - Exiting" crlf) 41 | (exit) 42 | else 43 | ?result))) 44 | ; Can't do loads within defglobal calls because it could cause crashes if 45 | ; we do a defglobal within a defglobal. 46 | 47 | ; Load the filesystem base points 48 | (load* (format nil "%s/etc/sys.clp" ?*fsys*)) 49 | ; Load the system base (import commands) 50 | (load* (format nil "%s/import/import.clp" ?*lib*)) 51 | ; Load the tasker code 52 | (import batch* "tasker/Frontend.clp") 53 | ; Load the current tasks 54 | (tasker:load-tasks) 55 | -------------------------------------------------------------------------------- /data/README: -------------------------------------------------------------------------------- 1 | This is the default location to store data generated by an electron program 2 | -------------------------------------------------------------------------------- /etc/README: -------------------------------------------------------------------------------- 1 | System variables go here. The files need to be written in electron/CLIPS using 2 | the defglobal commands 3 | -------------------------------------------------------------------------------- /etc/skel/README: -------------------------------------------------------------------------------- 1 | This folder contains default implementations of files that are necessary for 2 | building a self-contained electron application 3 | -------------------------------------------------------------------------------- /etc/skel/bootstrap.clp: -------------------------------------------------------------------------------- 1 | ;------------------------------------------------------------------------------ 2 | ;electron-filesystem 3 | ;Copyright (c) 2013, Joshua Scoggins 4 | ;All rights reserved. 5 | ; 6 | ;Redistribution and use in source and binary forms, with or without 7 | ;modification, are permitted provided that the following conditions are met: 8 | ; * Redistributions of source code must retain the above copyright 9 | ; notice, this list of conditions and the following disclaimer. 10 | ; * Redistributions in binary form must reproduce the above copyright 11 | ; notice, this list of conditions and the following disclaimer in the 12 | ; documentation and/or other materials provided with the distribution. 13 | ; * Neither the name of electron-filesystem nor the 14 | ; names of its contributors may be used to endorse or promote products 15 | ; derived from this software without specific prior written permission. 16 | ; 17 | ;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ;ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | ;WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | ;DISCLAIMED. IN NO EVENT SHALL Joshua Scoggins BE LIABLE FOR ANY 21 | ;DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | ;(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | ;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | ;ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | ;(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | ;SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ;------------------------------------------------------------------------------ 28 | ; bootstrap.clp - Bootstraps the file system and loads sys.clp. It is up to a 29 | ; shell script to call electron with the customized version of this file. 30 | ; 31 | ; This file has to be batched 32 | ;------------------------------------------------------------------------------ 33 | (defglobal MAIN 34 | ; Change the value of this global to change the name of the 35 | ; corresponding shell variable. 36 | ?*electron-fs-root* = ElectronFSRoot 37 | ; Use this to make sure that we fail out if we can't bootstrap 38 | ?*fsys* = (progn (bind ?result (get-shell-variable ?*electron-fs-root*)) 39 | (if (not ?result) then 40 | (printout t "ERROR: " ?*electron-fs-root* " not defined - Exiting" crlf) 41 | (exit) 42 | else 43 | ?result))) 44 | ; Can't do loads within defglobal calls because it could cause crashes if 45 | ; we do a defglobal within a defglobal. 46 | 47 | ; Load the filesystem base points 48 | (load* (format nil "%s/etc/sys.clp" ?*fsys*)) 49 | ; Load the system base (import commands) 50 | (load* (format nil "%s/import/import.clp" ?*lib*)) 51 | -------------------------------------------------------------------------------- /etc/sys.clp: -------------------------------------------------------------------------------- 1 | ;------------------------------------------------------------------------------ 2 | ;electron-filesystem 3 | ;Copyright (c) 2013, Joshua Scoggins 4 | ;All rights reserved. 5 | ; 6 | ;Redistribution and use in source and binary forms, with or without 7 | ;modification, are permitted provided that the following conditions are met: 8 | ; * Redistributions of source code must retain the above copyright 9 | ; notice, this list of conditions and the following disclaimer. 10 | ; * Redistributions in binary form must reproduce the above copyright 11 | ; notice, this list of conditions and the following disclaimer in the 12 | ; documentation and/or other materials provided with the distribution. 13 | ; * Neither the name of electron-filesystem nor the 14 | ; names of its contributors may be used to endorse or promote products 15 | ; derived from this software without specific prior written permission. 16 | ; 17 | ;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ;ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | ;WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | ;DISCLAIMED. IN NO EVENT SHALL Joshua Scoggins BE LIABLE FOR ANY 21 | ;DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | ;(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | ;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | ;ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | ;(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | ;SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ;------------------------------------------------------------------------------ 28 | ; sys.clp - Defines system variables that the rest of the filesystem uses. This 29 | ; is called by the system bootstrap after finding out where it is 30 | ;------------------------------------------------------------------------------ 31 | ; Define filesystem base points 32 | (defglobal MAIN 33 | ; lib directory 34 | ?*lib* = (format nil "%s/lib" ?*fsys*) 35 | ; data directory 36 | ?*data* = (format nil "%s/data" ?*fsys*) 37 | ; bin directory 38 | ?*bin* = (format nil "%s/bin" ?*fsys*) 39 | ; etc directory 40 | ?*etc* = (format nil "%s/etc" ?*fsys*) 41 | ?*path* = (create$ ?*lib*)) 42 | 43 | -------------------------------------------------------------------------------- /lib/README: -------------------------------------------------------------------------------- 1 | Put your electron/clips source code here. To access different libraries, make 2 | sure that you use the import command, not the load or batch commands. The 3 | import command uses the system variables defined in etc/sys.clp and also is 4 | really flexible in allowing load, load*, batch, and batch* behavior. 5 | -------------------------------------------------------------------------------- /lib/import/import.clp: -------------------------------------------------------------------------------- 1 | ;------------------------------------------------------------------------------ 2 | ;electron-filesystem 3 | ;Copyright (c) 2013, Joshua Scoggins 4 | ;All rights reserved. 5 | ; 6 | ;Redistribution and use in source and binary forms, with or without 7 | ;modification, are permitted provided that the following conditions are met: 8 | ; * Redistributions of source code must retain the above copyright 9 | ; notice, this list of conditions and the following disclaimer. 10 | ; * Redistributions in binary form must reproduce the above copyright 11 | ; notice, this list of conditions and the following disclaimer in the 12 | ; documentation and/or other materials provided with the distribution. 13 | ; * Neither the name of electron-filesystem nor the 14 | ; names of its contributors may be used to endorse or promote products 15 | ; derived from this software without specific prior written permission. 16 | ; 17 | ;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ;ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | ;WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | ;DISCLAIMED. IN NO EVENT SHALL Joshua Scoggins BE LIABLE FOR ANY 21 | ;DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | ;(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | ;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | ;ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | ;(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | ;SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ;------------------------------------------------------------------------------ 28 | ; import.clp - Defines the import method, a wrapper over load, load*, batch, 29 | ; and batch* that makes it possible to do relative includes without having to 30 | ; worry about absolute paths 31 | ;------------------------------------------------------------------------------ 32 | ; Assume that etc/sys.clp has already been loaded 33 | (defglobal MAIN 34 | ?*valid-import-actions* = (create$ load load* batch batch*)) 35 | (defgeneric import) 36 | 37 | (defmethod import 38 | ((?action SYMBOL (neq ?action (expand$ ?*valid-import-actions*))) 39 | (?local-path LEXEME)) 40 | (printout t 41 | (format nil "Provided action %s is not valid for import" ?action) crlf 42 | "Valid actions are: " ?*valid-import-actions* crlf) 43 | (return FALSE)) 44 | 45 | (defmethod import 46 | ((?action SYMBOL (not (neq ?action (expand$ ?*valid-import-actions*)))) 47 | (?local-path LEXEME)) 48 | (progn$ (?front ?*path*) 49 | (if (funcall ?action 50 | (format nil "%s/%s" ?front ?local-path)) then 51 | (return TRUE))) 52 | (return FALSE)) 53 | -------------------------------------------------------------------------------- /lib/tasker/Frontend.clp: -------------------------------------------------------------------------------- 1 | ;------------------------------------------------------------------------------ 2 | ;tasker 3 | ;Copyright (c) 2013, Joshua Scoggins 4 | ;All rights reserved. 5 | ; 6 | ;Redistribution and use in source and binary forms, with or without 7 | ;modification, are permitted provided that the following conditions are met: 8 | ; * Redistributions of source code must retain the above copyright 9 | ; notice, this list of conditions and the following disclaimer. 10 | ; * Redistributions in binary form must reproduce the above copyright 11 | ; notice, this list of conditions and the following disclaimer in the 12 | ; documentation and/or other materials provided with the distribution. 13 | ; * Neither the name of tasker nor the 14 | ; names of its contributors may be used to endorse or promote products 15 | ; derived from this software without specific prior written permission. 16 | ; 17 | ;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ;ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | ;WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | ;DISCLAIMED. IN NO EVENT SHALL Joshua Scoggins BE LIABLE FOR ANY 21 | ;DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | ;(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | ;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | ;ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | ;(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | ;SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ;------------------------------------------------------------------------------ 28 | ; Frontend.clp - Contains functions to streamline the process of using tasks 29 | ;------------------------------------------------------------------------------ 30 | ; Electron-Filesystem aware 31 | (import batch* "tasker/Task.clp") 32 | ;------------------------------------------------------------------------------ 33 | (defglobal MAIN 34 | ; Name of the current tasks 35 | ?*current-tasks-file-name* = current.tasks 36 | ?*current-tasks-path* = (format nil "%s/%s" ?*data* ?*current-tasks-file-name*) 37 | ) 38 | ;------------------------------------------------------------------------------ 39 | (defgeneric tasker:new) 40 | (defgeneric tasker:close-task) 41 | (defgeneric tasker:reopen-task) 42 | (defgeneric tasker:postpone-task) 43 | (defgeneric tasker:new-note) 44 | (defgeneric tasker:new-task) 45 | (defgeneric tasker:tasks) 46 | (defgeneric tasker:closed-tasks) 47 | (defgeneric tasker:postponed-tasks) 48 | (defgeneric tasker:save-tasks) 49 | (defgeneric tasker:load-tasks) 50 | (defgeneric tasker:read-task) 51 | ;------------------------------------------------------------------------------ 52 | (defmethod tasker:new 53 | ((?type SYMBOL (eq ?type task)) 54 | (?title LEXEME) 55 | (?description LEXEME) 56 | (?priority NUMBER)) 57 | (tasker:new-task ?title ?description ?priority)) 58 | 59 | (defmethod tasker:new 60 | ((?type SYMBOL (eq ?type task)) 61 | (?title LEXEME) 62 | (?description LEXEME)) 63 | (tasker:new-task ?title ?description)) 64 | 65 | (defmethod tasker:new 66 | ((?type SYMBOL (eq ?type note)) 67 | (?parent INSTANCE Task) 68 | (?description LEXEME)) 69 | (tasker:new-note ?parent ?description)) 70 | ;------------------------------------------------------------------------------ 71 | (defmethod tasker:new-task 72 | ((?title LEXEME) 73 | (?description LEXEME) 74 | (?priority NUMBER)) 75 | (tasker:new-note 76 | (make-instance of Task 77 | (title ?title) 78 | (priority ?priority)) 79 | ?description)) 80 | 81 | (defmethod tasker:new-task 82 | ((?title LEXEME) 83 | (?description LEXEME)) 84 | (tasker:new-task ?title ?description 0)) 85 | ;------------------------------------------------------------------------------ 86 | (defmethod tasker:new-note 87 | ((?parent INSTANCE Task) 88 | (?description LEXEME)) 89 | (send ?parent new-note ?description)) 90 | 91 | (defmethod tasker:new-note 92 | ((?parent SYMBOL) 93 | (?description LEXEME)) 94 | (tasker:new-note (symbol-to-instance-name ?parent) ?description)) 95 | ;------------------------------------------------------------------------------ 96 | (defmethod tasker:close-task 97 | ((?task INSTANCE Task) 98 | (?reason LEXEME)) 99 | (send ?task close ?reason)) 100 | 101 | (defmethod tasker:close-task 102 | ((?task SYMBOL) 103 | (?reason LEXEME)) 104 | (tasker:close-task (symbol-to-instance-name ?task) ?reason)) 105 | ;------------------------------------------------------------------------------ 106 | (defmethod tasker:reopen-task 107 | ((?task INSTANCE Task) 108 | (?reason LEXEME)) 109 | (send ?task reopen ?reason)) 110 | 111 | (defmethod tasker:reopen-task 112 | ((?task SYMBOL) 113 | (?reason LEXEME)) 114 | (tasker:reopen-task (symbol-to-instance-name ?task) ?reason)) 115 | 116 | ;------------------------------------------------------------------------------ 117 | (defmethod tasker:postpone-task 118 | ((?task INSTANCE Task) 119 | (?reason LEXEME)) 120 | (send ?task postpone ?reason)) 121 | 122 | (defmethod tasker:postpone-task 123 | ((?task SYMBOL) 124 | (?reason LEXEME)) 125 | (tasker:postpone-task (symbol-to-instance-name ?task) ?reason)) 126 | ;------------------------------------------------------------------------------ 127 | (defmethod tasker:tasks 128 | () 129 | (do-for-all-instances 130 | ((?z Task)) 131 | (not (neq (send ?z get-status) open reopened)) 132 | (printout t (format nil "%s - %s" 133 | (instance-name-to-symbol (instance-name ?z)) 134 | (send ?z get-title)) crlf))) 135 | ;------------------------------------------------------------------------------ 136 | (defmethod tasker:closed-tasks 137 | () 138 | (printout t "Closed Tasks: " crlf) 139 | (do-for-all-instances 140 | ((?z Task)) 141 | (not (neq (send ?z get-status) closed)) 142 | (printout t (format nil " %s - %s" 143 | (instance-name-to-symbol (instance-name ?z)) 144 | (send ?z get-title)) crlf))) 145 | ;------------------------------------------------------------------------------ 146 | (defmethod tasker:postponed-tasks 147 | () 148 | (printout t "Postponed Tasks: " crlf) 149 | (do-for-all-instances 150 | ((?z Task)) 151 | (not (neq (send ?z get-status) postponed)) 152 | (printout t (format nil " %s - %s" 153 | (instance-name-to-symbol (instance-name ?z)) 154 | (send ?z get-title)) crlf))) 155 | 156 | ;------------------------------------------------------------------------------ 157 | (defmethod tasker:save-tasks 158 | ((?path LEXEME)) 159 | (save-instances ?path visible)) 160 | 161 | (defmethod tasker:load-tasks 162 | ((?path LEXEME)) 163 | (load-instances ?path)) 164 | 165 | (defmethod tasker:load-tasks 166 | () 167 | (tasker:load-tasks ?*current-tasks-path*)) 168 | 169 | (defmethod tasker:save-tasks 170 | () 171 | (tasker:save-tasks ?*current-tasks-path*)) 172 | ;------------------------------------------------------------------------------ 173 | (defmethod tasker:read-task 174 | ((?task INSTANCE Task)) 175 | (printout t (send ?task get-title) crlf) 176 | (progn$ (?note (send ?task get-notes)) 177 | (printout t (send ?note get-message) crlf))) 178 | 179 | (defmethod tasker:read-task 180 | ((?task SYMBOL)) 181 | (tasker:read-task (symbol-to-instance-name ?task))) 182 | -------------------------------------------------------------------------------- /lib/tasker/Note.clp: -------------------------------------------------------------------------------- 1 | ;------------------------------------------------------------------------------ 2 | ;tasker 3 | ;Copyright (c) 2013, Joshua Scoggins 4 | ;All rights reserved. 5 | ; 6 | ;Redistribution and use in source and binary forms, with or without 7 | ;modification, are permitted provided that the following conditions are met: 8 | ; * Redistributions of source code must retain the above copyright 9 | ; notice, this list of conditions and the following disclaimer. 10 | ; * Redistributions in binary form must reproduce the above copyright 11 | ; notice, this list of conditions and the following disclaimer in the 12 | ; documentation and/or other materials provided with the distribution. 13 | ; * Neither the name of tasker nor the 14 | ; names of its contributors may be used to endorse or promote products 15 | ; derived from this software without specific prior written permission. 16 | ; 17 | ;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ;ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | ;WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | ;DISCLAIMED. IN NO EVENT SHALL Joshua Scoggins BE LIABLE FOR ANY 21 | ;DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | ;(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | ;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | ;ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | ;(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | ;SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ;------------------------------------------------------------------------------ 28 | ; Note.clp - Represents an immutable piece of data meant to be attached to a 29 | ; given task 30 | ;------------------------------------------------------------------------------ 31 | (defclass Note 32 | (is-a USER) 33 | (slot parent 34 | (type INSTANCE) 35 | (allowed-classes Task) 36 | (default ?NONE)) 37 | (slot index 38 | (type NUMBER) 39 | (default ?NONE)) 40 | (slot message 41 | (type LEXEME) 42 | (default ?NONE)) 43 | (multislot decomposition 44 | (access initialize-only)) 45 | (message-handler init after) 46 | (message-handler read primary)) 47 | 48 | (defmessage-handler Note init after 49 | () 50 | (bind ?self:decomposition (explode$ ?self:message))) 51 | 52 | (defmessage-handler Note read primary 53 | () 54 | (printout t ?self:message crlf)) 55 | 56 | -------------------------------------------------------------------------------- /lib/tasker/Task.clp: -------------------------------------------------------------------------------- 1 | ;------------------------------------------------------------------------------ 2 | ;tasker 3 | ;Copyright (c) 2013, Joshua Scoggins 4 | ;All rights reserved. 5 | ; 6 | ;Redistribution and use in source and binary forms, with or without 7 | ;modification, are permitted provided that the following conditions are met: 8 | ; * Redistributions of source code must retain the above copyright 9 | ; notice, this list of conditions and the following disclaimer. 10 | ; * Redistributions in binary form must reproduce the above copyright 11 | ; notice, this list of conditions and the following disclaimer in the 12 | ; documentation and/or other materials provided with the distribution. 13 | ; * Neither the name of tasker nor the 14 | ; names of its contributors may be used to endorse or promote products 15 | ; derived from this software without specific prior written permission. 16 | ; 17 | ;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ;ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | ;WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | ;DISCLAIMED. IN NO EVENT SHALL Joshua Scoggins BE LIABLE FOR ANY 21 | ;DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | ;(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | ;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | ;ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | ;(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | ;SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ;------------------------------------------------------------------------------ 28 | ; Task.clp - Represents something to do 29 | ;------------------------------------------------------------------------------ 30 | ;electron-filesystem enabled 31 | (import load* "tasker/Note.clp") 32 | 33 | (defclass Task 34 | (is-a USER) 35 | (slot title 36 | (type LEXEME) 37 | (default ?NONE)) 38 | (slot status 39 | (type SYMBOL) 40 | (allowed-symbols open closed postponed reopened)) 41 | (slot note-count 42 | (type INTEGER) 43 | (range 0 ?VARIABLE)) 44 | (slot priority 45 | (type NUMBER)) 46 | (multislot notes 47 | (type INSTANCE) 48 | (allowed-classes Note)) 49 | (message-handler is primary) 50 | (message-handler close primary) 51 | (message-handler note# primary) 52 | (message-handler reopen primary) 53 | (message-handler postpone primary) 54 | (message-handler new-note primary) 55 | (message-handler note-id primary)) 56 | 57 | (defmessage-handler Task is primary 58 | (?status) 59 | (eq ?self:status ?status)) 60 | 61 | (defmessage-handler Task close primary 62 | (?reason) 63 | (if (neq ?self:status closed) then 64 | (bind ?self:status closed) 65 | (send ?self new-note 66 | (format nil "Closed task: %n%s" ?reason)))) 67 | 68 | 69 | (defmessage-handler Task note# primary 70 | (?index) 71 | (nth$ ?index ?self:notes)) 72 | 73 | (defmessage-handler Task reopen primary 74 | (?reason) 75 | (if (eq ?self:status closed) then 76 | (bind ?self:status reopened) 77 | (send ?self new-note 78 | (format nil "Reopened task: %n%s" ?reason)))) 79 | 80 | (defmessage-handler Task postpone primary 81 | (?reason) 82 | (if (not (neq ?self:status open reopened)) then 83 | (bind ?self:status postponed) 84 | (send ?self new-note 85 | (format nil "Postponed task: %n%s" ?reason)))) 86 | 87 | (defmessage-handler Task new-note primary 88 | (?message) 89 | (bind ?r (make-instance of Note 90 | (index (send ?self note-id)) 91 | (parent (instance-name ?self)) 92 | (message ?message))) 93 | (slot-direct-insert$ notes 94 | (+ ?self:note-count 2) 95 | (instance-name ?r))) 96 | 97 | (defmessage-handler Task note-id primary 98 | () 99 | (bind ?nid ?self:note-count) 100 | (bind ?self:note-count (+ ?nid 1)) 101 | (return ?nid)) 102 | 103 | -------------------------------------------------------------------------------- /share/shell/tasker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Simple tasker execution script 3 | pushd . 4 | export $TaskerFSRoot=$HOME/.tasker/ 5 | cd $TaskerFSRoot 6 | bin/tasker -f2 bin/tasker.clp 7 | popd 8 | --------------------------------------------------------------------------------