Commit Graph

157 Commits

Author SHA1 Message Date
Anatoly Galiulin
3374bcb373 parsecfg: handle streams and strings when saving or loading configuration (#5554) 2017-04-06 08:10:08 +02:00
Anatoly Galiulin
434a7c8426 Fix posix version of moveFile between different filesystems (#5580) 2017-03-23 23:40:03 +01:00
Ruslan Mustakov
310b73b556 Reduce the scope of stackTrace var (#5583)
Fixes #5571.
2017-03-22 01:06:05 +01:00
Parashurama
976095c894 add bitops module for optimized bit manipulation. (#5201) 2017-03-14 21:32:54 +01:00
c-blake
d59441340d Fixes incorrect fd==0 test on Unix; Conserves handles by default. (#5512)
* Fix 2 problems.  First, 0 is a valid fd on Unix (easily gotten if user first
closes all fds and then starts using memfiles).  Use -1 instead for an invalid
fd.  Second, it is best practice to conserve open fds on Unix and file handles
on Windows.  These handles are not needed unless the user wants to remap the
memory with ``mapMem`` (or a hypothetical future ``proc resize``).  Adding a
new bool param ``allowRemap=false`` to ``memfiles.open`` solves this cleanly
in a "mostly" backward compatible way.  This is only "mostly" because the
default ``false`` case does not keep unneeded resources allocated, but that
most sensible default means that any ``mapMem`` callers need to fix all their
open calls to have allowRemap=true, as this PR also does for tmemfiles2.nim.
* Include backwards compatibility note.
2017-03-12 20:45:10 +01:00
Florent
93305443aa close #5472 nre tests should be run (#5474)
nre tests were just being compiled - changed so that a failure causes exit code to defer causing `tester` to report it as a failure
2017-03-04 11:13:08 +01:00
Florent
f7af16a1c9 More robust tests for #5453 (#5469) 2017-03-03 01:30:49 +01:00
Florent
34a3d40d18 fixes #5444 - nre.findIter keeps searching when no match is possible (#5453) 2017-03-02 11:48:41 +01:00
Federico Ceratto
dd4d47c671 Add gethostname to nativesockets (#5443) 2017-03-01 09:44:24 +01:00
Andreas Rumpf
e5341a391d Merge pull request #5373 from nim-lang/feature/async-streams
Async streams and HTTP client streaming downloads support
2017-02-26 17:35:08 +01:00
Fabian Keller
f250c30b9d Make use of used in unittest (#5410) 2017-02-25 21:18:16 +01:00
Araq
1961e444c3 Merge branch 'devel' into feature/async-streams 2017-02-25 11:18:48 +01:00
Anatoly Galiulin
279e4b0451 Fixes #5382 2017-02-13 13:35:40 +01:00
Dominik Picheta
f9f86899b5 Implement streamed async/sync downloadFile and deprecate old one. 2017-02-11 14:00:53 +01:00
Dominik Picheta
1b4067a81b Implement streamed body reading in httpclient. 2017-02-11 12:43:16 +01:00
Araq
794d36cf31 fixes #5349 2017-02-08 14:33:05 +01:00
Parashurama
c57fcf42df fix string slice & splice (#5311)
code fixes courtesy of @memophen
2017-02-01 12:13:01 +01:00
Ruslan Mustakov
35d48765fb Use onThreadCreation to set default SSL context for each thread (#5265)
Fixes: #4998
2017-01-23 21:04:14 +01:00
Araq
cdebcf23d9 new segfaults.nim stdlib module works on Windows 2017-01-20 17:08:11 +01:00
Andreas Rumpf
7ff80cc8b2 first implementation of segfaults stdlib module 2017-01-20 12:40:54 +01:00
Parashurama
d04ca6ef23 Improve & optimize strutils 'find' procs (#5196)
* add 'last' argument to 'find' procs in strutils
* add 'rfind' proc for looking up set[char] in strutils
* use optimised C function 'memchr' when available
2017-01-11 09:48:31 +01:00
Andreas Rumpf
013e11fcc4 add copyDir stdlib test 2017-01-10 11:27:03 +01:00
Chris Heller
af63bd4e0b Update unit test to handle AssertionError instead of ValueError for #5119 2016-12-21 19:06:11 -08:00
Chris Heller
40d034b7e3 Guard against calling split with an empty string as a separator. Fixes #5119 2016-12-21 12:06:59 -08:00
Araq
7f8a02d0c6 make tos.nim green on Windows 2016-12-13 09:01:53 +01:00
Dominik Picheta
d6ab21eed5 Merge pull request #5080 from FedericoCeratto/httpheaders
Add HTTP header deletion, improve tests
2016-12-01 18:01:04 +01:00
Federico Ceratto
74e442f766 Add HTTP header deletion, improve tests 2016-12-01 00:11:59 +00:00
Dmitry Polienko
6bd86f7543 Rewrite xmltools.innerText
Make it recursive, define for node types other than xnElement
2016-11-30 10:38:22 +07:00
Ruslan Mustakov
2c146445bc Added deques module, deprecating queues 2016-11-24 19:11:51 +07:00
Felix Krause
434c27343e Parse 'Z' as valid timezone if offset is expected 2016-11-14 18:46:35 +01:00
Felix Krause
aa08c32c2b Improved -; fixed tests
* added prefix `-` operator for TimeInterval
 * improved `-` for both TimeInterval and TimeInfo
 * Fixed a DST test
2016-11-14 18:28:55 +01:00
Felix Krause
544a2cfe1a Fixed daylight saving time
* When formatting timezone, substract 1 hour from timezone when isDST
 * Do not depend DST in current timezone when parsing arbitrary date
   because formatted timestamps are never in DST.
 * On the way, removed an unnecessary line in parsing code which could
   cause bugs.
 * Added DST tests
2016-11-14 18:28:55 +01:00
Felix Krause
91a0674961 Fixed timezone rendering, added test 2016-11-10 19:03:46 +01:00
Andreas Rumpf
4c79583a95 Merge pull request #5002 from goldenreign/time-compare-nosideeffect
Add 'noSideEffect' pragma for Time type's operators. Fixes #4981
2016-11-07 16:52:34 +01:00
goldenreign
554105ff7c Add 'noSideEffect' pragma for Time type's operators 2016-11-07 12:14:28 +07:00
Felix Krause
9d5de8021b Use ISO 8601 format for times.$. Fixed tests.
* `$` now uses format() with explicit time zone.
 * Fixed errors in rendering "z", "zz" and "zzz"
 * Updated tests
2016-11-01 21:14:52 +01:00
Felix Krause
170745eb39 Removed tzname because it's broken
* No mapping between TimeInfo.tzname and TimeInfo.timezone
 * tzname of time.h is not well-defined, may have almost arbitrary
   length, and localization may differ
 * Code used hardcoded "UTC" string
2016-11-01 20:26:50 +01:00
jlp765
55b28f86e1 add test: echo a seq with a nil value 2016-11-01 13:41:31 +10:00
Andreas Rumpf
2f725e923e Merge pull request #4924 from nigredo-tori/fix-4917
Make createDir return discardable bool
2016-10-24 20:30:52 +02:00
Araq
a85e954b5d make tgetfileinfo work on Windows 2016-10-24 20:18:49 +02:00
Araq
6d645e5240 Merge branch 'devel' of https://github.com/rudis/Nim into rudis-devel 2016-10-24 20:11:00 +02:00
Dmitry Polienko
1cd4799b01 Improve as previously discussed
Better name for exposed primitive function, checks for pre-existing files
2016-10-22 18:39:10 +07:00
Dmitry Polienko
45b432b901 Revert createDir signature, expose rawCreateDir 2016-10-22 17:37:28 +07:00
Dmitry Polienko
48ef6761d8 Make createDir return discardable bool 2016-10-22 12:29:03 +07:00
Jonathan Bernard
b7232bd425 Fix #4922, bug in times.parse, mishandling DST. 2016-10-21 17:06:36 -05:00
Jonathan Bernard
68d3486f5a Bugfix for times.initInterval (issue #4889)
`initInterval` had logic to calculate and carry overflowed fields (65 seconds
turns into 5 seconds and carries 1 minute). However, we were not including that
carried value when we recalculate the carry over for the next period of time.So
if you had, for example, 3600 seconds, we carried 60 minutes into the minutes
calculation, but when we calculated how much we should carry into the hours
value we only considered what the user originally supplied for the minutes
field, and forgot to include those 60 carried minute.

So, for example, with the previous implementation this was true:

`seconds(60 * 60 * 24) == seconds(0)`

Or, as failing tests:

```nimrod
import times

assert seconds(60 * 60 * 24) != seconds(0)
assert seconds(60 * 60 * 24) == days(1)
```
2016-10-12 15:44:21 -05:00
Dominik Picheta
cff6ec2155 Implements onProgressChanged callback for httpclient. 2016-09-24 22:58:10 +02:00
Dominik Picheta
0baef8e6ea Implements getContent and postContent for (Async)HttpClient. 2016-09-24 20:33:00 +02:00
Dominik Picheta
fa9ec7a6b5 Handle redirects in HttpClient's post procs & post test. 2016-09-24 17:50:58 +02:00
Dominik Picheta
1fb5dd2477 Fixes #4797. 2016-09-19 19:36:35 +02:00