fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] fabric on Win32


From: Christian Vest Hansen
Subject: Re: [Fab-user] fabric on Win32
Date: Thu, 23 Oct 2008 17:57:37 +0200

On Thu, Oct 23, 2008 at 12:15 AM, Kevin Horn <address@hidden> wrote:
> I've applied the following patch (diffed against v0.0.9) to get Fabric
> working on win32.

Ok. I'll apply it once I'm through Niklas Linströms changes.

>
> Not sure if it covers every compatibility area, but it works for me.  Are
> there any other areas that are Unixy-specific?

There's a SIGINT trap in _connect(). I don't have access to a windows
machine so I don't know how compatible that is.

There might also be an issue with the user-wide configuration file.
Fabric uses `os.path.expanduser("~/.fabric")` to find that file, but
there's some windows specific issues with that as detailed here:
http://mail.python.org/pipermail/python-list/2006-July/393819.html

>
> Thanks for this tool, its horrifically useful.
>
> Kevin Horn
>
> ==============================
>
> --- fabricold.py Wed Oct 22 17:02:43 2008
> +++ fabric.py Wed Oct 22 17:02:33 2008
> @@ -21,7 +21,12 @@
>  import getpass
>  import os
>  import os.path
> -import pwd
> +try:
> +    import pwd
> +    _username = pwd.getpwuid(os.getuid())[0]
> +except ImportError:
> +    import win32api
> +    _username = win32api.GetUserName()
>  import re
>  import signal
>  import subprocess
> @@ -54,7 +59,7 @@
>      'fab_author': __author__,
>      'fab_mode': 'rolling',
>      'fab_port': 22,
> -    'fab_user': pwd.getpwuid(os.getuid())[0],
> +    'fab_user': _username,
>      'fab_password': None,
>      'fab_pkey': None,
>      'fab_key_filename': None,
>
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fab-user
>
>



-- 
Venlig hilsen / Kind regards,
Christian Vest Hansen.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]