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,7 → 20,8 |
|
def lineReceived(self, line): |
print "Line Received: %s" % line |
self.parseLine(line) |
command, params = self.parseLine(line) |
self.handleCommand(command, params) |
|
def connectionLost(self, reason): |
print "Conlost: %s" %self |
45,9 → 46,12 |
|
command = m.group("command") |
params = m.group("params") |
self.handleCommand(command, params) |
print "NMDC Command: %s; Params: %s" %(command, params) |
except: |
print "Exception: %s"% line |
return command, params |
else: |
return "", "" |
|
def handleCommand(self, command, params): |
print "handleCommand: %s %s" % (command, params) |
70,9 → 74,6 |
self.sendLine(answer) |
print "makeAnswer: %s" % answer |
|
def nmdc_rawline(self, line): |
print "rawline: %s"% line |
def nmdc_unknown(self, command, params): |
print "nmdc_%s doesn't exist. Called with params: %s" % (command,params) |
|
def nmdc_unknown(self, command): |
print "nmdc_%s doesn't exist." % command |
|