Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -21,12 +21,20 @@ encoder = handtool.create_encoder(config)
|
|
21 |
machineCode = encoder.getMachineCode()
|
22 |
print("\nmachineCode: ", machineCode.decode('utf-8'))
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
print("
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
ret = encoder.setActivation(license.encode('utf-8'))
|
32 |
print("\nactivation: ", ret)
|
|
|
21 |
machineCode = encoder.getMachineCode()
|
22 |
print("\nmachineCode: ", machineCode.decode('utf-8'))
|
23 |
|
24 |
+
# Get a specific environment variable by name
|
25 |
+
license = os.environ.get("LICENSE")
|
26 |
+
|
27 |
+
# Check if the variable exists
|
28 |
+
if license is not None:
|
29 |
+
print("Value of LICENSE:")
|
30 |
+
else:
|
31 |
+
license = ""
|
32 |
+
try:
|
33 |
+
with open(licensePath, 'r') as file:
|
34 |
+
license = file.read().strip()
|
35 |
+
except IOError as exc:
|
36 |
+
print("failed to open license.txt: ", exc.errno)
|
37 |
+
print("license: ", license)
|
38 |
|
39 |
ret = encoder.setActivation(license.encode('utf-8'))
|
40 |
print("\nactivation: ", ret)
|