Ying Li ([info]cyli) wrote,
@ 2006-02-15 16:57:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Entry tags:development, divmod, windows

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.




(Post a new comment)


[info]nearfar
2006-02-16 07:22 am UTC (link)
+1

(Reply to this)

Thanks!
(Anonymous)
2006-02-20 12:33 pm UTC (link)
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 to this)

s/divcmd.exe/divcmd.bat/
(Anonymous)
2006-03-28 09:53 pm UTC (link)
s/divcmd.exe/divcmd.bat/

(Reply to this) (Thread)

Re: s/divcmd.exe/divcmd.bat/
[info]cyli
2006-04-12 03:06 am UTC (link)
Thank you kindly. Corrected.

(Reply to this) (Parent)(Thread)

Re: s/divcmd.exe/divcmd.bat/
[info]7wrc
2007-05-02 07:38 pm UTC (link)
Thanks for this.

(Reply to this) (Parent)

Great subject
(Anonymous)
2007-02-23 06:06 am UTC (link)
Hello! Author, you're absolutely right!
And beautiful diz, interesting site name cyli.livejournal.com :), I see you you're are not newbe. Go on with the great work!

(Reply to this)

thanks
[info]zuluboy
2008-02-17 02:05 am UTC (link)
Thanks for the great post

(Reply to this)

(Reply from suspended user)

Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…