Add license ands readme
This commit is contained in:
parent
5e9fee386c
commit
f7d712437e
|
@ -0,0 +1,46 @@
|
||||||
|
Installing
|
||||||
|
----------
|
||||||
|
Run `make` to generate a zipball runnable by python 3. Copy to bin dir.
|
||||||
|
|
||||||
|
Requires `zip` program to be installed
|
||||||
|
|
||||||
|
Usage
|
||||||
|
-----
|
||||||
|
lukkari.py [start [end]] file
|
||||||
|
|
||||||
|
Displays the timetable between start and end dates (or for current week / next week if weekend). Dates are given in format year-month-day.
|
||||||
|
|
||||||
|
File format
|
||||||
|
-----------
|
||||||
|
Basic record format is
|
||||||
|
|
||||||
|
name;free-form info;filter
|
||||||
|
|
||||||
|
Comments (`#`) are supported and `;` can be excaped with `\` as usual
|
||||||
|
|
||||||
|
Filter format
|
||||||
|
-------------
|
||||||
|
Filters are written in a sexpr based language. A function can be either a filter or a conjunction. Currently three different filters (`date`, `week`, and `weekday`) and four conjunctions (`and`, `or`, `not`, and `if`) are supported.
|
||||||
|
|
||||||
|
(date start-date [end-date])
|
||||||
|
(week week1 [week2 week3 …])
|
||||||
|
(weekday weekday1 [weekday2 weekday3 …])
|
||||||
|
|
||||||
|
Dates are given as year-month-day, weeks as year-week. Weekdays use the three-letter short names: `mon`, `tue`, `wed`, `thu`, `fri`, `sat`, `sun`.
|
||||||
|
|
||||||
|
While `date` checks that the date is in a given range (both ends inclusive), `week` and `weekday` check if the date is in a given week or given weekday. Thus, `(weekday mon wed)` only checks if the weekday is monday or wednesday, not if it's tuesday.
|
||||||
|
|
||||||
|
(and [exp1 expr2 expr3 …])
|
||||||
|
(or [exp1 expr2 expr3 …])
|
||||||
|
(not [exp1 expr2 expr3 …])
|
||||||
|
(if condition expr)
|
||||||
|
|
||||||
|
`and`, `or`, and `not` all take a variable amount of parameters. `and` checks that all are true, `or` that at least one is true, and `not` that none are true. All of these can be run with zero parameters, in which case `and` and `not` return true and `or` returns false.
|
||||||
|
|
||||||
|
`if` is a the implies operator from boolean algebra. If `condition` is true,`expr` needs to be true as well but if `condition` is false the expression is true regardless of the truth value of `expr`.
|
||||||
|
|
||||||
|
Whether the conjunctions are short-circuiting or not is not defined, but as the filters are pure functions it should not matter.
|
||||||
|
|
||||||
|
Bugs
|
||||||
|
----
|
||||||
|
There is no error reporting. All error handling is done by crashing on an assert.
|
|
@ -0,0 +1,24 @@
|
||||||
|
This is free and unencumbered software released into the public domain.
|
||||||
|
|
||||||
|
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||||
|
distribute this software, either in source code form or as a compiled
|
||||||
|
binary, for any purpose, commercial or non-commercial, and by any
|
||||||
|
means.
|
||||||
|
|
||||||
|
In jurisdictions that recognize copyright laws, the author or authors
|
||||||
|
of this software dedicate any and all copyright interest in the
|
||||||
|
software to the public domain. We make this dedication for the benefit
|
||||||
|
of the public at large and to the detriment of our heirs and
|
||||||
|
successors. We intend this dedication to be an overt act of
|
||||||
|
relinquishment in perpetuity of all present and future rights to this
|
||||||
|
software under copyright law.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||||
|
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
For more information, please refer to [http://unlicense.org]
|
Loading…
Reference in New Issue