AngelaRemolina's Blog

Weekly blog post #4

AngelaRemolina
Published: 06/28/2021

What are you working on?

This week I kept working on the console that shows outputs and errors on screen (inside the iframe output) and I have finished it. I made two approaches:

  1. Overriding the console.error, console.debug, console.info and console.log javascript methods, only when they are called inside the iframe. I made sure that these new methods keep logging on the browser console but also display the message on a pre tag inside the iframe. Here is the PR for this approach.
  2. Redirecting sys.stderr and sys.stdout. Similar to the first solution, I redirected these two Python methods so they show the errors and the print() outputs on a pre tag inside the iframe as well. To catch the errors I used a try except with a exec() function inside, that runs the program captured in the text area. Here is the PR for this approach.

On both approaches I used the highlight.js library when there is an error to color key words.

My mentors are reviewing these two approaches to see which one is better. They were the ones that recommended a second approach on the first place because overriding console.log does not look like a good idea.

Once this gets merged, I would finish my first milestone. And start working on the second one.

What have you struggled with?

I struggled finding the second approach. Before I got to what I have now, I tried a lot of other alternatives but those were not working. I submitted an issue logging what I tried. My last attempt was missing the try except sentence for it to work. I could solve it, but I did struggle finding the solution.

What solutions have you found?

I joined the Brython google group where other people were having similar issues to mine, and I received a lot of help there: :D

View Blog Post

Weekly Check-In #3

AngelaRemolina
Published: 06/21/2021

What did you do this week?

I achieved the Brython module! :D you can try it here in an exercise I did that works with the Facebook API getting the profile picture. The mentors are reviewing my PR on this component that will help implement the advance exercises of the course. This PR changes the requirements of the project, so it uses my fork of Runestone that has the new option for active code blocks with Brython.

I also submitted a PR to Runestone Components repository. If it gets accepted and merged PyZombis will not have to reference my fork on its requirements which would be a great thing.

What is coming up next?

I started working on some upgrades the mentors suggested for the Brython option. Right now, the output displays an iframe with an embedded html page that shows the results. But when a Syntax error is made or the simple print() function is used, these results are shown on the browser console rather than the iframe. I look forward to having a console, that displays below the iframe the errors or logs that are written.

Did you get stuck anywhere?

I did not get stuck. I solved the issue I was struggling with last week, about the Runestone project and I ended up with a great outcome! I am happy with my achievements this week and I hope to keep this work rhythm up :)

View Blog Post

Weekly blog post #2

AngelaRemolina
Published: 06/14/2021

What are you working on?

This week I have been working in creating a Brython module as a runestone component. The idea is to be able to write something like this:

.. activecode::
:language: python3
:python3_interpreter: brython
from browser import document, alert, html

def hello(ev):
alert("Hello world! I'm using Brython now")

document <= html.BUTTON("My button", id="button_alert")
document["button_alert"].bind("click", hello)

And it shows you an active code block that can be rendered to do what the inner code specifies. This can be done using the html tag (see image below) and inserting the Brython script. But the idea is to achieve the same using writing only the inner python code (pointed on red in the image)

What have you struggled with?

Familiarizing myself with a new project structure and finding where to put my ideas and my code has been challenging. I have tried to follow similar PR where they implement a new directive to see what files I should change, but even though I am following all the same steps, it isn’t working yet.

What solutions have you found?

Runestone Components is a big project! But I have join their development community on Slack and I have been getting help from my mentors as well to guide me across the project.

I have talked to my mentors about this difficulty I’ve been having. They are reviewing my work, but they suggest looking for other alternatives to make it work. I have two alternatives to make this work: 1. The html tag mentioned above, and 2. Using the .. raw:html directive for the rst files and doing some DOM access with activecode.

View Blog Post

Weekly Check-In #1

AngelaRemolina
Published: 06/07/2021

Hello! My name is Angela Remolina. I am working this summer with Python Argentina for the project PyZombis. During all GSOC period I will be posting each week here on my blog updates of my work, starting today! :D

What did you do this week?

The community bonding period helped me to know my mentors and my coworkers and set a communication media and a working plan for the next weeks.

I put the milestones mentioned on my proposal as GitHub milestones in my forked repo.

Also, an upgrade needed to be done. One of my mentors helped me with a guide on how to test this update of the versions with pytest-playwright with and example. I also did a test with pytest-selenium.

What is coming up next?

I will start to work on a navigation test made with Playwright to solve the first issue. Then, I will start working on the Brython module for runestone. Here is the sub-milestone for this part of the project: Here.

Did you get stuck anywhere?

No, I did not. My mentors and peers were very helpful :)

View Blog Post