mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
*** empty log message ***
This commit is contained in:
parent
7565b93414
commit
9e80d6f125
8 changed files with 123 additions and 79 deletions
|
|
@ -37,8 +37,8 @@ def unpack_utmpidlearr(self):
|
|||
class PartialRnusersClient:
|
||||
|
||||
def addpackers(self):
|
||||
self.packer = RnusersPacker().init()
|
||||
self.unpacker = RnusersUnpacker().init('')
|
||||
self.packer = RnusersPacker()
|
||||
self.unpacker = RnusersUnpacker('')
|
||||
|
||||
def Num(self):
|
||||
return self.make_call(1, None, None, self.unpacker.unpack_int)
|
||||
|
|
@ -54,14 +54,14 @@ def Allnames(self):
|
|||
|
||||
class RnusersClient(PartialRnusersClient, UDPClient):
|
||||
|
||||
def init(self, host):
|
||||
return UDPClient.init(self, host, 100002, 2)
|
||||
def __init__(self, host):
|
||||
UDPClient.__init__(self, host, 100002, 2)
|
||||
|
||||
|
||||
class BroadcastRnusersClient(PartialRnusersClient, BroadcastUDPClient):
|
||||
|
||||
def init(self, bcastaddr):
|
||||
return BroadcastUDPClient.init(self, bcastaddr, 100002, 2)
|
||||
def __init__(self, bcastaddr):
|
||||
BroadcastUDPClient.__init__(self, bcastaddr, 100002, 2)
|
||||
|
||||
|
||||
def test():
|
||||
|
|
@ -71,7 +71,7 @@ def test():
|
|||
return
|
||||
else:
|
||||
host = sys.argv[1]
|
||||
c = RnusersClient().init(host)
|
||||
c = RnusersClient(host)
|
||||
list = c.Names()
|
||||
for (line, name, host, time), idle in list:
|
||||
line = strip0(line)
|
||||
|
|
@ -80,7 +80,7 @@ def test():
|
|||
print `name`, `host`, `line`, time, idle
|
||||
|
||||
def testbcast():
|
||||
c = BroadcastRnusersClient().init('<broadcast>')
|
||||
c = BroadcastRnusersClient('<broadcast>')
|
||||
def listit(list, fromaddr):
|
||||
host, port = fromaddr
|
||||
print host + '\t:',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue