Trees | Indices | Help |
|
---|
|
1 ########################################################################### 2 # 3 # This program is part of Zenoss Core, an open source monitoring platform. 4 # Copyright (C) 2009, Zenoss Inc. 5 # 6 # This program is free software; you can redistribute it and/or modify it 7 # under the terms of the GNU General Public License version 2 as published by 8 # the Free Software Foundation. 9 # 10 # For complete information please visit: http://www.zenoss.com/oss/ 11 # 12 ########################################################################### 13 14 import os 15 import time 16 from cStringIO import StringIO 17 # posixfile module is deprecated, so defining ourselves 18 SEEK_END = 2 19 20 EOF_MARKER = '<<<<<EOF>>>>>' 21 MESSAGE_MARKER = '<<<<<JOBMESSAGE>>>>>' 22248526 self.status = status 27 self.finished = status.isFinished() 28 self.filename = logfilename 29 fn = self.getFilename() 30 self.openfile = open(fn, "a+")3133 return self.filename34 3739 return self.status4042 if self.openfile: 43 # Don't close this, because we're using it to write 44 return self.openfile 45 # Please to enjoy a read-only handle 46 return open(self.getFilename(), "r")47 52 5658 f = self.getFile() 59 offset = 0 60 f.seek(0, SEEK_END) 61 remaining = f.tell() 62 return self.generate_lines(f, offset, remaining)63 69 76 7981 if self.openfile: 82 self.write('\n%s' % EOF_MARKER) 83 os.fsync(self.openfile.fileno()) 84 del self.openfile
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Thu May 7 11:46:21 2009 | http://epydoc.sourceforge.net |