[CalendarServer-changes] [14639] CalendarServer/trunk/calendarserver/tools/dashboard.py

source_changes at macosforge.org source_changes at macosforge.org
Tue Mar 31 10:04:31 PDT 2015


Revision: 14639
          http://trac.calendarserver.org//changeset/14639
Author:   cdaboo at apple.com
Date:     2015-03-31 10:04:30 -0700 (Tue, 31 Mar 2015)
Log Message:
-----------
Dashboard tool now works with unix sockets.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tools/dashboard.py

Modified: CalendarServer/trunk/calendarserver/tools/dashboard.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/dashboard.py	2015-03-30 22:05:30 UTC (rev 14638)
+++ CalendarServer/trunk/calendarserver/tools/dashboard.py	2015-03-31 17:04:30 UTC (rev 14639)
@@ -49,6 +49,7 @@
     print("  -h --help: print this help and exit")
     print("  -t: text output, not curses")
     print("  -s: server host (and optional port) [localhost:8100]")
+    print("      or unix socket path prefixed by 'unix:'")
     print("")
 
     if e:
@@ -84,12 +85,15 @@
             useCurses = False
 
         elif opt in ("-s"):
-            server = arg.split(":")
-            if len(server) == 1:
-                server.append(8100)
+            if not arg.startswith("unix:"):
+                server = arg.split(":")
+                if len(server) == 1:
+                    server.append(8100)
+                else:
+                    server[1] = int(server[1])
+                server = tuple(server)
             else:
-                server[1] = int(server[1])
-            server = tuple(server)
+                server = arg
 
         else:
             raise NotImplementedError(opt)
@@ -146,7 +150,7 @@
         self.paused = False
         self.seconds = 0.1 if usesCurses else 1.0
         self.sched = sched.scheduler(time.time, time.sleep)
-        self.client = DashboardClient(server, True)
+        self.client = DashboardClient(server)
         self.client_error = False
 
 
@@ -295,10 +299,14 @@
     Client that connects to a server and fetches information.
     """
 
-    def __init__(self, sockname, useTCP):
+    def __init__(self, sockname):
         self.socket = None
-        self.sockname = sockname
-        self.useTCP = useTCP
+        if isinstance(sockname, str):
+            self.sockname = sockname[5:]
+            self.useTCP = False
+        else:
+            self.sockname = sockname
+            self.useTCP = True
         self.currentData = {}
         self.items = []
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150331/fd2a05f7/attachment-0001.html>


More information about the calendarserver-changes mailing list