Source code for hylite.Pileup_Reader

#!/usr/bin/env python3

#    (c) Copyright 2013-2018 Murray Cox, Wandrille Duchemin, Pierre-Yves Dupont.
#
#
#    This file is part of HyLiTE.
#
#    HyLiTE is a free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License version 3 as published by
#    the Free Software Foundation.
#
#    HyLiTE 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 HyLiTE.  If not, see <http://www.gnu.org/licenses/>


#===============================#
# author: Wandrille Duchemin    #
#         Murray Cox            #
# last modified: 9 January 2018 #
#===============================#


from .Generic_Pileup_Reader import Generic_Pileup_Reader
from .Picklablefile import Picklablefile



[docs]class Pileup_Reader(Generic_Pileup_Reader): '''This class is used to access the information contained in a .pileup file containing all parents Attributes: - handle (Picklablefile)''' def __init__(self, filename): ''' Args: - filename (str): the name of the .pileup file ''' Generic_Pileup_Reader.__init__(self, filename) self.handle = Picklablefile(open(filename, "r"))
[docs] def give_line(self): ''' Yieds: - str. a line from the .pileup file ''' # for l in self.handle.readlines(): # yield l while True : l = self.handle.readline() if not l: break yield l
[docs] def close(self): ''' Close the .pileup file ''' self.handle.close() return