little repo cleanup
This commit is contained in:
parent
fcabc0f9f4
commit
4d5c3ebd46
111 changed files with 53 additions and 115103 deletions
|
|
@ -63,7 +63,7 @@ method log*(L: ref TFileLogger, level: TLevel,
|
|||
|
||||
proc defaultFilename*(): string =
|
||||
## returns the default filename for a logger
|
||||
var (path, name, ext) = splitFile(getApplicationFilename())
|
||||
var (path, name, ext) = splitFile(getAppFilename())
|
||||
result = changeFileExt(path / name & "_" & getDateStr(), "log")
|
||||
|
||||
proc substituteLog*(frmt: string): string =
|
||||
|
|
@ -97,8 +97,7 @@ proc newFileLogger(filename = defaultFilename(),
|
|||
levelThreshold = lvlNone): ref TFileLogger =
|
||||
new(result)
|
||||
result.levelThreshold = levelThreshold
|
||||
if not open(result.f, filename, mode):
|
||||
raiseException(EIO, "cannot open for writing: " & filename)
|
||||
result.f = open(filename, mode)
|
||||
|
||||
proc newRollingFileLogger(filename = defaultFilename(),
|
||||
mode: TFileMode = fmAppend,
|
||||
|
|
@ -107,8 +106,7 @@ proc newRollingFileLogger(filename = defaultFilename(),
|
|||
new(result)
|
||||
result.levelThreshold = levelThreshold
|
||||
result.maxLines = maxLines
|
||||
if not open(result.f, filename, mode):
|
||||
raiseException(EIO, "cannot open for writing: " & filename)
|
||||
result.f = open(filename, mode)
|
||||
|
||||
var
|
||||
level* = lvlNone
|
||||
|
|
|
|||
|
|
@ -948,7 +948,7 @@ proc parseCmdLine*(c: string): seq[string] {.
|
|||
## This proc is only occassionally useful, better use the `parseopt` module.
|
||||
##
|
||||
## On Windows, it uses the following parsing rules
|
||||
## (see http://msdn.microsoft.com/en-us/library/17w5ykft.aspx):
|
||||
## (see http://msdn.microsoft.com/en-us/library/17w5ykft.aspx ):
|
||||
##
|
||||
## * Arguments are delimited by white space, which is either a space or a tab.
|
||||
## * The caret character (^) is not recognized as an escape character or
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@
|
|||
# distribution, for details about the copyright.
|
||||
#
|
||||
|
||||
## This module implements a redis client. It allows you to connect to a redis-server instance, send commands and receive replies.
|
||||
## This module implements a redis client. It allows you to connect to a
|
||||
## redis-server instance, send commands and receive replies.
|
||||
##
|
||||
## **Beware**: Most (if not all) functions that return a ``TRedisString`` may
|
||||
## return ``redisNil``, and functions which return a ``TRedisList``
|
||||
|
|
@ -559,7 +560,8 @@ proc zincrby*(r: TRedis, key: string, increment: string,
|
|||
proc zinterstore*(r: TRedis, destination: string, numkeys: string,
|
||||
keys: openarray[string], weights: openarray[string] = [],
|
||||
aggregate: string = ""): TRedisInteger =
|
||||
## Intersect multiple sorted sets and store the resulting sorted set in a new key
|
||||
## Intersect multiple sorted sets and store the resulting sorted set in
|
||||
## a new key
|
||||
var args = @[destination, numkeys]
|
||||
for i in items(keys): args.add(i)
|
||||
|
||||
|
|
@ -844,7 +846,8 @@ proc slaveof*(r: TRedis, host: string, port: string) =
|
|||
r.sendCommand("SLAVEOF", host, port)
|
||||
raiseNoOK(r.parseStatus())
|
||||
|
||||
when isMainModule:
|
||||
when false:
|
||||
# sorry, deactivated for the test suite
|
||||
var r = open()
|
||||
r.auth("pass")
|
||||
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ proc run*(handleRequest: proc (client: TSocket, input: string,
|
|||
s.client.close()
|
||||
s.close()
|
||||
|
||||
when isMainModule:
|
||||
when false:
|
||||
var counter = 0
|
||||
proc handleRequest(client: TSocket, input: string,
|
||||
headers: PStringTable): bool {.procvar.} =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue