@@ -109,6 +109,30 @@ def SetFloatingClientMetadata(key, value):
109
109
cstring_key , cstring_value )
110
110
if LexFloatStatusCodes .LF_OK != status :
111
111
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 )
112
136
113
137
@staticmethod
114
138
def GetFloatingClientLibraryVersion ():
@@ -351,26 +375,16 @@ def RequestFloatingLicense():
351
375
raise LexFloatClientException (status )
352
376
353
377
@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
+
360
381
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.
369
383
370
384
Raises:
371
385
LexFloatClientException
372
386
"""
373
- status = LexFloatClientNative .SetPermissionFlag ( flag )
387
+ status = LexFloatClientNative .RequestOfflineFloatingLicense ( lease_duration )
374
388
if LexFloatStatusCodes .LF_OK != status :
375
389
raise LexFloatClientException (status )
376
390
0 commit comments