Signbank / Global-signbank

An online sign dictionary and sign database management system for research purposes. Developed originally by Steve Cassidy/ This repo is a fork for the Dutch version, previously called 'NGT-Signbank'.
http://signbank.cls.ru.nl
BSD 3-Clause "New" or "Revised" License
19 stars 12 forks source link

Change import script to trim trailing spaces #95

Closed ghost closed 9 years ago

ghost commented 9 years ago

Currently, when importing a CSV with the Import CSV function, data is imported 'as is'. For example, the existing value '#B' is seen as different from the imported value '#B ' (with a trailing space). Please strip trailing spaces from the imported data.

Woseseltops commented 9 years ago

Added a simple trim already. @richardbank , could you send me an example document, so I can test quickly?

ghost commented 9 years ago

Attached .csv-file changes Strong Hand and Weak hand values for 2 glosses: wesseltest and wesseltest3. Signbank contains handshape '#B' for wesseltest, and 'None' for wesseltest3. The .csv-file attempts to change the Strong Hand values into '#B ' (with a space), and the Weak Hand values into '#B' (only applicable to wesseltest3). The outcome should be that only wesseltest3 will be changed, and that both resulting Strong and Weak hand values are '#B'.

test-dictionary-export.txt

(Github apparently doesn't support the uploading of .csv-files, so I renamed to .txt)

On 2-10-2015 17:13, Wessel Stoop wrote:

Added a simple trim already. @richardbank https://github.com/richardbank , could you send me an example document, so I can quickly test?

— Reply to this email directly or view it on GitHub https://github.com/Woseseltops/signbank/issues/95#issuecomment-145057083.

ghost commented 9 years ago

I tested myself already, but I get an AttributeError at /signs/import_csv/: 'str' object has no attribute 'trim'.

Woseseltops commented 9 years ago

image

Hasty rush is rarely good :) . I fixed the trim problem (should be 'strip' in Python)!

ocrasborn commented 9 years ago

:-)

Woseseltops commented 9 years ago

It indeed now shows the behavior Richard described:

For wesseltest (3117), Weak Hand changes from None (None) to #B (90). For wesseltest (3117), Strong Hand changes from None (None) to #B (90).

I added the gloss number (3117) that it indeed is wesseltest3. The missing 3 is caused by the fact that I was playing with changing the idfield, for another issue.