Exemplo n.º 1
0
 def __init__(
     oSelf,
     s0LicensesIsInvalidForReason,
     oNextCheckWithServerDate,
     bLicenseMayNeedToBeUpdated,
     b0InLicensePeriod,
     s0LicenseIsRevokedForReason,
     b0DeactivatedOnSystem,
     b0LicenseInstancesExceeded,
 ):
     if f0AssertTypes:
         f0AssertTypes({
             "s0LicensesIsInvalidForReason":
             (s0LicensesIsInvalidForReason, str, None),
             "bLicenseMayNeedToBeUpdated":
             (bLicenseMayNeedToBeUpdated, bool),
             "b0InLicensePeriod": (b0InLicensePeriod, bool, None),
             "s0LicenseIsRevokedForReason":
             (s0LicenseIsRevokedForReason, str, None),
             "b0DeactivatedOnSystem": (b0DeactivatedOnSystem, bool, None),
             "b0LicenseInstancesExceeded":
             (b0LicenseInstancesExceeded, bool, None),
             "oNextCheckWithServerDate": (oNextCheckWithServerDate, cDate),
         })
     oSelf.s0LicensesIsInvalidForReason = s0LicensesIsInvalidForReason
     oSelf.bLicenseMayNeedToBeUpdated = bLicenseMayNeedToBeUpdated
     oSelf.b0InLicensePeriod = b0InLicensePeriod
     oSelf.s0LicenseIsRevokedForReason = s0LicenseIsRevokedForReason
     oSelf.b0DeactivatedOnSystem = b0DeactivatedOnSystem
     oSelf.b0LicenseInstancesExceeded = b0LicenseInstancesExceeded
     oSelf.oNextCheckWithServerDate = oNextCheckWithServerDate
Exemplo n.º 2
0
 def foConstructFromJSONData(cClass,
                             xJSONData,
                             sDataNameInError,
                             s0BasePath=None,
                             dxInheritingValues={}):
     dxInheritingValues = dxInheritingValues.copy()
     for sValueName in cClass.dxInheritingValues:
         if sValueName not in dxInheritingValues:
             dxInheritingValues[sValueName] = cClass.dxInheritingValues[
                 sValueName]
     if f0AssertTypes:
         f0AssertTypes({
             "sDataNameInError": (sDataNameInError, str),
             "s0BasePath": (s0BasePath, str, None),
             "dxInheritingValues": (dxInheritingValues, dict),
         })
     return fxConvertFromJSONData(
         xStructureDetails=(
             cClass.oDataStructure,
             cClass.toCompatibleDataStructures,
         ),
         xJSONData=xJSONData,
         sDataNameInError=sDataNameInError,
         s0BasePath=s0BasePath,
         dxInheritingValues=dxInheritingValues,
     )
Exemplo n.º 3
0
 def fxConvertFromJSONData(oSelf,
                           xJSONData,
                           sDataNameInError,
                           s0BasePath=None,
                           dxInheritingValues={}):
     if f0AssertTypes:
         f0AssertTypes({
             "sDataNameInError": (sDataNameInError, str),
             "s0BasePath": (s0BasePath, str, None),
             "dxInheritingValues": (dxInheritingValues, dict),
         })
     xData = fxConvertFromJSONData(oSelf.xStructureDetails, xJSONData,
                                   sDataNameInError, s0BasePath,
                                   dxInheritingValues)
     if oSelf.f0oConstructor:
         try:
             xData = oSelf.f0oConstructor(**xData)
         except Exception as oException:
             oPyCode = oSelf.f0oConstructor.__code__
             oException.args = tuple([
                 "%s in %s line number %d" %
                 (oException.args[0], oPyCode.co_filename,
                  oPyCode.co_firstlineno)
             ] + list(oException.args)[1:])
             raise
     return xData
