This is the fifteenth post in the series of my weekly GSOC Sugar Labs, where I summarize my week of working with Sugar Labs under GSOC.
This week Samuel and I worked added the lightbox styled screenshot carousel. Completed the i18n by generating .pot files using flask-babel and started the testing. This week was less productive than other weeks.
Earlier versions of screenshots carousel occupied a big part of screen. This week we introduced lightbox styled screenshot carousel. Most of the classes and implementation were taken from here. I had to remove some modal css definitions from airspace.css since they were overriding the design and causing weird UI issues.
Here is the end result
and when user clicks on the image, it will enlarge
i18n - Adding Pot Files
This was accomplished by using flask-babel’s _ or gettext function to substitute the template text with the language.
To generate the .pot file, following command was used pybabel extract -F babel.cfg -o messages.pot .babel.cfg contains the patterns and files to look for _ or gettext function and adds it to .pot for translation.
Testing at the moment is not robust and not confidence worthy but I added some initial tests. For testing we are currently using pytest.
I added some unit testing code for i18n api module and some integration tests.
Here are the integration tests, they uses setup and teardown to allocate resources for running a class of tests and deleting the resources.
To run the tests I modified the .travis.yml to run the tests along with pep8 style check flake8 && pytest tests/
Goals for Next Week
This week I intend to focus on writing more sensible tests and writing documentation (maybe using sphinx). Database migration of aslo to aslo-v3 and moving the server to new VM is on the to-do list as well. since my old VM died (DigitalOcean credits expired ).
If you find any typos,mistakes or any other inconsistencies, let me know and I’ll fix them.