Almost done, reviews please?

I am back to blogging again. My last blog post was from Allahabad, my home town. Now I am some 1800 kms away in Bangalore. A lot has changed since I last blogged.

  • My friends aren’t there with me, I am all alone.
  • Am no longer in United College of Engineering and Research. I have joined AOL’s Bangalore Development Centre. I am working on the Single Line Search box project for MapQuest. I’ll blog about this soon.
  • I didn’t have internet connectivity until about 3-4 days back.
  • Most importantly, I am nearing the finish of the Anjuta Python plugin now.

All the features work now. I just need to smoothen them out. Autocompletion, autoindentation and calltips work. Rest of the fancy features like refactoring or PyLint checking or Python debugger might find a place outside the scope of the core language support plugin, which will be the next thing I will work on after the GSoC ends.

Now, some minor features, some bugs and lots of testing remain. I hope to wrap up all the features before the “suggested pencils down” date of 10 August, and start extensive testing. Above everyone else, I would like to thank Sebastien Granjoux, my mentor, and Johannes Schmidt, co mentor, for helping me every step of the way. If all remains fine, I’ll finish the plugin before the deadline of 17th August in a acceptable/stable form. 🙂

Would you like to test the plugin and give me some feedback before the deadline ends for final submission, please? The link to the project is here (also listed somewhere in some panel on the right). [Test the plugin against the Anjuta SVN trunk version]

Thank you everyone!

Popularising Python and PyGTK

Here are a couple of great links I found so as to get a C coder to learn and use Python.

  1. All-in-One win32 Python installer: Why a win32 python installer? Well, if you’re a regular Windows user and a casual developer, this is your chance to start with Python and PyGTK, which is bundled with this installer package.
  2. The Python Challenge: This is a puzzle contest whereupon you learn the Python language as you keep crossing the levels. Great way to learn Python right from the start.

[Regarding my promise to write about my approaches to autocompletion feature in next post, I will make that post sometime later.]

Screencast of Initial Work

Past week has been hard work and lots of discussion on approaches with Sebastien, Johannes and Massimo. Here’s a preview of my initial work at implementing auto completion (code completion) and auto indentation for Python in Anjuta.

OGG video for download
YouTube video link

There’s quite some work needed to clean things up, adding new features. Though, all in all, the basic project functionality is now in place. I shall post all the technical details, pros-cons of approaches, new approaches etc. in my next post.

Auto Indentation for Python

Here’s my preliminary idea for the auto indentation for Python in Anjuta.
[code lang=”c”]
/* When a new line character is inserted (user pressed Return after a line),
* the following pseudo code could be executed. Here currentline is
* the line number of the present line (after which the new line is
* supposed to begin.
* Assumption: Ignoring multilines for now.

if (there is a colon at the end of currentline)
line_indent = get_indentation (currentline) + INDENT_SIZE;
line = currentline;
while (line is a blank or spaces-only line)
line_indent = get_indentation (line);
return line_indent;
I am thinking of coding this approach, testing and improving. I know this is too naive, but I just want to start with something. The multilines and other special cases that follow thereafter would provide for further tweaking. This whole project seems like a nice TopCoder Marathon Match, where the first submission is always a naive solution, and things improve over successive submissions. Would be nice to follow the “commit early, commit often” theory during this GSoC 🙂

GSoC 2009: Python support for Anjuta

GSoC Banner

Google Summer of Code 2009 Banner

My task this summer for my Google Summer of Code (2009) project for the GNOME organisation would be to work on adding Python support to the great Anjuta IDE. Anjuta has been thus far excellent in its area of specialisation, i.e. C/C++ projects. Now with my initiative and the great people working at Anjuta, viz. Johannes Schmidt, Sebastien Granjoux etc., Anjuta shall be on its way to become a full fledged Python IDE, one that GNOME users would use for their Python based projects.

Key features of having such a support are:

  • Template and Building of Python Projects (already seems to be in place, haven’t tested thoroughly)
  • Auto indent
  • Auto completion (or known as code completion)
  • Syntax highlighting (already in place)
  • Python debugging

So, all in all, this shall be very exciting to work on and I take Wingware’s WingIDE for Python as a role model for now. Of course, I’d want Anjuta to be even better than WingIDE, so I will make all possible efforts.

My present task seems to be getting a firm understanding of the Abstract Syntax Tree (AST) of the Python package, that will help me implement the auto completion feature. Auto indent shall be just simple parsing of indent spaces, might not pose much of a challenge. When all seems set and ready, debugging could be implemented/tested thoroughly.