Exemplo n.º 4
0
 def __init__(oSelf,
   sProductName,
   oProductVersion,
   sProductAuthor,
   asProductTypes,
   s0PythonModuleName = None,
   a0sPythonApplicationNames = None,
   a0sJavaScriptModuleNames = None,
   a0sPHPModuleNames = None,
   sb0ProductURL = None,
   o0TrialPeriodDuration = None,
   sb0LicenseServerURL = None,
   o0Repository = None,
   a0sDependentOnProductNames = None,
   a0sReleaseAdditionalProductNames = None,
   a0sDebugAdditionalProductNames = None,
 ):
   if f0AssertTypes: f0AssertTypes({
     "sProductName": (sProductName, str),
     "oProductVersion": (oProductVersion, cVersion),
     "sProductAuthor": (sProductAuthor, str),
     "asProductTypes": (asProductTypes, [str]),
     "s0PythonModuleName": (s0PythonModuleName, str if "Python module" in asProductTypes else None),
     "a0sPythonApplicationNames": (a0sPythonApplicationNames, [str] if "Python application" in asProductTypes else None),
     "a0sJavaScriptModuleNames": (a0sJavaScriptModuleNames, [str] if "JavaScript module" in asProductTypes else None),
     "a0sPHPModuleNames": (a0sPHPModuleNames, [str]if "PHP module" in asProductTypes else None),
     "sb0ProductURL": (sb0ProductURL, bytes, None),
     "o0TrialPeriodDuration": (o0TrialPeriodDuration, cDateDuration, None),
     "sb0LicenseServerURL": (sb0LicenseServerURL, bytes, None),
     "o0Repository": (o0Repository, iRepository, None),
     "a0sDependentOnProductNames": (a0sDependentOnProductNames, [str], None),
     "a0sReleaseAdditionalProductNames": (a0sReleaseAdditionalProductNames, [str], None),
     "a0sDebugAdditionalProductNames": (a0sDebugAdditionalProductNames, [str], None),
   });
   oSelf.sProductName = sProductName;
   oSelf.oProductVersion = oProductVersion;
   oSelf.sProductAuthor = sProductAuthor;
   oSelf.asProductTypes = asProductTypes;
   oSelf.s0PythonModuleName = s0PythonModuleName;
   oSelf.a0sPythonApplicationNames = a0sPythonApplicationNames and sorted(a0sPythonApplicationNames);
   oSelf.a0sJavaScriptModuleNames = a0sJavaScriptModuleNames and sorted(a0sJavaScriptModuleNames)
   oSelf.a0sPHPModuleNames = a0sPHPModuleNames and sorted(a0sPHPModuleNames);
   oSelf.sb0ProductURL = sb0ProductURL;
   oSelf.o0TrialPeriodDuration = o0TrialPeriodDuration;
   oSelf.sb0LicenseServerURL = sb0LicenseServerURL;
   oSelf.o0Repository = o0Repository;
   oSelf.a0sDependentOnProductNames = a0sDependentOnProductNames and sorted(a0sDependentOnProductNames);
   oSelf.a0sReleaseAdditionalProductNames = a0sReleaseAdditionalProductNames and sorted(a0sReleaseAdditionalProductNames);
   oSelf.a0sDebugAdditionalProductNames = a0sDebugAdditionalProductNames and sorted(a0sDebugAdditionalProductNames);
   
   oSelf.s0InstallationFolderPath = None;
   oSelf.__o0License = None;
   oSelf.__o0LatestProductDetailsFromRepository = None;
   oSelf.__bCheckedWithServer = False;
Exemplo n.º 5
0
 def fxConvertToJSONData(oSelf,
                         oData,
                         sDataNameInError,
                         s0BasePath=None,
                         dxInheritingValues={}):
     if f0AssertTypes:
         f0AssertTypes({
             "sDataNameInError": (sDataNameInError, str),
             "s0BasePath": (s0BasePath, str, None),
             "dxInheritingValues": (dxInheritingValues, dict),
         })
     assert oSelf.f0oConstructor, \
         "This function is only intended to be used for objects"
     return fxConvertToJSONData(oSelf.xStructureDetails, oData,
                                sDataNameInError, s0BasePath,
                                dxInheritingValues)
