Ninad077 commited on
Commit
73d17ea
·
verified ·
1 Parent(s): 5f1a4fe

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -16
app.py CHANGED
@@ -14,14 +14,14 @@ 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
 
@@ -751,11 +751,7 @@ if bundle_by == "Feature specific":
751
  usage_2 = float(usage_1)
752
  usage_3 = "{:.2f}".format(usage_2)
753
 
754
- Capping_or_Minimum_Guarantee_1 = st.number_input(f"Threshold value for {selected_variable_type}", min_value=0.0,
755
- help="Enter the Capping/Minimum Gauarntee value")
756
- Capping_or_Minimum_Guarantee_2 = float(Capping_or_Minimum_Guarantee_1)
757
- Capping_or_Minimum_Guarantee_3 = "{:.2f}".format(Capping_or_Minimum_Guarantee_2)
758
-
759
 
760
  Product_1 = usage_1 * user_input_1 if selected_fee_nature in ["Fixed %", "Flat currency"] else 0
761
  Product_2 = float(Product_1)
@@ -765,6 +761,12 @@ if bundle_by == "Feature specific":
765
  abc = ['Capping value', 'Minimum Guarantee']
766
  threshold = st.selectbox("Threshold option:", [""] + abc, help = "If Minimum guarantee is set as threshold option then Expected billing will be the higher value b/w 'Commercial*Usage' & 'Threshold' and if it is set to Capping then Expected billing will be the lower value b/w 'Commercial*Usage' & 'Threshold'")
767
 
 
 
 
 
 
 
768
  initial_expected_billing = Product_1
769
  expected_billing = None
770
 
@@ -786,7 +788,7 @@ if bundle_by == "Feature specific":
786
  -webkit-background-clip: text;
787
  text-fill-color: transparent;
788
  -webkit-text-fill-color: transparent;
789
- '>Expected Billing (excluding GST): {expected_billing}</h1>
790
  """
791
 
792
  # Using Streamlit to display the HTML content
@@ -1327,7 +1329,7 @@ elif bundle_by == "Single value":
1327
  -webkit-background-clip: text;
1328
  text-fill-color: transparent;
1329
  -webkit-text-fill-color: transparent;
1330
- '>Expected Billing (excluding GST): {expected_billing}</h1>
1331
  """
1332
 
1333
  # Using Streamlit to display the HTML content
@@ -1560,8 +1562,8 @@ st.write(" ")
1560
  # Start a tunnel to the correct port
1561
 
1562
  # Connect to a port (e.g., 8501) without a custom subdomain
1563
- # try:
1564
- # ngrok_tunnel = ngrok.connect(8501) # Replace 8501 with your port number
1565
- # print(f"ngrok tunnel URL: {ngrok_tunnel.public_url}")
1566
- # except Exception as e:
1567
- # print(f"Failed to start ngrok tunnel: {e}")
 
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
 
 
751
  usage_2 = float(usage_1)
752
  usage_3 = "{:.2f}".format(usage_2)
753
 
754
+
 
 
 
 
755
 
756
  Product_1 = usage_1 * user_input_1 if selected_fee_nature in ["Fixed %", "Flat currency"] else 0
757
  Product_2 = float(Product_1)
 
761
  abc = ['Capping value', 'Minimum Guarantee']
762
  threshold = st.selectbox("Threshold option:", [""] + abc, help = "If Minimum guarantee is set as threshold option then Expected billing will be the higher value b/w 'Commercial*Usage' & 'Threshold' and if it is set to Capping then Expected billing will be the lower value b/w 'Commercial*Usage' & 'Threshold'")
763
 
764
+ Capping_or_Minimum_Guarantee_1 = st.number_input(f"Threshold value for {selected_variable_type}", min_value=0.0,
765
+ help="Enter the Capping/Minimum Gauarntee value")
766
+ Capping_or_Minimum_Guarantee_2 = float(Capping_or_Minimum_Guarantee_1)
767
+ Capping_or_Minimum_Guarantee_3 = "{:.2f}".format(Capping_or_Minimum_Guarantee_2)
768
+
769
+
770
  initial_expected_billing = Product_1
771
  expected_billing = None
772
 
 
788
  -webkit-background-clip: text;
789
  text-fill-color: transparent;
790
  -webkit-text-fill-color: transparent;
791
+ '>Expected Monthly Billing (excluding GST): {expected_billing}</h1>
792
  """
793
 
794
  # Using Streamlit to display the HTML content
 
1329
  -webkit-background-clip: text;
1330
  text-fill-color: transparent;
1331
  -webkit-text-fill-color: transparent;
1332
+ '>Expected Monthly Billing (excluding GST): {expected_billing}</h1>
1333
  """
1334
 
1335
  # Using Streamlit to display the HTML content
 
1562
  # Start a tunnel to the correct port
1563
 
1564
  # Connect to a port (e.g., 8501) without a custom subdomain
1565
+ try:
1566
+ ngrok_tunnel = ngrok.connect(8501) # Replace 8501 with your port number
1567
+ print(f"ngrok tunnel URL: {ngrok_tunnel.public_url}")
1568
+ except Exception as e:
1569
+ print(f"Failed to start ngrok tunnel: {e}")