Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,20 +2,18 @@ import os
|
|
| 2 |
import sys
|
| 3 |
import time
|
| 4 |
import io
|
|
|
|
| 5 |
from utils import print_with_line_number
|
| 6 |
|
| 7 |
# Add the parent directory to the Python path
|
| 8 |
parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
| 9 |
sys.path.append(parent_dir)
|
| 10 |
|
| 11 |
-
print_with_line_number(os.environ.get("SERVICE_EMAIL"))
|
| 12 |
-
print_with_line_number(os.environ.get("SERVICE_JSON"))
|
| 13 |
-
|
| 14 |
-
|
| 15 |
import ee
|
| 16 |
# Add Google Service account credential. Authenticates to the Earth Engine servers.
|
| 17 |
-
service_account =
|
| 18 |
-
|
|
|
|
| 19 |
|
| 20 |
import math
|
| 21 |
from shiny import App, render, ui, reactive, Inputs, Outputs, Session
|
|
|
|
| 2 |
import sys
|
| 3 |
import time
|
| 4 |
import io
|
| 5 |
+
import json
|
| 6 |
from utils import print_with_line_number
|
| 7 |
|
| 8 |
# Add the parent directory to the Python path
|
| 9 |
parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
| 10 |
sys.path.append(parent_dir)
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
import ee
|
| 13 |
# Add Google Service account credential. Authenticates to the Earth Engine servers.
|
| 14 |
+
service_account = os.environ.get("SERVICE_EMAIL")
|
| 15 |
+
key_dict = json.loads(os.environ.get("SERVICE_JSON"))
|
| 16 |
+
credentials = ee.ServiceAccountCredentials(service_account, key_data=key_dict)
|
| 17 |
|
| 18 |
import math
|
| 19 |
from shiny import App, render, ui, reactive, Inputs, Outputs, Session
|