ran black

This commit is contained in:
Ben Arc
2021-07-03 15:01:16 +01:00
parent 8619da29cf
commit 483c4b6586
2 changed files with 10 additions and 8 deletions

View File

@@ -7,4 +7,4 @@ ngrok_ext: Blueprint = Blueprint(
"ngrok", __name__, static_folder="static", template_folder="templates"
)
from .views import * # noqa
from .views import * # noqa

View File

@@ -5,27 +5,29 @@ from lnbits.decorators import check_user_exists, validate_uuids
from pyngrok import conf, ngrok
from . import ngrok_ext
def log_event_callback(log):
string = str(log)
string2 = string[string.find('url="https'):string.find('url="https')+40]
string2 = string[string.find('url="https') : string.find('url="https') + 40]
if string2:
string3 = string2
string4 = string3[4:]
global string5
string5 = string4.replace( '"', '' )
string5 = string4.replace('"', "")
conf.get_default().log_event_callback = log_event_callback
ngrok_tunnel = ngrok.connect(5000)
@ngrok_ext.route("/")
@validate_uuids(["usr"], required=True)
@check_user_exists()
async def index():
# row = await db.fetchone("SELECT * FROM ngrok")
# row = await db.fetchone("SELECT * FROM ngrok")
# return row
# return "Access and use your lnbits instance here: " + string5
# return Ngrok.from_row(row) if row else None
# return row
# return "Access and use your lnbits instance here: " + string5
# return Ngrok.from_row(row) if row else None
return await render_template("ngrok/index.html", ngrok=string5)