Tcl Library Source Code

View Ticket
Login
2007-10-12
05:39 • Ticket [1811890fff] inifile : allow keys with no assignment status still Open with 1 other change artifact: 1c8d95328a user: andreas_kupries
05:39 • Ticket [1811890fff]: 5 changes artifact: 8a54e0b12e user: andreas_kupries
05:36 • Add attachment inifile-patch.tgz to ticket [1811890fff] artifact: 9b15e4f89d user: jvella23
05:36 • Ticket [1811890fff] inifile : allow keys with no assignment status still Open with 4 other changes artifact: d0c8c31f55 user: jvella23
2007-10-11
22:36 • New ticket [1811890fff]. artifact: 66ef18f78b user: jvella23

Ticket UUID: 1811890
Title: inifile : allow keys with no assignment
Type: Patch Version: None
Submitter: jvella23 Created on: 2007-10-11 22:36:41
Subsystem: inifile Assigned To: afaupell
Priority: 5 Medium Severity:
Status: Open Last Modified: 2007-10-12 05:39:42
Resolution: None Closed By:
    Closed on:
Description:
First off, the "Category" list is missing "inifile".

I'm attaching a patch to allow section keys that have no assigned value, not even an empty value which is done by doing "key=". This will allow a call to the ::get function to successfully return key "C" in the following example section:

[dummy]
A=first
B=
C

A simple example of where this enhancement comes into play is if you wanted to use a section to hold a simple list of names, for example a list of valid file suffixes:

[suffix_list]
.txt
.tcl
.cxx

The ::value function was modified to return the default value for keys that exist but have no assignment. This allows distinguishing the case where a key exists and is assigned an empty value versus a key that has no assignment.

I've updated the test to cover this new capability.

The patch was made against version 1.13 of ini.tcl and includes the following file updates:

ini.tcl
inifile.test
pkgIndex.tcl
test.ini
User Comments: andreas_kupries added on 2007-10-12 05:39:06:
Logged In: YES 
user_id=75003
Originator: NO

Reassigned to author of inifile package.

jvella23 added on 2007-10-12 05:36:41:

File Added - 249291: inifile-patch.tgz

Attachments: