Ying Li (cyli) wrote,
Ying Li
cyli

Twisted/Divmod development on Windows

I may be doing some Divmod-esque development in the near future, so I figured I'd try to set it up in Windows (so I can code while waiting in my 8000-hour Warcraft battleground queues). Glyph walked me through the process today, so I figure I'd write it down in case I'd ever have to do it again. And this documentation, much like every other bit of Windows documentation I've ever seen, is replete with screenshots. However, to make it less annoying, I've linked to some of those screenshots instead of just plunking them down with an IMG tag.

Edit 2 Nov 2006: Links for OpenSSL and PyOpenSSL have been changed.

Useful tools you may want before you start this.

Pre-requisites:

Install Python TimeZone Library

  • Download PyTZ
  • Extract the compressed file (see screenshot)
  • Create Windows binary. (see screenshot) Open up a CMD.EXE shell prompt, go to where PyTZ was extracted, and type:
    C:\path\to\directory> python setup.py bdist_wininst 
  • In the extracted folder, there will be one more folder called "dist" (see screenshot). It contains the installer, which you can then use to install PyTZ (see screenshot).

Set-up Twisted development environment:

  1. Set up your environment variables (right-click "My Computer" --> Advanced Tab --> Environment Variables)
    • Put PuTTY in your system's PATH (C:\Program Files\PuTTY) variable
    • Set your user's SVN_SSH variable to "plink"
  2. Make the correct directory structure and check out Divmod trunk from SVN. Open a command prompt (CMD.EXE) and:
    C:\> mkdir Projects
    C:\> cd Projects
    C:\Projects> mkdir Divmod
    C:\Projects> cd Divmod
    C:\Projects\Divmod> svn co http://divmod.org/svn/Divmod/trunk
  3. Go to the Divmod\trunk\Combinator folder using explorer. There is a file there called divcmd.bat, which is the Divmod Command Shell. From now on, instead of using CMD.exe, use this divcmd.bat instead (you can make a shortcut for it with the spiffy Divmod icon too, if you like).

  4. Set up chbranch so you can use it to check out branches from SVN, etc. Open up a divcmd.bat shell (see screenshot):
     C:\Projects> chbranch Divmod trunk 
  5. Checkout Twisted. In the same divcmd.bat shell (see screenshot):
     C:\Projects> chbranch Twisted trunk svn://svn.twistedmatrix.com/svn/Twisted/trunk 

Set up Win32 Emacs for Twisted development (optional, if you installed Win32 Emacs):

  1. Checkout TwistedEmacs. In a divcmd.bat shell, type the following:
     chbranch TwistedEmacs trunk svn://svn.twistedmatrix.com/svn/TwistedEmacs/trunk 
  2. Add the following lines to your .emacs file (usually in C:\Documents and Settings\[username]\Application Data\) (see screenshot):
    (eval
     (read
      (format
       "(progn %s )"
       (shell-command-to-string
        (format "python %s/%s" "C:"
                "Projects/Divmod/trunk/Combinator/environment.py emacs"))))) 
    
    (load-file "C:\\Projects\\TwistedEmacs\\trunk\\twisted-dev.el")
  3. Change your twisted-dev group settings. Hit M-x customize-group: twisted-dev:

    Make the scratch directory, or set it to be whatever directory you'd like.

Tags: development, divmod, windows
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 7 comments