Spaces:
Build error
Build error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -7,21 +7,21 @@ from PIL import Image, ImageFilter
|
|
| 7 |
import io
|
| 8 |
import base64
|
| 9 |
from google.cloud import bigquery
|
| 10 |
-
from google.oauth2 import
|
| 11 |
import logging
|
| 12 |
from threading import Thread
|
| 13 |
from pyngrok import conf, ngrok
|
| 14 |
import requests
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
|
| 18 |
|
| 19 |
# Set the ngrok path in the configuration
|
| 20 |
-
|
| 21 |
-
|
| 22 |
|
| 23 |
# Set your ngrok auth token
|
| 24 |
-
|
| 25 |
|
| 26 |
# logging.basicConfig(level=logging.INFO)
|
| 27 |
|
|
@@ -374,7 +374,7 @@ if bundle_by == "Feature specific":
|
|
| 374 |
"CoPilot"]
|
| 375 |
fee_type_options = ["Development", "Licensing", "Logistics", "Marketing", "Packaging", "Subscription", "Transaction"]
|
| 376 |
fee_nature_options = ["Fixed %", "Flat currency", "Slab based", "As per rate card"]
|
| 377 |
-
variable_options = ["Application", "Bag", "Extension", "Integration", "Order", "Platform", "Resource", "Shipment", "User"]
|
| 378 |
chargeable_on_options = ["Active", "Build", "Cancelled", "Delivered", "DTO", "Invoiced", "Packed", "Picked", "Placed", "Return Window", "RTO", "Setup", "SiteOps-hr", "Subscribed", "TechOps-hr"]
|
| 379 |
plan_validity_options = ["One time", "Monthly", "Quarterly", "Bi-Annually", "Annually"]
|
| 380 |
payment_method_options = ["Prepaid", "Postpaid"]
|
|
@@ -383,7 +383,7 @@ if bundle_by == "Feature specific":
|
|
| 383 |
fee_config = {
|
| 384 |
'fee_type_mapping': {
|
| 385 |
"ONDC": ["Transaction", "Logistics", "Packaging"],
|
| 386 |
-
"GoFynd": ["Transaction", "Logistics", "Marketing",
|
| 387 |
"StoreOS": ["Development","Licensing", "Subscription", "Transaction", "Logistics", "Packaging", "Marketing"],
|
| 388 |
"Website": ["Development","Licensing", "Subscription", "Transaction", "Logistics", "Packaging"],
|
| 389 |
"TMS": ["Development","Licensing", "Subscription", "Logistics"],
|
|
@@ -405,7 +405,7 @@ if bundle_by == "Feature specific":
|
|
| 405 |
"Development": ["Application", "Extension", "Integration"],
|
| 406 |
"Subscription": ["Application", "Extension", "Integration", "Platform", "User", "Resource"],
|
| 407 |
"Licensing": ["Application", "Extension", "Integration"],
|
| 408 |
-
"Transaction": ["Bag", "Order", "Shipment"],
|
| 409 |
"Logistics": ["Shipment"],
|
| 410 |
"Marketing": ["Order"],
|
| 411 |
"Packaging": ["Shipment"],
|
|
@@ -423,6 +423,8 @@ if bundle_by == "Feature specific":
|
|
| 423 |
"Shipment": ["Cancelled","Picked", "RTO", "DTO", "Packed"],
|
| 424 |
"Platform": ["Subscribed"],
|
| 425 |
'Resource':["TechOps-hr", "SiteOps-hr"],
|
|
|
|
|
|
|
| 426 |
}
|
| 427 |
}
|
| 428 |
|
|
@@ -817,7 +819,7 @@ elif bundle_by == "Single value":
|
|
| 817 |
"CoPilot"]
|
| 818 |
fee_type_options = ["Development", "Licensing", "Logistics", "Marketing", "Packaging", "Subscription", "Transaction"]
|
| 819 |
fee_nature_options = ["Fixed %", "Flat currency", "Slab based", "As per rate card"]
|
| 820 |
-
variable_options = ["Application", "Bag", "Extension", "Integration", "Order", "Platform", "Resource", "Shipment", "User"]
|
| 821 |
chargeable_on_options = ["Active", "Build", "Cancelled", "Delivered", "DTO", "Invoiced", "Packed", "Picked", "Placed", "Return Window", "RTO", "Setup", "SiteOps-hr", "Subscribed", "TechOps-hr"]
|
| 822 |
plan_validity_options = ["One time", "Monthly", "Quarterly", "Bi-Annually", "Annually"]
|
| 823 |
payment_method_options = ["Prepaid", "Postpaid"]
|
|
@@ -827,7 +829,7 @@ elif bundle_by == "Single value":
|
|
| 827 |
fee_config = {
|
| 828 |
'fee_type_mapping': {
|
| 829 |
"ONDC": ["Transaction", "Logistics", "Packaging"],
|
| 830 |
-
"GoFynd": ["Transaction", "Logistics", "Marketing", "
|
| 831 |
"StoreOS": ["Development","Licensing", "Subscription", "Transaction", "Logistics", "Packaging", "Marketing"],
|
| 832 |
"Website": ["Development","Licensing", "Subscription", "Transaction", "Logistics", "Packaging"],
|
| 833 |
"TMS": ["Development","Licensing", "Subscription", "Logistics"],
|
|
@@ -849,7 +851,7 @@ elif bundle_by == "Single value":
|
|
| 849 |
"Development": ["Application", "Extension", "Integration"],
|
| 850 |
"Subscription": ["Application", "Extension", "Integration", "Platform", "User", "Resource"],
|
| 851 |
"Licensing": ["Application", "Extension", "Integration"],
|
| 852 |
-
"Transaction": ["Bag", "Order", "Shipment"],
|
| 853 |
"Logistics": ["Shipment"],
|
| 854 |
"Marketing": ["Order"],
|
| 855 |
"Packaging": ["Shipment"],
|
|
@@ -867,6 +869,8 @@ elif bundle_by == "Single value":
|
|
| 867 |
"Shipment": ["Cancelled","Picked", "RTO", "DTO", "Packed"],
|
| 868 |
"Platform": ["Subscribed"],
|
| 869 |
'Resource':["TechOps-hr", "SiteOps-hr"],
|
|
|
|
|
|
|
| 870 |
}
|
| 871 |
}
|
| 872 |
|
|
@@ -1141,8 +1145,8 @@ st.write(" ")
|
|
| 1141 |
# Start a tunnel to the correct port
|
| 1142 |
|
| 1143 |
# Connect to a port (e.g., 8501) without a custom subdomain
|
| 1144 |
-
|
| 1145 |
-
|
| 1146 |
-
|
| 1147 |
-
|
| 1148 |
-
|
|
|
|
| 7 |
import io
|
| 8 |
import base64
|
| 9 |
from google.cloud import bigquery
|
| 10 |
+
from google.oauth2 import service_accountst
|
| 11 |
import logging
|
| 12 |
from threading import Thread
|
| 13 |
from pyngrok import conf, ngrok
|
| 14 |
import requests
|
| 15 |
|
| 16 |
+
# Manually set ngrok path
|
| 17 |
+
ngrok_path = "/Users/ninadmandavkar/Desktop/ngrok/ngrok 3"
|
| 18 |
|
| 19 |
# Set the ngrok path in the configuration
|
| 20 |
+
config = conf.get_default()
|
| 21 |
+
config.ngrok_path = ngrok_path
|
| 22 |
|
| 23 |
# Set your ngrok auth token
|
| 24 |
+
ngrok.set_auth_token('2jQ6LRMBFqe25TP7o2ugti9EH6Y_3mBzBYbsjZmhh69eGq2Q1')
|
| 25 |
|
| 26 |
# logging.basicConfig(level=logging.INFO)
|
| 27 |
|
|
|
|
| 374 |
"CoPilot"]
|
| 375 |
fee_type_options = ["Development", "Licensing", "Logistics", "Marketing", "Packaging", "Subscription", "Transaction"]
|
| 376 |
fee_nature_options = ["Fixed %", "Flat currency", "Slab based", "As per rate card"]
|
| 377 |
+
variable_options = ["Application", "Bag", "Extension", "Integration", "Order", "Platform", "Resource", "Shipment", "User", "B2B", "B2C"]
|
| 378 |
chargeable_on_options = ["Active", "Build", "Cancelled", "Delivered", "DTO", "Invoiced", "Packed", "Picked", "Placed", "Return Window", "RTO", "Setup", "SiteOps-hr", "Subscribed", "TechOps-hr"]
|
| 379 |
plan_validity_options = ["One time", "Monthly", "Quarterly", "Bi-Annually", "Annually"]
|
| 380 |
payment_method_options = ["Prepaid", "Postpaid"]
|
|
|
|
| 383 |
fee_config = {
|
| 384 |
'fee_type_mapping': {
|
| 385 |
"ONDC": ["Transaction", "Logistics", "Packaging"],
|
| 386 |
+
"GoFynd": ["Transaction", "Logistics", "Marketing","Packaging"],
|
| 387 |
"StoreOS": ["Development","Licensing", "Subscription", "Transaction", "Logistics", "Packaging", "Marketing"],
|
| 388 |
"Website": ["Development","Licensing", "Subscription", "Transaction", "Logistics", "Packaging"],
|
| 389 |
"TMS": ["Development","Licensing", "Subscription", "Logistics"],
|
|
|
|
| 405 |
"Development": ["Application", "Extension", "Integration"],
|
| 406 |
"Subscription": ["Application", "Extension", "Integration", "Platform", "User", "Resource"],
|
| 407 |
"Licensing": ["Application", "Extension", "Integration"],
|
| 408 |
+
"Transaction": ["Bag", "Order", "Shipment","B2B", "B2C"],
|
| 409 |
"Logistics": ["Shipment"],
|
| 410 |
"Marketing": ["Order"],
|
| 411 |
"Packaging": ["Shipment"],
|
|
|
|
| 423 |
"Shipment": ["Cancelled","Picked", "RTO", "DTO", "Packed"],
|
| 424 |
"Platform": ["Subscribed"],
|
| 425 |
'Resource':["TechOps-hr", "SiteOps-hr"],
|
| 426 |
+
"B2B": ["Invoiced"],
|
| 427 |
+
"B2C":["Invoiced"]
|
| 428 |
}
|
| 429 |
}
|
| 430 |
|
|
|
|
| 819 |
"CoPilot"]
|
| 820 |
fee_type_options = ["Development", "Licensing", "Logistics", "Marketing", "Packaging", "Subscription", "Transaction"]
|
| 821 |
fee_nature_options = ["Fixed %", "Flat currency", "Slab based", "As per rate card"]
|
| 822 |
+
variable_options = ["Application", "Bag", "Extension", "Integration", "Order", "Platform", "Resource", "Shipment", "User", "B2B", "B2C"]
|
| 823 |
chargeable_on_options = ["Active", "Build", "Cancelled", "Delivered", "DTO", "Invoiced", "Packed", "Picked", "Placed", "Return Window", "RTO", "Setup", "SiteOps-hr", "Subscribed", "TechOps-hr"]
|
| 824 |
plan_validity_options = ["One time", "Monthly", "Quarterly", "Bi-Annually", "Annually"]
|
| 825 |
payment_method_options = ["Prepaid", "Postpaid"]
|
|
|
|
| 829 |
fee_config = {
|
| 830 |
'fee_type_mapping': {
|
| 831 |
"ONDC": ["Transaction", "Logistics", "Packaging"],
|
| 832 |
+
"GoFynd": ["Transaction", "Logistics", "Marketing", "Packaging"],
|
| 833 |
"StoreOS": ["Development","Licensing", "Subscription", "Transaction", "Logistics", "Packaging", "Marketing"],
|
| 834 |
"Website": ["Development","Licensing", "Subscription", "Transaction", "Logistics", "Packaging"],
|
| 835 |
"TMS": ["Development","Licensing", "Subscription", "Logistics"],
|
|
|
|
| 851 |
"Development": ["Application", "Extension", "Integration"],
|
| 852 |
"Subscription": ["Application", "Extension", "Integration", "Platform", "User", "Resource"],
|
| 853 |
"Licensing": ["Application", "Extension", "Integration"],
|
| 854 |
+
"Transaction": ["Bag", "Order", "Shipment","B2B", "B2C"],
|
| 855 |
"Logistics": ["Shipment"],
|
| 856 |
"Marketing": ["Order"],
|
| 857 |
"Packaging": ["Shipment"],
|
|
|
|
| 869 |
"Shipment": ["Cancelled","Picked", "RTO", "DTO", "Packed"],
|
| 870 |
"Platform": ["Subscribed"],
|
| 871 |
'Resource':["TechOps-hr", "SiteOps-hr"],
|
| 872 |
+
"B2B": ["Invoiced"],
|
| 873 |
+
"B2C":["Invoiced"]
|
| 874 |
}
|
| 875 |
}
|
| 876 |
|
|
|
|
| 1145 |
# Start a tunnel to the correct port
|
| 1146 |
|
| 1147 |
# Connect to a port (e.g., 8501) without a custom subdomain
|
| 1148 |
+
try:
|
| 1149 |
+
ngrok_tunnel = ngrok.connect(8501) # Replace 8501 with your port number
|
| 1150 |
+
print(f"ngrok tunnel URL: {ngrok_tunnel.public_url}")
|
| 1151 |
+
except Exception as e:
|
| 1152 |
+
print(f"Failed to start ngrok tunnel: {e}")
|