summaryrefslogtreecommitdiffstats
path: root/wmd/parser.py
diff options
context:
space:
mode:
authorjason2006-07-27 00:06:52 +0000
committerjason2006-07-27 00:06:52 +0000
commita0b8a3a265547b5f61114d971d2a9c30dfcda74b (patch)
treeb0bf8df971525fe67456f0773159564ca49e3f84 /wmd/parser.py
parentc8a737e7e673db646a35819dab6aa560eea88a53 (diff)
downloadwarmachine-a0b8a3a265547b5f61114d971d2a9c30dfcda74b.tar.gz
warmachine-a0b8a3a265547b5f61114d971d2a9c30dfcda74b.zip
Started working on a parser.
git-svn-id: svn://svn.zzq.org/warmachine/trunk@3 3ede8657-8418-0410-873f-eb3fb5a66eab
Diffstat (limited to 'wmd/parser.py')
-rw-r--r--wmd/parser.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/wmd/parser.py b/wmd/parser.py
new file mode 100644
index 0000000..ecb2e55
--- /dev/null
+++ b/wmd/parser.py
@@ -0,0 +1,30 @@
1class ircparse(object):
2 #http://www.irchelp.org/irchelp/rfc/rfc.html
3
4 def __init__(self, data):
5 self.prefix =''
6 self.command = ''
7
8 self._rawdata = data
9
10 #print "x" * 80
11 #print data
12 #print "xo" * 40
13
14 self._process_data(data)
15
16 def _process_data(self, data):
17 data = data.strip()
18
19 # The presence of a prefix is indicated with a single leading ASCII
20 # colon character (':', 0x3b), which must be the first character of
21 # the message itself. There must be no gap (whitespace) between the
22 # colon and the prefix.
23 if data[0] == ':':
24 self.prefix = data[1:].split(' ')[0]
25 else:
26 # If the prefix is missing from the message, it is assumed to have
27 # originated from the connection from which it was received.
28 #
29 # TODO: Get the server name from the parent object.
30 pass