# pymuseekd - Python tools for museekd # # Copyright (C) 2003-2004 Hyriand # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import struct # Event mask EM_CHAT = 1 << 0 EM_PRIVATE = 1 << 1 EM_TRANSFERS = 1 << 2 EM_USERINFO = 1 << 3 EM_USERSHARES = 1 << 4 EM_INTERESTS = 1 << 5 EM_CONFIG = 1 << 6 # Transfer state TS_Finished = 0 TS_Transferring = 1 TS_Negotiating = 2 TS_Waiting = 3 TS_Establishing = 4 TS_Initiating = 5 TS_Connecting = 6 TS_Queued = 7 TS_Address = 8 TS_Status = 9 TS_Offline = 10 TS_ConnectionClosed = 11 TS_CannotConnect = 12 TS_Aborted = 13 TS_Error = 14 class BaseMessage: cipher = None def __init__(self): pass def make(self): print "make called on unsupported message type" sys.stdout.flush() return "" def parse(self, msg): print "parse called on unsupported message type" sys.stdout.flush() return None def pack_int(self, i): return struct.pack("