-
Notifications
You must be signed in to change notification settings - Fork 123
CSVStorage and Lineendings #298
Changes from 3 commits
7a26ac7
5739c4a
84daebd
01ceda7
a4f6d7f
a3b5582
982c524
15112a5
3658360
eab59de
bd0b444
8609a25
357502a
54bd037
03800c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -660,3 +660,58 @@ description:python warning | |
severity:warning | ||
ingroup:plugin | ||
module:python | ||
|
||
number:113 | ||
description:couldnt open file. | ||
severity:error | ||
ingroup:plugin | ||
module:lineendings | ||
|
||
number:114 | ||
description:invalid line ending. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please no dot at end (also in 116, 118, 119,..) |
||
severity:error | ||
ingroup:plugin | ||
module:lineendings | ||
|
||
number:115 | ||
description:inconsistent line endings | ||
severity:error | ||
ingroup:plugin | ||
module:lineendings | ||
|
||
number:116 | ||
description: couldn't open file. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see above about could not open file error |
||
severity:error | ||
ingroup:plugin | ||
module:csvstorage | ||
|
||
number:117 | ||
description:invalid number of columns | ||
severity:error | ||
ingroup:plugin | ||
module:csvstorage | ||
|
||
number:118 | ||
description:see Reason. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thats a bit too generic. Maybe rename to |
||
severity:warning | ||
ingroup:plugin | ||
module:csvstorage | ||
|
||
number:119 | ||
description:out of memory. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am afraid that ELEKTRA_SET_ERROR won't work in a out of memory situation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so in an out of memory situation just cleanup and returning -1 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not against an error for out of memory. But the error should be not specific to this plugin and should be used consistently (for every allocation) in the plugins which are out-of-memory safe. |
||
severity:error | ||
ingroup:plugin | ||
module:csvstorage | ||
|
||
number:120 | ||
description: Couldn't compile regex. | ||
severity: error | ||
ingroup:plugin | ||
module:enum | ||
|
||
number:121 | ||
description:Validation failed. | ||
severity:error | ||
ingroup:plugin | ||
module:enum | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,7 @@ productive use: | |
- [fstab](fstab) reads fstab files. | ||
- [regexstore](regexstore) | ||
- [simpleini](simpleini) is ini without sections | ||
|
||
- [csvstorage](csvstorage) uses csv files | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for csv files |
||
|
||
## System Information ## | ||
|
||
|
@@ -126,7 +126,7 @@ copied by another plugin just before): | |
- [network](network) by using network APIs | ||
- [path](path) by checking files on filesystem | ||
- [type](type) using runtime type checking (CORBA types) | ||
|
||
- [enum](enum) compares the keyvalue against a list of valid values | ||
|
||
## Interpreter ## | ||
|
||
|
@@ -142,6 +142,7 @@ These plugins start an interpreter and allow you to use a bindings. | |
- [doc](doc) contains the documentation of the plugin interface | ||
- [error](error) yields errors as described in metadata | ||
- [template](template) to be copied for new plugins | ||
- [lineendings](lineendings) tests file for consistent line endings | ||
|
||
To add a new plugin you can copy the template plugin. Please make sure | ||
to add your plugin: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
include (LibAddMacros) | ||
|
||
add_plugin(csvstorage | ||
SOURCES | ||
csvstorage.h | ||
csvstorage.c | ||
) | ||
|
||
install(DIRECTORY csvstorage DESTINATION ${TARGET_TEST_DATA_FOLDER}) | ||
|
||
add_plugintest(csvstorage) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
- infos = Information about the csvstorage plugin is in keys below | ||
- infos/author = Thomas Waser | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you provide some e-mail adr? You can also have a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i would prefer the latter if possible |
||
- infos/licence = BSD | ||
- infos/needs = | ||
- infos/provides = storage | ||
- infos/placements = getstorage setstorage | ||
- infos/description = parses csv files | ||
|
||
## Introduction ## | ||
|
||
This plugin allowes Elektra to read and write CSV files. | ||
|
||
## Configuration ## | ||
|
||
`config/delimiter` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can leave out the |
||
Tells the plugin what delimiter is used in the file. | ||
The default delimiter is ; and will be used if config/delimiter is not set. | ||
|
||
`config/useheader = 1` | ||
Tells the plugin to use the first line as a header. The columns will get the | ||
coresponding names. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is the default? What means the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ; if nothing else is specified. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello, tom-wa wrote:
Its preferable. Exception: if there is no doubt how it is meant and its highly
No guideline, but there should be. I opened #308. For now go with strict "1" |
||
|
||
`config/outputdelim` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consistent name: delimiter was fully written, delim only short. Is the other one a parsing (input) delimiter only or does I think only one delimiter should suffice. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the second delimiter was just for changing the delimiter when writing the file. gonna remove that because it's basically useless. |
||
Tells the plugin what delimiter should be used for output. | ||
If not set, ; will be used | ||
|
||
## Example ## | ||
|
||
`kdb mount test.csv /csv csvstorage delimiter=";" useheader=1` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for storage plugins, we already have the errors 109, 110, 9, 75 and the macros ELEKTRA_SET_ERROR_GET ELEKTRA_SET_ERROR_SET to have consistent error reporting