beeware / toga

A Python native, OS native GUI toolkit.
https://toga.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
4.2k stars 655 forks source link

[GSoC] Code display or editing widget across platforms #417

Closed anirudhkannanvp closed 6 years ago

anirudhkannanvp commented 6 years ago

GSoC Proposal for BeeWare

ANIRUDH KANNAN V P

(https://github.com/anirudhkannanvp) (https://www.linkedin.com/in/anirudh-kannan-v-p-951189140/)

Toga

Code display or editing widget across platforms.

Technical Skills, Education and Motivation

_Hello, I am ANIRUDH KANNAN V P, a Cheerful, Hardworking and a motivated young guy who is often unable to sleep early and often ends up staying late till my code is error free_. I study at Indian Institute of Information Technology (IIITS), which is one of the premier institutes in India for studying computer science.I am aactive competitive coder and an open source contributor.I won a limited edition T-shirt by Hacktoberfest 2017 (by DIGITAL OCEAN) recently for supporting open source contribution and getting successful pull requests.Starting from September 2017 till now I have made 350+ contributions to various organizations, projects in 60+ repositories (https://github.com/anirudhkannanvp) Recently in 2018 I became Winner of Open Tech Nights Of FOSSASIA which is also a mentor organization in GSoC 2018 and have won a free ticket to the FOSSASIA Summit in Singapore from March 22-25 2018 as well as free accommodation for the event. The summit is sponsored by Daimler, Google, Microsoft, Indeed, Oracle, MySql, FreeBSD, Open Source Initiative etc. I am an active competitive coder and code regularly in Various websites like Hackerrank, Codechef, HackerEarth, Codeforces, SPOJ,csacademy.com, UVA-OJ, etc.I actively take part in Codechef competitions (HIGHEST RATING:- 1879 4 STARS DIV 1)(USER ID: https://www.codechef.com/users/anirudhjarvis). I am also active on Codechef discuss and have been awarded a few reputation points. I like to help and answer others questions as well as take help from others when required.I am really really active on Hackerrank and have won 1 gold medal, 2 silver medals and 5 bronze medals in various Hackerrank coding competitions rating of 2138 (USER ID: https://www.hackerrank.com/anirudhkannan_v1), apart from solving a variety of domains.I am really active in Helping others, as well as actively participating in the discussion section and have around 24 followers.I also finished a research internship in IIT Madras, one of the premier institutes in India and worked a part on developing an efficient facial recognition algorithm.I got 3RD RANK IN INTERNATIONAL INFORMATICS OLYMPIAD IN TAMIL-NADU STATE 2011.I have also won many other coding competitions and have done a variety of projects(sorry no place to include all, please see my resume( https://drive.google.com/file/d/1vcTQSXE_fxVeQ5P9K0RhrG-xKA32bhLa/view ) or Linkedin profile (https://www.linkedin.com/in/anirudh-kannan-v-p-951189140/)). Apart from coding I love solving Mathematics puzzles, watching movies and playing chess.I am also a NATIONAL LEVEL Chess Player and have Won CBSE CHESS NATIONALS TWICE during school time and also participated in the Parsvnath Commonwealth Chess Championship 2010 and was placed 174th.

My primary Proposal

I Plan on Basically working on creating a code editing and a code display widget for Toga that supports syntax highlighting. My Basic Plan is to to implement initially in Linux followed by Mac and then expand it to other platforms if possible even after the program ends and make it one of the strong native widgets of Toga.I believe in letting my work speak for itself.Rather than making a lot of commitments and doing less,I always commit less and end up doing more . That’s why in this proposal I plan on basically implementing the Code display widget that supports syntax highlighting to Linux(toga-gtk) first,and finish it perfectly and then code it in other platforms(if time exists for (toga-cocoa)Mac OSx,Android,iOS followed by winforms) as it will make the work faster.As a regular Python developer and I am interested in developing tools for cross platform application development for easy development of apps across various platforms.That is my main motivation behind choosing the BeeWare organisation.

Code display or editing widget Implementation expanded:-

toga gtk API’s planned on using:-

Core widgets Component Class
Application    toga.app.App Box    toga.widgets.box.Box Font    toga.font.Font Widget    toga.widgets.base.Widget Window    toga.window.Window

Layout widgets Component Class

  1. Scroll Container    toga.widgets.scrollcontainer.ScrollContainer
  2. Split Container    toga.widgets.splitcontainer.splitcontainer

The application widget should be used as it is the main entry point and container for the toga api.The box is a generic container for any widget that will be used in the text editor if needed.Since the font class is used for abstracting the platforms implementation of fonts, it can be used in syntax highlighting feature of the text editor, and the widget class can be used as the base class for all widgets as and when needed. The label component of toga can be used to annotating the text editor interfaces if needed.

There are two layout widgets I am considering for the text editor.Scroll container and Splitcontainer.The scroll container must be used for long codes to scroll between sections. The Split container can be used to do a split screen and type two codes simultaneously by creating two text editors in split screen.

MENU’ S AND FEATURES CONSIDERED

1.Provide automatic line numbers in the text editor. 2.Provide Syntax highlighting using different fonts in Python followed by c++. 3.Provide Drag and drop editing 4.Provide Paragraph alignment

IMPLEMENTATION DETAILS :- THE DATA STRUCTURES, ALGORITHMS AND API's PLANNED ON USING

import toga-12 week plan for GSoC

What have I done till now for toga = toga.button(‘Starting from 07-March-2018(Seeing the organization for the first time) to the time of submittal of this proposal’, on_press = read below)

Precoding period = toga.button(‘Till coding period starts’, on_press = read below)

week 1 and week 2 = toga.button(‘14-20 May and 21-27 May’, on_press = read below)

week 3 and week 4 = toga.button(‘28 May- 3 June and 4-10 June’, on_press = read below)

week 5 and week 6 = toga.button(‘11-17 June and 18-24 June’, on_press = read below)

week 7 and week 8 = toga.button(‘25 June - 1 July and 2 - 8 July’, on_press = read below)

week 9 and week 10 = toga.button(‘9 -15 July and 16-22 July’, on_press = read below)

week 11 and week 12 = toga.button(‘23 -29 July and 30 July - 5 August’, on_press = read below)

Post GSoC = toga.button(‘After 5 August’, on_press = read below)

Possible Problems that I may face in the 12-week plan

After some research I found some possible problems which I may face.Syntax highlighting libraries have some differences in implementing for Python2 and Python3, and some problems were faced while implementing with GUI.I believe I may possible face some Sync problems between Toga libraries and Pygments libraries or any other libraries used .Moreover I may face some errors while text auto completion and adding words to dictionary..In addition to this errors may arise in code folding and while selecting and replacing some words in the document.Moreover I am also worried about the build errors I may face while developing the text editor that may turn up unexpected during the actual implementation.Python library Pygments has been considered for syntax highlighting after some explorations and integrating it with toga fonts is a difficulty.This may lead to performance issues on what fonts I should use. Moreover performance issue will exist while using automatic text highlighting in Splitcontainer Text editor.Furthermore i have limited experience working with toga codebase, so that I may face difficulties in correcting any unexpected errors. Moreover i may face some merging errors while merging Python s File,menus,numpy,collections,itertools etc with Toga ‘s API or with one another. Care must be taken care to make sure this doesn't happen.I am also not familiar with Toga’s integration with API’s to provide contextual menus, menu,edit and file options.

Other Commitments

        I do not have any other commitments during the summer as of this moment of writing the proposal and plan on working the GSoc for the whole time putting in my whole effort , apart from the occasional relaxing and going out for dinner.I plan on working on 7-8 hours daily dedicated efforts to make sure that the project goes as planned. 

PS:- PLEASE VISIT THE LINK FOR THE ORIGINAL DOCUMENTATION https://docs.google.com/document/d/1Tiag_jp9ZFlQY18I8wM7_7EY8KvMdAVU3m2QoNzFbYc/edit?usp=sharing

freakboy3742 commented 6 years ago

@anirudhkannanvp Ok... so... No.

This needs a lot less cute, and a lot more actual detail.

Based on this proposal, I have no confidence that you actually understand the problem you're proposing to solve.

Do you have a design in mind? What GTK or Cocoa APIs will you be using? What API will you expose to end users? What performance issues will exist? How will you manage them? These are the sort of details that we need to see.

anirudhkannanvp commented 6 years ago

I have updated as much as possible I guess with a separate new section display or editing widget Implementation expanded:- as per the previous comment. Please look through it and comment any changes required.This is just a version of it. I 'll change it as per the comments given.

freakboy3742 commented 6 years ago

@anirudhkannanvp I think you have massively misunderstood what is being asked for here.

Toga already has a Multiline text area. Compiling three of four pre-existing widgets into an app is a task for an idle weekend, not a GSoC.

This problem isn't just a matter of "put a multiline text area on a page". A code editing widget has complex needs that are way beyond a multiline text area. Syntax highlighting is one of the requirements (one that some multiline text areas might be able to handle); but so are line numbers, code folding, the ability to visualise huge files, code autocompletion, contextual menus,... the list goes on. This won't be a simple widget. It's a very complex undertaking. I wouldn't even expect a GSoC student to complete a "code display/edit widget" in the time allotted by the GSoC.

You need to go back to the drawing board on this one.

anirudhkannanvp commented 6 years ago

@freakboy3742 Actually I didn't want to expand upon the menu and feature options considered in the initial proposal and thought I could expand on the fly, during coding period but now I have expanded as asked by you,I have dropped the development for toga-cocoa MacOs in the 12 week plan as compared the previous proposal as the number of features I have proposed require a lot of time to implement. I would be even happy to cut down some before submitting my final proposal if u wish. Please let me know. Kindly do the needful and comment any changes required.

freakboy3742 commented 6 years ago

@anirudhkannanvp You haven't addressed any of the issues I raised.

Again - this task isn't "write an editor app". It's to write the widget on which an editor would be based. Any reference to MultilineTextInput in your proposal immediately marks the proposal as a non-starter.

anirudhkannanvp commented 6 years ago

@freakboy3742 I have updated implementation details such as what data structures, Python Libraries, and Algorithms I'll be using for the above-mentioned features. That s the final Proposal I submitted.Okay. Thanks a lot for Your reviews. I have corrected as much as possible as per your reviews.Since today is the last day, I can't make any more changes. I am submitting my proposal. Kindly do the needful. Thanks for your guidance @freakboy3742 . It was wonderful working with BeeWare. Ill continue to be a part of the community and contribute.Thank You

freakboy3742 commented 6 years ago

Unfortunately, this project was not selected for the 2018 GSoC. Thanks for applying!