Package pyfics :: Package server
[hide private]

Source Code for Package pyfics.server

 1  #!/usr/bin/env python 
 2  # -*- coding: utf-8 -*- 
 3  # vim: set sw=4 ts=4 sts=4 et tw=79 : 
 4  # Copyright 2006-2007 Ali Polatel <polatel@gmail.com> 
 5  # Distributed under the terms of the GNU General Public License v3 
 6   
 7  """pyfics server 
 8  """ 
 9   
10 -class IcsServer(object):
11 """ Dummy class to inherit for server specific data, applies sane defaults. 12 """ 13 __slots__ = ( 'ifs', 'misc_login', 'send_ivars' ) 14
15 - def __init__(self, ifs="\n", prompt='%ics ', misc_login = False, 16 send_ivars = False):
17 self.ifs = ifs 18 self.prompt = prompt 19 self.misc_login = misc_login 20 self.send_ivars = send_ivars
21 - def genloginstr(self, ivars, count, prefix=''):
22 mystr = "".join([str((ivars >> y) & 1) for y in range(count-1, -1, -1)]) 23 return prefix + mystr
24