FOSSology  4.5.1
Open Source License Compliance by Open Source Software
osadl_convertor.LicenseHandler Class Reference
Collaboration diagram for osadl_convertor.LicenseHandler:
Collaboration graph

Public Member Functions

def __init__ (self, str host, str port, str user, str password, str database)
 
Optional[str] get_license_type (self, str license_name)
 
bool different_type_exists (self)
 
list[Optional[str]] get_license_types (self)
 
bool license_exists (self, str license_name)
 

Private Attributes

 __conn
 

Detailed Description

Handle license information from FOSSology.

Definition at line 200 of file osadl_convertor.py.

Constructor & Destructor Documentation

◆ __init__()

def osadl_convertor.LicenseHandler.__init__ (   self,
str  host,
str  port,
str  user,
str  password,
str  database 
)
Create connection to DB.
:param host: Host of the database.
:param port: Port of the database.
:param user: User of the database.
:param password: Password of the database.
:param database: Name of the database.

Definition at line 204 of file osadl_convertor.py.

Member Function Documentation

◆ different_type_exists()

bool osadl_convertor.LicenseHandler.different_type_exists (   self)
Check if different type of licenses exists in DB.

Check if threshold of "Permissive" or None license type (default type) is
bellow 80% of the total licenses in database.
:return: True if threshold is bellow 80%, False otherwise.

Definition at line 231 of file osadl_convertor.py.

◆ get_license_type()

Optional[str] osadl_convertor.LicenseHandler.get_license_type (   self,
str  license_name 
)
Get the type of the license from DB.
:param license_name: Name of the license to get type for.
:return: Type of the license if found, None otherwise.

Definition at line 217 of file osadl_convertor.py.

◆ get_license_types()

list[Optional[str]] osadl_convertor.LicenseHandler.get_license_types (   self)
Get list of different license types from database.
:return: List of license types in DB.

Definition at line 255 of file osadl_convertor.py.

◆ license_exists()

bool osadl_convertor.LicenseHandler.license_exists (   self,
str  license_name 
)
Check if there is a license with the given name in database or not.
:param license_name: Name to check
:return: True if exists, False otherwise

Definition at line 269 of file osadl_convertor.py.


The documentation for this class was generated from the following file: