V1.2.0 ("Cloudbusting")
Changes in this release
Major
- API change: single-instance values and multiple-instance values are broken into two data fields (see API change, below)
- XSL relaxation (see XSL relaxation, below)
Minor
- Now uses Plumage-XSL V1.1.1 for underlying XSL transform (for SPDX support)
- Now uses Software Package Data Exchange (SPDX) license identifier
- Self-test removed in favor of unit testing
API change
In release V1.1.0 and earlier, both single-instance attributes and multiple-instance attributes were kept in a single dictionary named TSDRMap
. Examples of single-instance attributes are the application serial number (ApplicationNumber
), the filing date (ApplicationDate
), and its current status (MarkCurrentStatusExternalDescriptionText
). Examples of multiple-instance attributes are prosecution events and assignments (kept in the lists MarkEventList
and AssignmentList
, respectively); these entries are lists of dictionaries, each dictionary representing one prosecution event or assignment.
This required program logic to recognize the type of entry by its key; if it ended in "List", the entry was to be treated as a list of dictionaries; otherwise as a string. This was awkward even in Python, and is especially ungainly in strongly-typed implementations such as the C# Plumage-dotnet implementation, which required storing the materials as generic objects and casting them as required, losing the benefits of typing. While the problem was more pronounced in strongly-typed languages, it's a bit annoying in Python, too, and in the interest of keeping the interfaces consistent, I'm revising the API in both implementations.
In this release, the prior mixed-content dictionary TSDRMap
is replaced by a new object TSDRData
, which now contains two dictionaries: TSDRSingle
for single-valued attributes, and TSDRMulti
for multi-valued attributes. In addition, the TSDRMapIsValid
flag is moved into the TSDRData
object.
The following snippet demonstrates the changes.
V1.1.0 and older:
t = plumage.TSDRReq()
t.getTSDRInfo("2564831", "r") # get info on reg. no 2,564,831
if t.TSDRMapIsValid:
print "Application serial no: ", t.TSDRMap["ApplicationNumber"]
event_list = t.TSDRMap["MarkEventList"]
most_recent_event = event_list[0]
print "Most recent event: ", most_recent_event["MarkEventDescription"]
V1.2.0:
t = plumage.TSDRReq()
t.getTSDRInfo("2564831", "r") # get info on reg. no 2,564,831
if t.TSDRData.TSDRMapIsValid:
print "Application serial no: ", t.TSDRData.TSDRSingle["ApplicationNumber"]
event_list = t.TSDRData.TSDRMulti["MarkEventList"]
most_recent_event = event_list[0]
print "Most recent event: ", most_recent_event["MarkEventDescription"]
Also, for consistency with the change from the TSDRMap
dictionary to the TSDRData
object , as well as consistency with other method names, the getTSDRMap
and resetTSDRMap
method have been renamed to getTSDRData
and resetTSDRData
, respectively.
XSL relaxation
Prior to this release, the CSV produced by the XSL transform could have no blank or empty lines. This made constructing a usable XSL file burdensome and made the XSL file itself more clutterful. With this release, the XSLT can produce blank or empty lines, and they will be stripped out as part of building the CSV information. The lines are removed as part of building the TSDRReq.CSVData
member.