Commit 42515a21 authored by Janez's avatar Janez

Merge branch 'muse' of /home/git/repositories/kt/mothra

parents 6ef5c41e 0675162a
......@@ -5,7 +5,7 @@ def MUSE_v3_filter_integers(request,input_dict,output_dict,widget):
def MUSE_string_to_file(request, input_dict, output_dict, widget):
def MUSE_string_to_file_V3(request, input_dict, output_dict, widget):
from mothra.settings import MEDIA_ROOT
from workflows.helpers import ensure_dir
......@@ -14,5 +14,5 @@ def MUSE_string_to_file(request, input_dict, output_dict, widget):
ensure_dir(destination)
with open(destination, 'w') as f:
f.write(str(input_dict['data']))
return render(request, 'visualizations/MUSE_string_to_file.html', {'widget': widget, 'fileURL': basename})
return render(request, 'visualizations/MUSE_string_to_file_v3.html', {'widget': widget, 'fileURL': basename})
......@@ -218,7 +218,7 @@ def MUSE_PG_GDEE_path(input_dict):
#### COPIED FROM OLD MUSE PACKAGE
def MUSE_mapping_to_KR_precomputed(input_dict):
def MUSE_mapping_to_KR_precomputed_V3(input_dict):
url = input_dict['url']
data = input_dict['input_data']
......@@ -232,7 +232,7 @@ def MUSE_mapping_to_KR_precomputed(input_dict):
def MUSE_mapping_to_KR(input_dict):
def MUSE_mapping_to_KR_V3(input_dict):
url = input_dict['url']
data = input_dict['input_data']
......@@ -247,7 +247,31 @@ def MUSE_mapping_to_KR(input_dict):
def MUSE_string_to_file_V3(input_dict):
return {}
def MUSE_string_to_file_finished_V3(postdata, input_dict, output_dict):
from socket import getfqdn
import sys
if len(sys.argv) > 1:
if len(sys.argv) > 2 and '.' in sys.argv[2] and ':' in sys.argv[2]:
port = sys.argv[2].split(':')[1]
else:
port = 8000
DEVSERVER = sys.argv[1].startswith('runserver')
else:
DEVSERVER = False
fqdn = '127.0.0.1:' + str(port) if DEVSERVER else getfqdn()
# dirty,dirty
if fqdn == 'workflow':
fqdn = 'workflow.ijs.si'
fqdn = 'http://' + fqdn
fileURL = fqdn + postdata.get('fileURL')[0]
return {'fileURL': fileURL}
......@@ -12,7 +12,7 @@
"image": "",
"description": "Returns the precomputed mapping to knowledge representation for Tuk story",
"static_image": "",
"action": "MUSE_mapping_to_KR_precomputed",
"action": "MUSE_mapping_to_KR_precomputed_V3",
"visualization_view": "",
"streaming_visualization_view": "",
"post_interact_action": "",
......
......@@ -7,15 +7,15 @@
"uid": "686ae43e-46db-4340-8c21-15d79d84ae81",
"windows_queue": false,
"package": "MUSE_v3",
"interaction_view": "MUSE_string_to_file",
"interaction_view": "MUSE_string_to_file_V3",
"has_progress_bar": false,
"image": "",
"description": "Creates a statically served file from the given (text) content.",
"static_image": "",
"action": "MUSE_string_to_file",
"action": "MUSE_string_to_file_V3",
"visualization_view": "",
"streaming_visualization_view": "",
"post_interact_action": "MUSE_string_to_file_finished",
"post_interact_action": "MUSE_string_to_file_finished_V3",
"wsdl_method": "",
"wsdl": "",
"interactive": true,
......
......@@ -12,7 +12,7 @@
"image": "",
"description": "Calls the mapping to knowledge representation service",
"static_image": "",
"action": "MUSE_mapping_to_KR",
"action": "MUSE_mapping_to_KR_V3",
"visualization_view": "",
"streaming_visualization_view": "",
"post_interact_action": "",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment