Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
Adam Blažek | e64c2e9c59 | |
Adam Blažek | ecdce60091 | |
Adam Blažek | 02addb3db9 | |
Adam Blažek | 13919442ec |
|
@ -1,6 +1,6 @@
|
|||
# Package
|
||||
|
||||
version = "1.4.0"
|
||||
version = "1.5.0"
|
||||
author = "Adam Blažek"
|
||||
description = "CLI client for Bakaláři"
|
||||
license = "GPL-3.0"
|
||||
|
|
18
src/bk.nim
18
src/bk.nim
|
@ -1,5 +1,5 @@
|
|||
import json, net, options, os, strscans, times, unicode, uri
|
||||
from strutils import ffDecimal, formatFloat
|
||||
import htmlparser, json, net, options, os, strscans, times, unicode, uri, xmltree
|
||||
from strutils import ffDecimal, formatFloat, replace
|
||||
import cligen, colorize, elvis
|
||||
from bakalari as baka import Grade, newBakalari
|
||||
|
||||
|
@ -106,6 +106,17 @@ proc homework(
|
|||
stdout.writeLine homework.teacher.fgLightMagenta
|
||||
stdout.writeLine homework.content
|
||||
|
||||
proc messages(
|
||||
configFile = defaultConfigFile,
|
||||
) =
|
||||
withBakalari(defaultConfigFile):
|
||||
for message in baka.messages(bakalari):
|
||||
stdout.writeLine "----------------------------------------------------------------".fgLightGray
|
||||
stdout.writeLine message.sentTime.format("yyyy-MM-dd") .fgLightCyan
|
||||
stdout.writeLine message.title.fgLightYellow
|
||||
stdout.writeLine message.sender.fgLightMagenta
|
||||
stdout.writeLine message.text.replace("<br />", "{{br}}").parseHtml.innerText.replace("{{br}}", "\n")
|
||||
|
||||
proc timetable(
|
||||
configFile = defaultConfigFile,
|
||||
date = "",
|
||||
|
@ -159,6 +170,9 @@ try:
|
|||
[homework, help = {
|
||||
"config-file": "where the credentials are stored",
|
||||
}],
|
||||
[messages, help = {
|
||||
"config-file": "where the credentials are stored",
|
||||
}],
|
||||
[timetable, help = {
|
||||
"config-file": "where the credentials are stored",
|
||||
"date": "any date inside the week you want to display, in YYYYMMDD format (defaults to today)",
|
||||
|
|
Loading…
Reference in New Issue