Opened 4 years ago

Closed 4 years ago

Last modified 2 years ago

#91 closed enhancement (fixed)

Improve parsing in Shared_Functions.get_dictionary_from_string(..)

Reported by: jcaffaro Owned by: Jerome Caffaro <jerome.caffaro@…>
Priority: minor Milestone:
Component: WebSubmit Version: v0.99.1
Keywords: Cc:

Description

The get_dictionary_from_string(..) taking care of parsing WebSubmit function parameters given using a syntax similar to Python dictionary would need to be improved.

Currently the function does not support commas (,) in keys and values, or colon (:) in values. For eg. the following returns unexpected values:

from invenio.websubmit_functions.Shared_Functions import get_dictionary_from_string

get_dictionary_from_string('{"foo,": "bar"}')
get_dictionary_from_string('{"foo": "bar,bar"}')
get_dictionary_from_string('{"foo:": "bar"}')

(colon ":" in values is to be quickly fixed in a soon to be integrated patch, but a cleaner approach is still needed)

Change History (2)

comment:1 Changed 4 years ago by Jerome Caffaro <jerome.caffaro@…>

  • Owner set to Jerome Caffaro <jerome.caffaro@…>
  • Resolution set to fixed
  • Status changed from new to closed

In [27b839d58ba764a3d6ac21d85504e7ea967d3c94]:

WebSubmit: improved dict-like params parsing

  • Improved parsing of WebSubmit function parameters that use a Python dictionary-like syntax. Fixes #91

comment:2 Changed 2 years ago by simko

  • Milestone v1.0 deleted

Milestone v1.0 deleted

Note: See TracTickets for help on using tickets.