Zentitle SDK and Library
Modules | Files | Functions | Variables
Python Nalpeiron V10 Passive Licensing library (PSL) functions

Modules

 Nalpeiron Passive licensing error returns
 

Files

file  cpsl.py
 Nalpeiron V10 Nalpeiron Passive library licensing (PSL) functions.
 

Functions

def cpsl.PSLDefineFunctions (oset, libHandle)
 Define the Passive Licenseing library (PSL) functions from the C library. More...
 
def cpsl.pyPSLLibOpen (initXMLString)
 Initializes the Nalpeiron C library for use. More...
 
def cpsl.pyPSLLibClose ()
 Closes the Nalpeiron library after use. More...
 
def cpsl.pyPSLGetErrorMsg (nalpErrorNo)
 Get a descriptive string for nalpeiron error codes. More...
 
def cpsl.pyPSLImportLicense (licenseCode, licenseContainer)
 Import a license. More...
 
def cpsl.pyPSLValidateLibrary (custID, prodID)
 Verifies that the shared library you are accessing is the library you stamped at Nalpeiron's website. More...
 
def cpsl.pyPSLGetComputerID ()
 Gets the computer ID of the current system. More...
 
def cpsl.pyPSLGetVersion ()
 Gets the version of the NSL library being accessed. More...
 
def cpsl.pyPSLGetLeaseExpSec ()
 Retrieves the number of epoch seconds (seconds from Jan 1 1970) until the license lease expiration. More...
 
def cpsl.pyPSLGetLeaseExpDate ()
 Retrieves the expiration of the license as a time/date string (Wed Jul 17 19:59:12 2013, for example). More...
 
def cpsl.pyPSLGetMaintExpSec ()
 Retrieves the number of epoch seconds (seconds from Jan 1 1970) until the maintenance period expiration. More...
 
def cpsl.pyPSLGetMaintExpDate ()
 Retrieves the expiration of the maintenance period as a time/date string (Wed Jul 17 19:59:12 2013, for example). More...
 
def cpsl.pyPSLGetLicenseStatus ()
 Retrieves the status of the current license. More...
 
def cpsl.pyPSLGetLicenseCode ()
 Retrieves the license code used with the current license. More...
 
def cpsl.pyPSLGetNumbAvailProc ()
 A license may limit the number of simultaneous copies allowed to run on a specific computer. More...
 
def cpsl.pyPSLGetFeatureStatus (featureCode)
 Checks the current license for the status of featureName. More...
 
def cpsl.pyPSLGetUDFValue (udfName)
 Retrieve the value of a UDF (AA) More...
 

Variables

int cpsl.offset = 0
 

Detailed Description

Function Documentation

def cpsl.PSLDefineFunctions (   oset,
  libHandle 
)

Define the Passive Licenseing library (PSL) functions from the C library.

Parameters
osetSecurity offset as calculated in nalpParse.py (/ref _secOffset)
libHandlea library handle as returned by cytpes.cdll.LoadLibrary
Returns
def cpsl.pyPSLGetComputerID ( )

Gets the computer ID of the current system.

Returns
Tuple retVal, computerID
retVal = 0 If the call succeeded
retVal < 0 A negative error value is returned (Nalpeiron V10 error returns)
computerID = "" on error
computerID = string containing the computer ID
def cpsl.pyPSLGetErrorMsg (   nalpErrorNo)

Get a descriptive string for nalpeiron error codes.

Parameters
nalpErrorNois a negative return value from one of the Nalpeiron functions
Returns
Tuple retVal, errorMessage
retVal = 0 If the call succeeded
retVal < 0 A negative error value is returned (Nalpeiron V10 error returns)
errMsg a string containing the error message
NOTE does not use security offset
def cpsl.pyPSLGetFeatureStatus (   featureCode)

Checks the current license for the status of featureName.

Status if returned in featureStatus.

Parameters
featureCodea string containing the five (5) character feature code of the feature to be checked out.
Returns
Tuple retVal, featureStatus
retVal = 0 If the call succeeded
retVal < 0 A negative error value is returned (Nalpeiron V10 error returns)
featStatus.value a 32 bit int containing the feature status (FEATSTATUS)
def cpsl.pyPSLGetLeaseExpDate ( )

Retrieves the expiration of the license as a time/date string (Wed Jul 17 19:59:12 2013, for example).

Returns
Tuple retVal, expDate
retVal = 0 If the call succeeded
retVal < 0 A negative error value is returned (Nalpeiron V10 error returns)
expDate = string containing the time/date of expiration.
def cpsl.pyPSLGetLeaseExpSec ( )

Retrieves the number of epoch seconds (seconds from Jan 1 1970) until the license lease expiration.

If the item has expired, the number of seconds remaining will be zero. epochDate is the absolute expiration date in epoch sec. If epochDate = NULL then no epochDate value is retrieved.

Returns
Tuple retVal, sec, expEpoch
retVal = 0 If the call succeeded
retVal < 0 A negative error value is returned (Nalpeiron V10 error returns)
sec.value = unsigned 32 bit integer representing the seconds until expiration expEpoch.value = unsigned 32 bit integer containing the epoch time of expiration
def cpsl.pyPSLGetLicenseCode ( )

Retrieves the license code used with the current license.

