Unverified Commit 3f941b84 authored by Maarten de Waard's avatar Maarten de Waard 🤘🏻
Browse files

initial python3 version, save function bn broken

parent a5e698b3
Dockerfile
venv
.git
.gitmodules
indie.egg-info
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 -m pdb /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"]
......@@ -4,6 +4,7 @@ Shows the mxGraph GraphEditor in the course creator view.
import base64
import pkg_resources
import pdb
from os import path
from xblock.core import XBlock
from xblock.fields import Scope, String
......@@ -19,7 +20,7 @@ class GraphEditorXBlock(XBlock): # pylint: disable=too-many-ancestors
# self.<fieldname>.
xml = String(
default='',
default='{}',
scope=Scope.content,
help="The diagram's xml representation"
)
......@@ -85,18 +86,18 @@ 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)
# byte_str = self.xml.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 +138,4 @@ class GraphEditorXBlock(XBlock): # pylint: disable=too-many-ancestors
<grapheditorxblock/>
</vertical_demo>
"""),
]
]
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