summaryrefslogtreecommitdiff
path: root/sys/lib/python/hgext/inotify/common.py
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2021-06-14 00:00:37 +0000
committerOri Bernstein <ori@eigenstate.org>2021-06-14 00:00:37 +0000
commita73a964e51247ed169d322c725a3a18859f109a3 (patch)
tree3f752d117274d444bda44e85609aeac1acf313f3 /sys/lib/python/hgext/inotify/common.py
parente64efe273fcb921a61bf27d33b230c4e64fcd425 (diff)
python, hg: tow outside the environment.
they've served us well, and can ride off into the sunset.
Diffstat (limited to 'sys/lib/python/hgext/inotify/common.py')
-rw-r--r--sys/lib/python/hgext/inotify/common.py51
1 files changed, 0 insertions, 51 deletions
diff --git a/sys/lib/python/hgext/inotify/common.py b/sys/lib/python/hgext/inotify/common.py
deleted file mode 100644
index 2b18b5f12..000000000
--- a/sys/lib/python/hgext/inotify/common.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# server.py - inotify common protocol code
-#
-# Copyright 2006, 2007, 2008 Bryan O'Sullivan <bos@serpentine.com>
-# Copyright 2007, 2008 Brendan Cully <brendan@kublai.com>
-#
-# This software may be used and distributed according to the terms of the
-# GNU General Public License version 2, incorporated herein by reference.
-
-import cStringIO, socket, struct
-
-"""
- Protocol between inotify clients and server:
-
- Client sending query:
- 1) send protocol version number
- 2) send query type (string, 4 letters long)
- 3) send query parameters:
- - For STAT, N+1 \0-separated strings:
- 1) N different names that need checking
- 2) 1 string containing all the status types to match
- - No parameter needed for DBUG
-
- Server sending query answer:
- 1) send protocol version number
- 2) send query type
- 3) send struct.pack'ed headers describing the length of the content:
- e.g. for STAT, receive 8 integers describing the length of the
- 8 \0-separated string lists ( one list for each lmar!?ic status type )
-
-"""
-
-version = 2
-
-resphdrfmts = {
- 'STAT': '>llllllll', # status requests
- 'DBUG': '>l' # debugging queries
-}
-resphdrsizes = dict((k, struct.calcsize(v))
- for k, v in resphdrfmts.iteritems())
-
-def recvcs(sock):
- cs = cStringIO.StringIO()
- s = True
- try:
- while s:
- s = sock.recv(65536)
- cs.write(s)
- finally:
- sock.shutdown(socket.SHUT_RD)
- cs.seek(0)
- return cs