From: <sir...@us...> - 2003-04-05 11:05:45
|
Update of /cvsroot/btplusplus/BT++/src In directory sc8-pr-cvs1:/tmp/cvs-serv27446/src Modified Files: Images.py Added Files: Logging.py Log.py Log Message: Started modifying/reworking the whole logging system. It is work in progress... but working. --- NEW FILE: Logging.py --- import new, types class Interface: Handlers = [] def __init__(self, *args): fullargs = 'self' cleanargs = '' for arg in args: if type(arg) == types.TupleType: name = arg[0] default = arg[1] else: name = arg default = NotImplemented cleanargs = cleanargs + name + ',' fullargs = fullargs + ',' + name if( default != NotImplemented ): if type(default) == types.StringType: fullargs = fullargs + '=\'' + default + '\'' else: fullargs = fullargs + '=' + str(default) cleanargs = cleanargs[0:len(cleanargs) - 1] callstr = 'lambda ' + fullargs + ': self.Log(' + cleanargs + ')' self.__call__ = new.instancemethod(eval(callstr), self, Interface) def __call__(self): pass def AddHandler(self, handler): if handler not in self.Handlers: self.Handlers.append(handler) def DelHandler(self, handler): self.Handlers.remove(handler) def Log(self, *args): for handler in self.Handlers: handler.Log(*args) class Handler: def Log(self, *args): print(str(args)) --- NEW FILE: Log.py --- import Logging Info = Logging.Interface( 'Message', ('Severity', 0) ) #Error = Logging.Interface( 'Message', ('Severity', 1) ) #Fatal = Logging.Interface( 'Massage', ('Severity', 2) ) #LoadInfo = Logging.Interface( 'File', 'Message' ) #SeedInfo = Logging.Interface( 'File', 'Message' ) Index: Images.py =================================================================== RCS file: /cvsroot/btplusplus/BT++/src/Images.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Images.py 3 Mar 2003 20:46:14 -0000 1.9 --- Images.py 5 Apr 2003 11:05:42 -0000 1.10 *************** *** 776,779 **** --- 776,794 ---- \x17\xa6\xfdlI:>\x15\xe8)\x06OW?\x97uN\tM\x00\x9b\xc8g\xbd" , + 'Log_Off': + 'x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\xdc@\xcc\xce\ + \xc1\x06$\xef\xe5m\x8f\x05R,\xc5N\x9e!\x1c@P\xc3\x91\xd2\x01\xe4\x1bx\xba8\ + \x86T\xccI\x16\x11\x10HP\x103H\x14\xfe\xf3a\xe1g\xfb\xc0\xaeD\xae\x8d\x99\t\ + \x87\x96\t\x88\xcf\xe7\x9c\xcebV\xa8V\xc3u\xd1\xd4`\x92\x90\x14\xc3\x0fky\ + \xd1\xcc\xcc\xa7\x19@\xbd\x0c\x9e\xae~.\xeb\x9c\x12\x9a\x00R\xd6\x1f\x8b' , + + 'Log_On': + 'x\xda\xeb\x0c\xf0s\xe7\xe5\x92\xe2b``\xe0\xf5\xf4p\t\x02\xd2\xdc@\xcc\xce\ + \xc1\x06$\xef\xe5m\x8f\x05R,\xc5N\x9e!\x1c@P\xc3\x91\xd2\x01\xe4\xdbz\xba8\ + \x86T\xccI\x16\x11\x10HP\x10\xdb`\x00\x045?.\xfc\x9c?\xc1\x89\xb1\xb1\xc8MM\ + \xa2y\x82\x13\x1b\x10\xa8\x950\xc6p\x05\x8a$_n8\xe7\x1e\xd8\xb3\x86a\xb6o\ + \xcf\x92\x166\x86\xeb79\xf5\xf7\xa8}\xb4\x07\x1a\xc4\xe0\xe9\xea\xe7\xb2\xce\ + )\xa1\t\x00\xf4\xbb$/' , + 'Menu_MoveUp': 'x\xda\x01=\x01\xc2\xfe\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x0e\ *************** *** 806,809 **** --- 821,853 ---- \x00\x00\x00IEND\xaeB`\x82a1\x85Q' , + 'Log_Error': + 'x\xda\x01\xb3\x02L\xfd\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\ + \x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\x00\x00\x00\x04sBIT\x08\ + \x08\x08\x08|\x08d\x88\x00\x00\x02jIDATx\x9c\xa5\x93MH\x14q\x18\xc6\x7f\xb33\ + ;\xeb\xac\xeb\xee\xec\xf6\xa1\x16\x08\x12H\x08\tI\xd4!\xbbh\xa7(\x85$\xe8\ + \x90T\xd0!\xccKDT\xd0\x87\x12EP\x1d"\x0b)\x88\xba\x15!v\x89\xf4"}\x08\x89\ + \xa1X\x071\x8a\xcc\xcaL1\xd7\x1dwg\x9c\xd9\x99\xf9w0?+"z\x8f//\xbf\xe7}x\x9f\ + W\xd2u\x9d\xff)\xe5w\xcd\xca\x86F1\x13O0%\x05\x08\t\x9f\x90\xe7\x116Rt67J\ + \xcbg\xa5\xe5\x1b\x94_\xbc->\xf9.\xd9\xa0\n\x80\xe7\xfax\xe6\x0c\xb2p)\xd1T\ + \xfa\xce\x1c\x91\xfe\x08Xw\xfe\xa60\xf4\x18Z$\x8f\x1c\x04\xe6t\x1a\xcf\xf5\ + \x010\xb3\x0e\x13c\x93\x14\xab\n_.\x1d\x9d\x87\x04\x16+\xdb\xb1\x18E1\x8d\ + \x12s\x82`XfUQ!\xe1\x88\x86\x99uXi\x1alLh\x0c9.\xa5g\x9b\xc5\x12@eC\xa3\x18V\ + \x02\x04W\xc4)\xf5fx\xb0\xb7\x86\x9a\x80\x87c\x9b\xf8\xb9a\n\xac\x14\xed\x07\ + ws\xa5j\x139\xce\x0c\x83\x19\x9b\xad\x87N\x88y@2\x9e\x00E!\xa2\x06\x19\x90s\ + \xe8\x1cx\xcb\xb1\xca\nvH.\xb9C\x1fh\xdbW\x8d\x16Th\xea\xecA\x8bF\xb0\x85\ + \xcfTT_\xb8B64\xeb\xc4L\xa6\x90\xd7\xac\xa6i\xf0#\x00\'\xab\xb6q\xb0<\t@\xf5\ + \x9dG\xbc\xb6@\x95\x14\x84\xeb\xe0\xa8\xca\x82\x05\xdf\x99\xf5c\xd86\xd3_\ + \xc7\xf9\xe6\x07i\xe9\xee\x07 ?\x1e\xa7\xeb\xdd\x10\xdd\xa3\x93\xe8z.\xb2pg\ + \xc5\xc4\xa2\x1cH\xe9i,)H,\x16f\xccH\xb2\x01\x8b{\x07j\x99\x9cN\xd3\xffy\x84\ + \xda\xcd\xe5\x98N\x96\xfa\x8e^\xc2\x91(\x9e\xeb\xa2+\x01F\xe6\x00\xf1\xac\ + \xc3p\xd6$\x95\x82r\xcd\xe5~]-\x00\x87\x1f>\xe6\xe9\xf0wn\xed\xb2\xa8\xab\ + \xd8\x02@}G/2\x105\xcd\x05\x0b]\xd7\xcfI\xf9\xb2\xccTr\x8aDH\xc5\xb0,\xf6\ + \xdcm\xa5}4\x83VX\xc0\xfe\xb6\xe7\xb4\xf6\xf4\xb16\xa1c\xa5\x0c\x8a\xb5\x1c^\ + \xb6\\\x90\x96\x04i\xe7\xf1\xcb\xe2\x99\xef3n\xb9D\x02>"\x14& +\xf8\x9e\x8b-\ + |D:\x83\x95\xc9\x90\x88G\xd9.\\:n4-\x05\xccA\xde\xa8*\xef\x93\x06\xde\xcf\ + \x8c\xc9\xf8\xd8\x8e\x07\xc2g\xbd\x9eG\x99k\xf3\xe4\xda\xe9\xf9$\xfe\xf2\x0b\ + s\xa0\x89\xa0\xc2+#\r@Y<F\xc4\xcc\xf0\xe2\xea\xa9\xbf?\xd3\xbf\xd6\x0fVu\x02\ + \xa4A\xcb\xde\x97\x00\x00\x00\x00IEND\xaeB`\x82\xa5[50' , + 'AboutIcon': 'x\xda\x01\xfb\x06\x04\xf9\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00&\ *************** *** 877,880 **** --- 921,972 ---- \xd7\xb6\xcd\xff\x04,\x12\t\xf3\xedg\x9e\xe6\xa5#/\xb7ms[\x7fC\xbd\x97\xf6/\ \xbf\x05\xdb\x82Q\xb7\xaa\x00\x00\x00\x00\x00IEND\xaeB`\x82\x0e\x1fU\xe3' , + + 'Log_Fatal': + 'x\xda\x01\x16\x02\xe9\xfd\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\ + \x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\x00\x00\x00\x04sBIT\ + \x08\x08\x08\x08|\x08d\x88\x00\x00\x01\xc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\ + \xc0\x05\xd7e\x7f5\xaa\xee\r#EZ\x1d\x8c5\x1c\xac\x84\x14R\xaf\x9e\x1e\xa5\ + \xe0\xba\x1c\xac\x84\x8cu\xeaw\x02Nb\xa6\x92R\xe6E,\xecO\xe1\x9c\xbe\x00x-f\ + \x92\xbe\x0cf~p\xd2nL\xcc\xf4\xfc\xf14\x00t\xe3=m&\xe7\x7f\xed\xfc\x0f\xf6\ + \x88\xd2Q\xa6E\x86\xd7\x00\x00\x00\x00IEND\xaeB`\x82\xbc_\xf0\xfb' , + + 'Log_Info': + 'x\xda\x01C\x02\xbc\xfd\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\ + \x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\x00\x00\x00\x04sBIT\x08\ + \x08\x08\x08|\x08d\x88\x00\x00\x01\xfaIDATx\x9c\xa5\x93=kTA\x14\x86\x9f\xb9{\ + ?\x9c\xbdw\xc3]4A\x02&\xa0\x12\x82H\xc4\xc2V"\xfe\x00+\x1b#ha\x91\xdeU\x08\ + \x04\xb1P\x08\xb2)\xc5\x14\x16Z\x04,\xac\xfc\x05\xfe\x03\x11\x0bqU\x90\x98\ + \x0fIP\xe3f\x93\xfb93\x16ws\xd7\xcd*"\xbe\xcd\x9c9\xcc\xfbr\xdes\xce\x880\ + \x0c\xf9\x1f\xd8\xbfK^Zxb>m}\xa1\x1d\xc7(#\xa8K\x8f\xf1#Gy1w]\x1c|+\x0eV0>;o\ + >tRv\x8d\xd3\x97\xf7E\xc6\x89\xc0ae\xe9\xbe\xf8\xa3\xc0\xd0\xb5\x9bf%?\x84\ + \xe398\x8e\x83\xb0\x04Zk\xb2$#\xcfr\x00\xc6\xec\x98\xf6\xd3E1 06;o\xde\xech<\ + _"}\x89\xeb\xb9\x85\x80\xd2$qB\xbc\x1b\x93D\t\x02\xc3\xe9\x9a\xc5\xe7\xa5{\ + \x02\xc0\x02\xb8x\xf7\x91y\xd7N\xb1=\x17\xe9KN\x86\x1e\xc7\xeaU6n]%\x08\x03\ + \x82Z\x15\xdf\x16\xd8v\x05\x83\xa0\xd5N\x99\xbe\xf3\xd0\x94\x02k\xdf\xbf\x92\ + \x08\x07\xc7up=\x97\xd5T\xb0\xd6\x8e\x19m.\x13\x04\x12m\xba}\xf0\x8a\x9e\'\ + \xc2ac\xfb[o\n\x9d$-\xfcX\x02\xabb\x01\xb0\xde\x98\x01`\xb4\xb9\\\xf6\xa8b\ + \xf5\xfa\xd7I\x0b\x8e\x05\xa0\x8c\x06@+\x8dRj\x80X\xc2\x982T\xdd\xd8\x02\x08\ + <\x0f\x80<\xcdI\xe3t\x90\xd8\x85\xce\xf32\xae\xb9nO\xe0\xb0\x1fP1\x8a,\xcd\ + \x88:Q\x9f\x85\xf5\xc6\x0c\xe7\x86\xdc\xbe\n*FQ\xaf\xfa\x85\xed\xfd1\x8e\xdc\ + \x983\xad\xa8\xf0?1\\\xc3\x08\xc1\xea^\x86V\x9a,-\xce}LH\xc5\xe6\xe3\x85\xde\ + \x18\x01.\x9c:\xc3\x88\x15\x03\xd0\xda\xda\xe1\xfdf\x9b\xa8\x13\x91DI\x1fy\ + \xd8\x8a9?9U\xde\xfb6\xf1\xf2\xe23\xf3\xf2\xedk>F\xa0{\xda]\xaf\x9a\xe3\xd20\ + =9\xc5\xf3\xc6\x95\xc1M\xfc\x15g\x1b\x0f\xccv\xb4\xc7\x8f(B#\x08\xa5\xa4.%\ + \xaf\x9a\xb7\xff\xfe\x99\xfe\x15?\x01\xb9[\xc6\xcc(,\xb6\x86\x00\x00\x00\x00\ + IEND\xaeB`\x82\xe1f\x00\xc6' , 'Icon_Small': |