Code Monkey home page Code Monkey logo

Comments (2)

Louson avatar Louson commented on July 20, 2024

I had to apply this patch:

diff --git a/implementations/4/combine_docs.py b/implementations/4/combine_docs.py
index 093ef50..89005a4 100644
--- a/implementations/4/combine_docs.py
+++ b/implementations/4/combine_docs.py
@@ -10,8 +10,8 @@ def combine(doc1, doc2):
     # We assume Acme Company is combining the documents, so the document
     # level id's hold
     org_id = "urn:acme.com-4fe40e24-20e3-11ee-be56-0242ac120002"
-    profiles = [model.ProfileIdentifierType.core,
-                model.ProfileIdentifierType.software]
+    profiles = [model.ProfileIdentifierType.CORE,
+                model.ProfileIdentifierType.SOFTWARE]
     ts = utils.mint([org_id],
                     profiles,
                     "combine_docs.py")
diff --git a/implementations/4/utils.py b/implementations/4/utils.py
index 76723ed..cbedc95 100644
--- a/implementations/4/utils.py
+++ b/implementations/4/utils.py
@@ -26,7 +26,7 @@ def created_dict(cinfo):
     # converts a CreationInfo object into a dictionary
     profiles = []
     for pro in cinfo.profile:
-        profiles.append(pro.name)
+        profiles.append(pro.name.swapcase())
     return({"specVersion": f"{cinfo.spec_version.major}.{cinfo.spec_version.minor}.{cinfo.spec_version.patch}",
             "created": cinfo.created.strftime("%Y-%m-%dT%H:%M:%SZ"),
             "createdBy": cinfo.created_by,
@@ -39,7 +39,7 @@ def dict_created(cblob):
     # converts a creationInfo dictionary into a CreationInfo object
     pl = []
     for profile in cblob["profile"]:
-        pl.append(model.ProfileIdentifierType[profile])
+        pl.append(model.ProfileIdentifierType[profile.swapcase()])
     return model.CreationInfo(spec_version=Version(cblob["specVersion"]),
                               created=datetime.strptime(
                                   cblob["created"], "%Y-%m-%dT%H:%M:%SZ"),

from spdx-3-serialization-prototype-playground.

nishakm avatar nishakm commented on July 20, 2024

Hi @Louson, these implementations are just PoCs for how the spdx-3-model would be implemented. There has already been a decision to use camelCase when serializing. I have a patch to the tools-python library where I had made the necessary changes, but I haven't submitted it yet.

from spdx-3-serialization-prototype-playground.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.