Wednesday, May 27, 2009

Personal Revision Control

After visiting with my mentor, he had me to look into using Mercurial with a Subversion repository. Subversion code control and all revisions are centralized so while anyone can check out code, if you produce your own patches and would then like to revert your changes, you are out of luck since you need commit privileges to produce revision checkpoints. Mercurial, being a distributed revision control system, allows the user to have their own revision checkpoints even if they do not have commit privileges. Eventually I came across hgsvn which downloads a Subversion branch and then converts it to a Mercurial branch.

After downloading and installing the latest version and reading the documentation, everything seemed pretty straightforward. I executed the following command:

$ hgimportsvn http://svn.python.org/projects/python/trunk/Lib personalrc

Everything appeared to be going smoothly until I looked inside the folder and noticed that nearly none of the files from the /python/trunk/Lib branch were in there. I spent quite a bit of time trying to figure out why it didn't work until I finally realized that, for some reason, it was not checking out the newest revision of code. After entering the web interface of Python's SVN repository, I saw the latest revision was 72964. So I executed the following command:

$ hgimportsvn -r 72964 http://svn.python.org/projects/python/trunk/Lib personalrc

Everything was in its place now and I had the code revision control the Mercurial provides.

Monday, May 25, 2009

File I/O and Async

I have finished implementing the File I/O class for Popen which using the asynchronous I/O patch mentioned in my proposal from active state. The test for the File I/O class was written ahead of time but I strayed away from the TDD philosophy for the borrowed code as I did not fully understand how it was supposed to work. Since my File I/O class depends on the asynchronous output working properly, I am using those tests for a little bit in hopes of getting proper coverage.

I have run into the issue of debugging my code. The code I wrote failed the test I created and I have not been able to figure out why. It doesn't help that I have not gotten Wing IDE 3.1 to work with Python 2.7.

Friday, May 22, 2009

File I/O

In attempting to create a file object to act as a helper class, I ran into the issue of blocking I/O. I was initially going to implement the file helper class before implementing the versions of asynchronous I/O with Popen before doing so but then I realized I would run into issues of blocking when the file.write function was called; since we are treating it like a file object, the output isn't immediately important to us so blocking doesn't make sense for this. I have been looking into a specific piece of code on activestate with an async I/O implementation for Popen and one of the comments contained information on non-blocking I/O but for Posix systems only. I need to figure out how to keep the I/O from blocking on Windows as well since cross platform compatibility is one of my overall goals.

Wednesday, May 20, 2009

Unfamiliar Territory

As I am not used to working with code I have not written, I am working on a visual diagram of the subprocess functions to give me an idea of the general stack trace for functions as they are called. It will give me something I can physically reference without having to backtrack while I am in the middle of coding. My first addition to the subprocess module is to be able to treat the subprocess objects like file I/O objects so that write and read and readlines can be used however as this was not in my initial proposal I would like some feedback and criticism.

Sunday, May 17, 2009

Installed

I now have Python 2.7 installed on my system alongside my Python 2.5 installation. For developing the subprocess module, I have copied the subprocess.py file from the source. Because the Windows module requires an additional component written in C which I am not familiar with, I am going to begin developing on Linux first and then see if it runs on Windows as I may not need to modify any of the Windows C code.

Sunday, May 10, 2009

Python 2.7 Built

Python 2.7 Alpha 0 successfully built. Focusing on getting Python Virtual Env to work with it so I may use it alongside my existing Python 2.5 installation.

Monday, May 4, 2009

I have obtained the Python 2.7 Alpha 0 through subversion to develop subprocess so that it may be incorporated into the official 2.7 release. Next step is to setup Python Virtual Environment so I am able to use it alongside my current Python 2.5.4 build.