diff options
Diffstat (limited to 'lib/pure')
-rwxr-xr-x | lib/pure/logging.nim | 8 | ||||
-rwxr-xr-x | lib/pure/os.nim | 2 | ||||
-rw-r--r-- | lib/pure/redis.nim | 9 | ||||
-rwxr-xr-x | lib/pure/scgi.nim | 2 |
4 files changed, 11 insertions, 10 deletions
diff --git a/lib/pure/logging.nim b/lib/pure/logging.nim index cd90188f4..1b14bef5e 100755 --- a/lib/pure/logging.nim +++ b/lib/pure/logging.nim @@ -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 diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 67435667a..e044fe605 100755 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -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 diff --git a/lib/pure/redis.nim b/lib/pure/redis.nim index e4a2b04e7..1d25f1a5d 100644 --- a/lib/pure/redis.nim +++ b/lib/pure/redis.nim @@ -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") diff --git a/lib/pure/scgi.nim b/lib/pure/scgi.nim index 48f5438c0..1326d9795 100755 --- a/lib/pure/scgi.nim +++ b/lib/pure/scgi.nim @@ -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.} = |