Exemplo n.º 6
0
 def fsbConvertToJSON(oSelf,
                      oData,
                      sDataNameInError,
                      s0BasePath=None,
                      dxInheritingValues={}):
     if f0AssertTypes:
         f0AssertTypes({
             "sDataNameInError": (sDataNameInError, str),
             "s0BasePath": (s0BasePath, str, None),
             "dxInheritingValues": (dxInheritingValues, dict),
         })
     xJSONData = oSelf.fxConvertToJSONData(oData, sDataNameInError,
                                           s0BasePath, dxInheritingValues)
     sJSONData = json.dumps(xJSONData, sort_keys=True,
                            indent=2).replace("\n", "\r\n")
     # We're on Windows
     return bytes(sJSONData, "ascii", "strict")
Exemplo n.º 7
0
 def fsbConvertToJSONString(oSelf,
                            sDataNameInError,
                            s0BasePath=None,
                            dxInheritingValues={}):
     # dxInheritingValues needs to be updated with cClass.dxInheritingValues but this
     # will be done in a call to oSelf.fxConvertToJSONData later
     if f0AssertTypes:
         f0AssertTypes({
             "sDataNameInError": (sDataNameInError, str),
             "s0BasePath": (s0BasePath, str, None),
             "dxInheritingValues": (dxInheritingValues, dict),
         })
     xJSONData = oSelf.fxConvertToJSONData(sDataNameInError, s0BasePath,
                                           dxInheritingValues)
     sJSON = json.dumps(xJSONData, sort_keys=True,
                        indent=2).replace("\n", "\r\n")
     # We're on Windows
     return bytes(sJSON, "ascii", "strict")
Exemplo n.º 8
0
 def fxConvertFromJSONString(oSelf,
                             sbJSONData,
                             sDataNameInError,
                             s0BasePath=None,
                             dxInheritingValues={}):
     if f0AssertTypes:
         f0AssertTypes({
             "sbJSONData": (sbJSONData, bytes),
             "sDataNameInError": (sDataNameInError, str),
             "s0BasePath": (s0BasePath, str, None),
             "dxInheritingValues": (dxInheritingValues, dict),
         })
     try:
         xJSONData = json.loads(sbJSONData)
     except:
         raise cJSONDataSyntaxException("%s does not contain valid JSON" %
                                        sDataNameInError)
     xData = oSelf.fxConvertFromJSONData(xJSONData, sDataNameInError,
                                         s0BasePath, dxInheritingValues)
     return xData
Exemplo n.º 9
0
 def foConstructFromJSONString(cClass,
                               sbJSON,
                               sDataNameInError,
                               s0BasePath=None,
                               dxInheritingValues={}):
     # dxInheritingValues needs to be updated with cClass.dxInheritingValues but this
     # will be done in a call to cClass.foConstructFromJSONData later
     if f0AssertTypes:
         f0AssertTypes({
             "sbJSON": (sbJSON, bytes),
             "sDataNameInError": (sDataNameInError, str),
             "s0BasePath": (s0BasePath, str, None),
             "dxInheritingValues": (dxInheritingValues, dict),
         })
     try:
         xJSONData = json.loads(sbJSON)
     except:
         raise cJSONDataSyntaxException("%s does not contain valid JSON" %
                                        sDataNameInError)
     return cClass.foConstructFromJSONData(xJSONData, sDataNameInError,
                                           s0BasePath, dxInheritingValues)
Exemplo n.º 10
0
 def fxConvertToJSONData(oSelf,
                         sDataNameInError,
                         s0BasePath=None,
                         dxInheritingValues={}):
     dxInheritingValues = dxInheritingValues.copy()
     for sValueName in oSelf.__class__.dxInheritingValues:
         if sValueName not in dxInheritingValues:
             dxInheritingValues[
                 sValueName] = oSelf.__class__.dxInheritingValues[
                     sValueName]
     if f0AssertTypes:
         f0AssertTypes({
             "sDataNameInError": (sDataNameInError, str),
             "s0BasePath": (s0BasePath, str, None),
             "dxInheritingValues": (dxInheritingValues, dict),
         })
     return fxConvertToJSONData(
         xStructureDetails=oSelf.__class__.oDataStructure,
         xData=oSelf,
         sDataNameInError=sDataNameInError,
         s0BasePath=s0BasePath,
         dxInheritingValues=dxInheritingValues,
     )