File tree Expand file tree Collapse file tree
aboutcode/federatedcode/contrib/django Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #
2+ # Copyright (c) nexB Inc. and others. All rights reserved.
3+ # FederatedCode is a trademark of nexB Inc.
4+ # SPDX-License-Identifier: Apache-2.0
5+ # See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
6+ # See https://github.com/nexB/federatedcode for support or download.
7+ # See https://aboutcode.org for more information about AboutCode.org OSS projects.
8+ #
9+
10+
11+ import saneyaml
12+
13+
14+ def get_package_activity_type (activity : dict ) -> str :
15+ return activity .get ("type" )
16+
17+
18+ def get_package_activity_object (activity : dict ) -> dict :
19+ return activity .get ("object" )
20+
21+
22+ def get_package_activity_author (activity : dict ) -> str :
23+ activity_object = get_package_activity_object (activity )
24+ return activity_object .get ("author" )
25+
26+
27+ def get_package_activity_content (activity : dict ) -> dict :
28+ activity_object = get_package_activity_object (activity )
29+ content = activity_object .get ("content" )
30+ return saneyaml .load (content )
31+
32+
33+ def get_package_activity_update_date (activity : dict ) -> str :
34+ activity_object = get_package_activity_object (activity )
35+ return activity_object .get ("update_date" )
You can’t perform that action at this time.
0 commit comments