sw360 / sw360python Goto Github PK
View Code? Open in Web Editor NEWPython library for SW360 REST API access
License: Other
Python library for SW360 REST API access
License: Other
There is a new REST endpoint to update attachment info, see eclipse-sw360/sw360#1190.
So we should add an update_attachment
function.
Methods get_releases_by_name, get_all_releases, get_releases_by_external_id specify the return type list.
In cases when the SW360 returns an empty response an empty dict is returned. This breaks clients that rely on specified return type.
If you try to download a non-existing attachment, we today create a file with the JSON error messages as we ignore the HTTP status.
> sw360.download_release_attachment("test.txt", "111","222")
> cat test.txt
{"timestamp":"2023-07-30T19:42:21.815136Z","status":404,"error":"Not Found","message":"Release does not exists! id=111"}
Instead, it should raise SW360Error
as for any other failed operation, e.g.
> sw360.get_attachment("222")
---------------------------------------------------------------------------
SW360Error Traceback (most recent call last)
[...]
SW360Error: <Response [404]>
The method https://github.com/sw360/sw360python/blob/master/sw360/sw360_api.py#L449 overwrites existing project links.
A "add" flag linke here would be possible fix for that https://github.com/sw360/sw360python/blob/master/sw360/sw360_api.py#L471
Only two scenarios are covered by the API function upload_resource_attachment()
:
response.ok
does not raiseresponse.ok
raises SW360Error
If the HTTP response received for this call is 202
, the function call simply returns however the attachment has not been uploaded to the e.g. component but a moderation request has been created. Example of the received response:
HTTP status = 202
{
"message" : "Moderation request is created"
}
In that case the client should be informed about the result of the call instead of expecting that the attachment has properly been transferred.
Following line returns an error if no attachment exist
https://github.com/sw360/sw360python/blob/master/sw360/sw360_api.py#L1215
The property ["sw360:attachments"] does not exit in that case
There is a new REST endpoint to get clearing request info, see eclipse-sw360/sw360#1159
This should be added as clearingrequest
function in this library.
Have type hints and check them with Mypy.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.