Хранилища Subversion pytwidcpp

Сравнить редакции

Не учитывать пробелы Редакция 5 → Редакция 6

/trunk/client.py
23,7 → 23,7
# this connects the protocol to a server runing on port 8000
def main():
f = NMDCFactory()
reactor.connectTCP("verlihub.org", 4111 , f)
reactor.connectTCP("127.0.0.1", 31337 , f)
reactor.run()
 
# this only runs if the module was *not* imported
/trunk/nmdc.py
91,8 → 91,8
def nmdc_UserCommand(self):
pass
 
def nmdc_UserIP(self):
pass
def nmdc_UserIP(self, params):
print "nmdc_UserIP: %s" % params
 
def nmdc_Version(self):
pass
/trunk/protocol.py
1,4 → 1,4
# -*- coding: utf-8 -*-
Я -*- coding: utf-8 -*-
""" PyCODC NMDC/ADC Client """
from twisted.internet import protocol
from twisted.protocols import basic
20,8 → 20,7
 
def lineReceived(self, line):
print "Line Received: %s" % line
command, params = self.parseLine(line)
self.handleCommand(command, params)
self.parseLine(line)
 
def connectionLost(self, reason):
print "Conlost: %s" %self
46,12 → 45,9
 
command = m.group("command")
params = m.group("params")
print "NMDC Command: %s; Params: %s" %(command, params)
self.handleCommand(command, params)
except:
print "Exception: %s"% line
return command, params
else:
return "", ""
 
def handleCommand(self, command, params):
print "handleCommand: %s %s" % (command, params)
74,6 → 70,9
self.sendLine(answer)
print "makeAnswer: %s" % answer
 
def nmdc_unknown(self, command, params):
print "nmdc_%s doesn't exist. Called with params: %s" % (command,params)
def nmdc_rawline(self, line):
print "rawline: %s"% line
 
def nmdc_unknown(self, command):
print "nmdc_%s doesn't exist." % command