NOTE: a license code will only be present if one has already been assigned to the current license via NSLGetLicense, NSLImportCert, etc.

Returns
Tuple retVal, licenseCode
retVal = 0 If the call succeeded
retVal < 0 A negative error value is returned (Nalpeiron V10 error returns)
licenseCode = a string containing the license code
def cpsl.pyPSLGetLicenseStatus ( )

Retrieves the status of the current license.

Negative values indicate an invalid license state.

Returns
Tuple retVal, licStat
retVal = 0 If the call succeeded
retVal < 0 A negative error value is returned (Nalpeiron V10 error returns)
licStat.value = a 32 bit integer containing the license status (License status values)
def cpsl.pyPSLGetMaintExpDate ( )

Retrieves the expiration of the maintenance period as a time/date string (Wed Jul 17 19:59:12 2013, for example).

Returns
Tuple retVal, expDate
retVal = 0 If the call succeeded
retVal < 0 A negative error value is returned (Nalpeiron V10 error returns)
expDate = string containing the time/date of expiration.
def cpsl.pyPSLGetMaintExpSec ( )

Retrieves the number of epoch seconds (seconds from Jan 1 1970) until the maintenance period expiration.

If the item has expired, the number of seconds remaining will be zero. epochDate is the absolute expiration date in epoch sec. If epochDate = NULL then no epochDate value is retrieved.

Returns
Tuple retVal, sec, expEpoch
retVal = 0 If the call succeeded
retVal < 0 A negative error value is returned (Nalpeiron V10 error returns)
sec.value = unsigned 32 bit integer representing the seconds until expiration expEpoch.value = unsigned 32 bit integer containing the epoch time of expiration
def cpsl.pyPSLGetNumbAvailProc ( )

A license may limit the number of simultaneous copies allowed to run on a specific computer.

This limit is disabled by default and, if desired, must be enabled on the Nalpeiron server. The number of copies available is set to noProcs+1 and availProc is the number of copies still available for use. When an application instance is started and returns availProc=0, the number of instances exceeds the maximum allowed and this instance should be terminated.

When disabled, this fuction will always return zero (0) as noProcs and one (1) as the number of availProc. NOTE limiting the number of processes allowed on a machine ("Number of concurrent Processes" setting on server) is not affected by the "Concurrency Mode" setting.

Returns
Tuple retVal, maxProc, availProc
retVal = 0 If the call succeeded
retVal < 0 A negative error value is returned (Nalpeiron V10 error returns)
maxProc.value a unsigned 32 bit int containing max number of proc allowed to run availProc.value a unsigned 32 bit int containing number of proc still available
def cpsl.pyPSLGetUDFValue (   udfName)

Retrieve the value of a UDF (AA)

Parameters
udfNamea string containing the five (5) character UDF code of the value to be accessed
Returns
Tuple retVal, udfValue
retVal = 0 If the call succeeded
retVal < 0 A negative error value is returned (Nalpeiron V10 error returns)
uValue a string containing the UDF value
def cpsl.pyPSLGetVersion ( )

Gets the version of the NSL library being accessed.

Returns
Tuple retVal, version
retVal = 0 If the call succeeded
retVal < 0 A negative error value is returned (Nalpeiron V10 error returns)
version = "" on error
version = string containing the library version on success
def cpsl.pyPSLImportLicense (   licenseCode,
  licenseContainer 
)

Import a license.

Parameters
licenseCodecontains the current license code. licenseCode should be freed with PSLFree.
licenseContainerEither the license itself passed in as a NULL terminated string or the full path to a file containing the license.
Returns
Tuple retVal, version
retVal = 0 If the call succeeded
retVal < 0 A negative error value is returned (Nalpeiron V10 error returns)
licStat a 32 bit integer containing the license status version = string containing the library version on success
def cpsl.pyPSLLibClose ( )

Closes the Nalpeiron library after use.

Returns
< 0 a negative error value is returned (Nalpeiron V10 error returns)
def cpsl.pyPSLLibOpen (   initXMLString)

Initializes the Nalpeiron C library for use.

See parameter details in nalpparse.py

Parameters
initXMLStringa valid XML string containing initialization parameters (see nalpparse.py for details)
Returns
< 0 a negative error value is returned (Nalpeiron V10 error returns)
def cpsl.pyPSLValidateLibrary (   custID,
  prodID 
)

Verifies that the shared library you are accessing is the library you stamped at Nalpeiron's website.

It does this by checking the customerID and productID sent in against the stamped values. Any negative return value, even if it is not a known error code, is cause to consider the library invalid.

Parameters
custIDa unsigned 32 bit integer containing your Nalpeiron customer ID. NOTE the library uses ONLY the last 5 non-zero digits of your full customer ID. That is, if your customer ID is 12340005678 then the customer ID used in conjuction with the library would be 5678.
prodIDa unsigned 32 bit integer containing your Nalpeiron product ID. NOTE the library uses ONLY the last 5 non-zero digits of your full product ID. That is, if your customer ID is 12340005678 then the product ID used in conjuction with the library would be 5678.
Returns
= 0(zero) is returned if the customerID/productID passed into the function match those from the library.
< 0 On mismatch, a negative error value is returned (Nalpeiron V10 error returns)

Variable Documentation

int cpsl.offset = 0