fab-user
[Top][All Lists]
Advanced

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

[Fab-user] fabric on Win32


From: Kevin Horn
Subject: [Fab-user] fabric on Win32
Date: Wed, 22 Oct 2008 17:15:57 -0500

I've applied the following patch (diffed against v0.0.9) to get Fabric working on win32.

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

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,

Attachment: fab_diff.diff
Description: Binary data


reply via email to

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