这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from flask import Flask
from flask import request, jsonify, abort

app = Flask(__name__)


Expand All @@ -24,6 +25,7 @@ def get_details_for_token(token):
def hello():
return 'webhook is running'


@app.route('/auth-webhook')
def auth_webhook():
# get the auth token from Authorization header
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json


def lambda_handler(event, context):
try:
body = json.loads(event['body'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
}
"""


def lambda_handler(event, context):
try:
body = json.loads(event['body'])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from flask import jsonify


def function(request):
request_json = request.get_json()
op = request_json['event']['op']
Expand Down
3 changes: 1 addition & 2 deletions docs/_ext/lexer_jsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from pygments.lexers.javascript import JavascriptLexer
from pygments.token import Name, Operator, Punctuation, String, Text


# Use same tokens as `JavascriptLexer`, but with tags and attributes support
TOKENS = JavascriptLexer.tokens
TOKENS.update({
Expand All @@ -26,7 +25,7 @@
('{', Punctuation, 'expression'),
('".*?"', String, '#pop'),
("'.*?'", String, '#pop'),
default ('#pop')
default('#pop')
],
'expression': [
('{', Punctuation, '#push'),
Expand Down
4 changes: 2 additions & 2 deletions docs/_ext/local_toctree.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
the maximum depth of the tree; set it to -1 to allow unlimited depth
"""

def init_local_toctree(app):

def init_local_toctree(app):
def _get_local_toctree(docname, **kwds):
doctree = app.env.get_doctree(docname)
if 'maxdepth' not in kwds:
kwds['maxdepth'] = 0
toctrees = []
for toctreenode in doctree.traverse(addnodes.toctree):
toctree = app.env.resolve_toctree(
docname, app.builder, toctreenode, **kwds)
docname, app.builder, toctreenode, **kwds)
toctrees.append(toctree)
if not toctrees:
return None
Expand Down
4 changes: 3 additions & 1 deletion docs/algolia_index/algolia_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def output_indexed_data():

print('\nTOTAL INDEXED: ' + str(count))


def process_data(json_data):
processed_data = []

Expand All @@ -44,7 +45,8 @@ def process_data(json_data):
else:
obj = json.loads(json.dumps(json_obj))

split_content = [obj['content'][i:i + CONTENT_MAX_LENGTH] for i in range(0, len(obj['content']), CONTENT_MAX_LENGTH)]
split_content = [obj['content'][i:i + CONTENT_MAX_LENGTH] for i in
range(0, len(obj['content']), CONTENT_MAX_LENGTH)]

for content_piece in split_content:
obj = json.loads(json.dumps(json_obj))
Expand Down
32 changes: 16 additions & 16 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
import os
import sys
from os.path import abspath, dirname, join

sys.setrecursionlimit(2000)

# Monkey patching StandaloneHTMLBuilder as to not include unnecessary scripts

from sphinx.builders.html import StandaloneHTMLBuilder

# from sphinx.util.osutil import relative_uri
StandaloneHTMLBuilder.script_files = ["_static/vendor.js"]
# StandaloneHTMLBuilder.imgpath = relative_uri("v0.13", '_images')
Expand Down Expand Up @@ -138,7 +140,7 @@
# The full version, including alpha/beta/rc tags.
release = 'x.y'

#epilog rst lines for frequently reference links in docs
# epilog rst lines for frequently reference links in docs
rst_epilog = """
"""

Expand Down Expand Up @@ -185,7 +187,6 @@
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'


# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []

Expand All @@ -195,7 +196,6 @@
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True


# -- Options for HTML output ----------------------------------------------
# import sphinx_rtd_theme
# html_theme = "sphinx_rtd_theme"
Expand All @@ -205,7 +205,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
#html_theme = 'alabaster'
# html_theme = 'alabaster'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down Expand Up @@ -325,21 +325,21 @@
# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
Expand Down
4 changes: 3 additions & 1 deletion server/tests-py/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import time
from context import HGECtx, HGECtxError


def pytest_addoption(parser):
parser.addoption(
"--hge-url", metavar="HGE_URL", help="url for graphql-engine", required=True
Expand All @@ -23,9 +24,10 @@ def pytest_addoption(parser):
"--hge-jwt-key-file", metavar="HGE_JWT_KEY_FILE", help="File containting the private key used to encode jwt tokens using RS512 algorithm", required=False
)


@pytest.fixture(scope='session')
def hge_ctx(request):
print ("create hge_ctx")
print("create hge_ctx")
hge_url = request.config.getoption('--hge-url')
pg_url = request.config.getoption('--pg-url')
hge_key = request.config.getoption('--hge-key')
Expand Down
6 changes: 4 additions & 2 deletions server/tests-py/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
from sqlalchemy import create_engine
from sqlalchemy.schema import MetaData


class HGECtxError(Exception):
pass


class WebhookHandler(http.server.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(HTTPStatus.OK)
Expand Down Expand Up @@ -52,6 +54,7 @@ def server_bind(self):
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.socket.bind(self.server_address)


class HGECtx:
def __init__(self, hge_url, pg_url, hge_key, hge_webhook, hge_jwt_key_file, webhook_insecure):
server_address = ('0.0.0.0', 5592)
Expand Down Expand Up @@ -117,8 +120,7 @@ def get_ws_event(self, timeout):
def reflect_tables(self):
self.meta.reflect(bind=self.engine)


def anyq(self, u, q, h):
def anyq(self, u, q, h):
resp = self.http.post(
self.hge_url + u,
json=q,
Expand Down
Loading