Skip to content

Commit

Permalink
added screenshots to the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Harald Fauland committed Apr 9, 2020
1 parent dcfd94a commit 0a87f42
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Standalone CLI downloader for the Imperial Library of Trantor written in Nim.

![Alt text](/src/res/help.png?raw=true "The help function")
![Alt text](/src/res/searching_with_language_and_path.png?raw=true "The search function")


## Getting Started
Grab a copy of trandl from [Releases](https://github.com/faulander/tradl/releases) and unzip it to a directory of your choice.
Open a command prompt in this directory and type "trandl.exe -h".
Expand Down
Binary file modified src/res/searching_with_language_and_path.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 13 additions & 8 deletions src/tradl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,28 @@ var filename, title, downloadURL: string
var possible_downloads: seq[Table[string, string]] = @[]
var feed: RSS

# LOGGING
#var logger = newConsoleLogger(fmtStr="[$datetime] - $levelname - ")
var fileLog = newFileLogger(joinPath(homedir, ".tradl", "errors.log"), levelThreshold=lvlError, fmtStr="[$datetime] - $levelname - ")
var rollingLog = newRollingFileLogger(joinPath(homedir, ".tradl", "rolling.log"), maxLines=500, fmtStr="[$datetime] - $levelname - ")
#addHandler(logger)
addHandler(fileLog)
addHandler(rollingLog)

# SETTINGS
discard existsOrCreateDir(joinPath(homedir, ".tradl"))
if not existsFile(joinPath(homedir, ".tradl", "downloads.txt")):
writeFile(joinPath(homedir, ".tradl", "downloads.txt"), "")
if not existsFile(joinPath(homedir, ".tradl", "error.log")):
writeFile(joinPath(homedir, ".tradl", "error.log"), "")
if not existsFile(joinPath(homedir, ".tradl", "rolling.log")):
writeFile(joinPath(homedir, ".tradl", "rolling.log"), "")
let downloads = joinPath(homedir, ".tradl", "downloads.txt")
for line in downloads.lines:
books.add(line)

# LOGGING
#var logger = newConsoleLogger(fmtStr="[$datetime] - $levelname - ")
var fileLog = newFileLogger(joinPath(homedir, ".tradl", "errors.log"), levelThreshold=lvlError, fmtStr="[$datetime] - $levelname - ")
var rollingLog = newRollingFileLogger(joinPath(homedir, ".tradl", "rolling.log"), maxLines=500, fmtStr="[$datetime] - $levelname - ")
#addHandler(logger)
addHandler(fileLog)
addHandler(rollingLog)


# ARGUMENT PARSING
var p = newParser("tradl"):
help("trandl means 'The Imperial Library of Trantor Downloader.")
Expand Down Expand Up @@ -86,7 +92,6 @@ if opts.help == false and opts.search == "":
f.writeLine(book)
f.close()

#https://trantor.is/search/?q=lang%3Ade+"sandra+mohr"&fmt=rss
if opts.search != "":
var searchstring = replace(opts.search, " ", "+")
if opts.language == "":
Expand Down

0 comments on commit 0a87f42

Please sign in to comment.