Commit d0a98357 authored by Maarten de Waard's avatar Maarten de Waard 🤘🏻
Browse files

Merge branch 'Migrate-to-python3' into 'master'

Migrate to python3

See merge request totem/ind!50
parents 40e864fa b2c07421
Dockerfile
venv
.git
.gitmodules
indie.egg-info
layout python python3.5
FROM jbarciauskas/xblock-sdk
RUN pip install --upgrade pip
FROM openedx/xblock-sdk
RUN mkdir -p /usr/local/src/graph-editor-xblock
VOLUME ["/usr/local/src/graph-editor-xblock"]
RUN echo "pip install -e /usr/local/src/graph-editor-xblock" >> /usr/local/src/xblock-sdk/install_and_run_xblock.sh
RUN echo "exec python /usr/local/src/xblock-sdk/manage.py \"\$@\"" >> /usr/local/src/xblock-sdk/install_and_run_xblock.sh
RUN echo "exec python3 /usr/local/src/xblock-sdk/manage.py \"\$@\"" >> /usr/local/src/xblock-sdk/install_and_run_xblock.sh
RUN chmod +x /usr/local/src/xblock-sdk/install_and_run_xblock.sh
ENTRYPOINT ["/bin/bash", "/usr/local/src/xblock-sdk/install_and_run_xblock.sh"]
CMD ["runserver", "0.0.0.0:8000"]
......@@ -85,18 +85,16 @@ class GraphEditorXBlock(XBlock): # pylint: disable=too-many-ancestors
frag.add_javascript_url(
self.runtime.local_resource_url(self, resource)
)
byte_str = unicode(self.xml)
byte_str = byte_str.encode("utf-8")
xml_encoded = base64.b64encode(byte_str)
resource_url = self.runtime.local_resource_url(
self,
'public/styles/default.indie'
)
frag.initialize_js(
'GraphEditorXBlock',
{
'read_only': str(read_only).lower(),
'resource_url': self.runtime.local_resource_url(
self,
'public/styles/default.indie'
),
'xml': xml_encoded,
'resource_url': resource_url,
'xml': self.xml,
}
)
return frag
......@@ -137,4 +135,4 @@ class GraphEditorXBlock(XBlock): # pylint: disable=too-many-ancestors
<grapheditorxblock/>
</vertical_demo>
"""),
]
]
......@@ -122747,9 +122747,8 @@ function GraphEditorXBlock(runtime, element, data) {
var editorUi = new EditorUi(
new Editor(read_only, themes), editorDiv);
editorUi.saveUrl = runtime.handlerUrl(element, 'save_xml');
// Base 64 decode to unicode string
if (data.xml != '') {
setGraphXml(editorUi, Base64.decode(data.xml));
setGraphXml(editorUi, data.xml);
}
if (read_only) {
editorUi.editor.graph.setEnabled(false);
......@@ -31,9 +31,8 @@ function GraphEditorXBlock(runtime, element, data) {
var editorUi = new EditorUi(
new Editor(read_only, themes), editorDiv);
editorUi.saveUrl = runtime.handlerUrl(element, 'save_xml');
// Base 64 decode to unicode string
if (data.xml != '') {
setGraphXml(editorUi, Base64.decode(data.xml));
setGraphXml(editorUi, data.xml);
}
if (read_only) {
editorUi.editor.graph.setEnabled(false);
......
docker==4.2.0
Paver==1.3.4
requests==2.23.0
closure==20191111
libsass==0.20.0
docker==4.3.1
libsass==0.20.1
Paver==1.3.4
requests==2.24.0
XBlock==1.4.0
xblock-sdk==0.2.2
docker run -it -p 8000:8000 --mount "type=bind,src=$(pwd),dst=/usr/local/src/graph-editor-xblock" graph-editor-xblock-dev
Supports Markdown
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