@@ -109,6 +109,30 @@ def SetFloatingClientMetadata(key, value):
109109 cstring_key , cstring_value )
110110 if LexFloatStatusCodes .LF_OK != status :
111111 raise LexFloatClientException (status )
112+
113+ @staticmethod
114+ def SetPermissionFlag (flag ):
115+ """Sets the permission flag.
116+
117+ This function must be called on every start of your program after SetHostProductId()
118+ function in case the application allows borrowing of licenses or system wide activation.
119+
120+ Args:
121+ flags : depending on your application's requirements, choose one of
122+ the following values: LF_USER, LF_ALL_USERS.
123+
124+ LF_USER: This flag indicates that the application does not require
125+ admin or root permissions to run.
126+
127+ LF_ALL_USERS: This flag is specifically designed for Windows and should be used
128+ for system-wide activations.
129+
130+ Raises:
131+ LexFloatClientException
132+ """
133+ status = LexFloatClientNative .SetPermissionFlag (flag )
134+ if LexFloatStatusCodes .LF_OK != status :
135+ raise LexFloatClientException (status )
112136
113137 @staticmethod
114138 def GetFloatingClientLibraryVersion ():
@@ -351,26 +375,16 @@ def RequestFloatingLicense():
351375 raise LexFloatClientException (status )
352376
353377 @staticmethod
354- def SetPermissionFlag (flag ):
355- """Sets the permission flag.
356-
357- This function must be called on every start of your program after SetHostProductId()
358- function in case the application allows borrowing of licenses or system wide activation.
359-
378+ def RequestOfflineFloatingLicense (lease_duration ):
379+ """Sends the request to lease the license from the LexFloatServer for offline usage.
380+
360381 Args:
361- flags : depending on your application's requirements, choose one of
362- the following values: LF_USER, LF_ALL_USERS.
363-
364- LF_USER: This flag indicates that the application does not require
365- admin or root permissions to run.
366-
367- LF_ALL_USERS: This flag is specifically designed for Windows and should be used
368- for system-wide activations.
382+ leaseDuration (int): seconds for which the lease should be obtained.
369383
370384 Raises:
371385 LexFloatClientException
372386 """
373- status = LexFloatClientNative .SetPermissionFlag ( flag )
387+ status = LexFloatClientNative .RequestOfflineFloatingLicense ( lease_duration )
374388 if LexFloatStatusCodes .LF_OK != status :
375389 raise LexFloatClientException (status )
376390
0 commit comments