You are viewing cyli

c y l i - Twisted/Divmod development on Windows

Ying Li
Date: 2006-02-15 16:57
Subject: Twisted/Divmod development on Windows
Security: Public
Tags:development, divmod, 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.

Post A Comment | 7 Comments | Share | Link



User: nearfar
Date: 2006-02-16 07:22 (UTC)
Subject: (no subject)
+1
Reply | Thread | Link



User: (Anonymous)
Date: 2006-02-20 12:33 (UTC)
Subject: Thanks!
This is a big help for those of us who are dragged kicking and screaming to Windowsland by some decree from on high. I'm sure you saved me a couple hours of trial and error. (There's a bad pun in there someplace.)
Reply | Thread | Link



User: (Anonymous)
Date: 2006-03-28 21:53 (UTC)
Subject: s/divcmd.exe/divcmd.bat/
s/divcmd.exe/divcmd.bat/
Reply | Thread | Link



Ying Li
User: cyli
Date: 2006-04-12 03:06 (UTC)
Subject: Re: s/divcmd.exe/divcmd.bat/
Thank you kindly. Corrected.
Reply | Parent | Thread | Link



User: 7wrc
Date: 2007-05-02 19:38 (UTC)
Subject: Re: s/divcmd.exe/divcmd.bat/
Thanks for this.
Reply | Parent | Thread | Link



User: zuluboy
Date: 2008-02-17 02:05 (UTC)
Subject: thanks
Thanks for the great post
Reply | Thread | Link



User: hasyer
Date: 2008-04-10 23:03 (UTC)
Subject: (no subject)
Thank you.

---------------------
muhabbet | korku | msn nickleri | msn nickleri | netlog
Reply | Thread | Link



browse
my journal
links
May 2009
summary