Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,14 +14,15 @@ from opyalpr import initSDK
|
|
| 14 |
from opyalpr import processImage
|
| 15 |
|
| 16 |
licenseKeyPath = "license.txt"
|
| 17 |
-
license = ""
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
print("
|
|
|
|
| 25 |
|
| 26 |
hwid = getHWID()
|
| 27 |
print("HWID: ", hwid.decode('utf-8'))
|
|
|
|
| 14 |
from opyalpr import processImage
|
| 15 |
|
| 16 |
licenseKeyPath = "license.txt"
|
| 17 |
+
license = os.environ.get("LICENSE_KEY")
|
| 18 |
+
|
| 19 |
+
if license is None:
|
| 20 |
+
try:
|
| 21 |
+
with open(licenseKeyPath, 'r') as file:
|
| 22 |
+
license = file.read().strip()
|
| 23 |
+
except IOError as exc:
|
| 24 |
+
print("failed to open license.txt: ", exc.errno)
|
| 25 |
+
print("License Key: ", license)
|
| 26 |
|
| 27 |
hwid = getHWID()
|
| 28 |
print("HWID: ", hwid.decode('utf-8'))
|