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
2 changes: 1 addition & 1 deletion docker_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.3sync
1.4.4sync
36 changes: 18 additions & 18 deletions search_oc.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,19 @@
)

# Set the web logger
web_logger = WebLogger(env_config["base_url"], env_config["log_dir"], [
"HTTP_X_FORWARDED_FOR", # The IP address of the client
"REMOTE_ADDR", # The IP address of internal balancer
"HTTP_USER_AGENT", # The browser type of the visitor
"HTTP_REFERER", # The URL of the page that called your program
"HTTP_HOST", # The hostname of the page being attempted
"REQUEST_URI", # The interpreted pathname of the requested document
# or CGI (relative to the document root)
"HTTP_AUTHORIZATION", # Access token
],
# comment this line only for test purposes
{"REMOTE_ADDR": ["130.136.130.1", "130.136.2.47", "127.0.0.1"]}
)
# web_logger = WebLogger(env_config["base_url"], env_config["log_dir"], [
# "HTTP_X_FORWARDED_FOR", # The IP address of the client
# "REMOTE_ADDR", # The IP address of internal balancer
# "HTTP_USER_AGENT", # The browser type of the visitor
# "HTTP_REFERER", # The URL of the page that called your program
# "HTTP_HOST", # The hostname of the page being attempted
# "REQUEST_URI", # The interpreted pathname of the requested document
# # or CGI (relative to the document root)
# "HTTP_AUTHORIZATION", # Access token
# ],
# # comment this line only for test purposes
# {"REMOTE_ADDR": ["130.136.130.1", "130.136.2.47", "127.0.0.1"]}
# )

render = web.template.render(c["html"], globals={
'str': str,
Expand Down Expand Up @@ -150,7 +150,7 @@ def __init__(self, sparql_endpoint, sparql_endpoint_title, yasqe_sparql_endpoint
self.collparam = ["query"]

def GET(self):
web_logger.mes()
# web_logger.mes()
content_type = web.ctx.env.get('CONTENT_TYPE')
return self.__run_query_string(self.sparql_endpoint_title, web.ctx.env.get("QUERY_STRING"), content_type)

Expand Down Expand Up @@ -201,7 +201,7 @@ def __contact_tp(self, data, is_post, content_type):
web.header('Access-Control-Allow-Origin', '*')
web.header('Access-Control-Allow-Credentials', 'true')
web.header('Content-Type', req.headers["content-type"])
web_logger.mes()
# web_logger.mes()
req.encoding = "utf-8"
return req.text
else:
Expand Down Expand Up @@ -233,7 +233,7 @@ def __run_query_string(self, active, query_string, is_post=False,
parsed_query = urlparse.parse_qs(query_string)
current_subdomain = web.ctx.host.split('.')[0].lower()
if query_string is None or query_string.strip() == "":
web_logger.mes()
# web_logger.mes()
return getattr(render, self.sparql_endpoint_title)(
active=active,
sp_title=self.sparql_endpoint_title,
Expand Down Expand Up @@ -264,7 +264,7 @@ def __run_query_string(self, active, query_string, is_post=False,

class Main:
def GET(self):
web_logger.mes()
# web_logger.mes()
current_subdomain = web.ctx.host.split('.')[0].lower()
sparql_endpoint_meta= env_config["sparql_endpoint"]["meta"]
sparql_endpoint_index= env_config["sparql_endpoint"]["index"]
Expand Down Expand Up @@ -301,7 +301,7 @@ def __init__(self):

class Search:
def GET(self):
web_logger.mes()
# web_logger.mes()
current_subdomain = web.ctx.host.split('.')[0].lower()
query = web.input(text="", rule="citingdoi") # rule default a citingdoi
sparql_endpoint_json = json.dumps(env_config["sparql_endpoint"])
Expand Down