[nanny] Change default PYRO_STORAGE for win32



commit 022c18aebc6299f4d735007007f79d371a678348
Author: Roberto Majadas <roberto majadas openshine com>
Date:   Sun Oct 24 16:23:39 2010 +0200

    Change default PYRO_STORAGE for win32

 daemon/src/NannyPyroBus.py |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/daemon/src/NannyPyroBus.py b/daemon/src/NannyPyroBus.py
index fa6b482..ba35a62 100644
--- a/daemon/src/NannyPyroBus.py
+++ b/daemon/src/NannyPyroBus.py
@@ -22,6 +22,20 @@
 
 from twisted.internet import threads, reactor, defer
 from twisted.python import failure
+
+import os
+import sys
+
+if os.name == "nt" :
+    if hasattr(sys, "frozen") :
+        NANNY_DATA = os.path.join(os.environ["ALLUSERSPROFILE"], "Gnome", "nanny")
+        if not os.path.exists(NANNY_DATA) :
+            try:
+                os.makedirs(NANNY_DATA)
+            except:
+                pass
+        os.environ["PYRO_STORAGE"] = NANNY_DATA 
+
 import Pyro.core
 import threading
 import time



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