def makeintro(self,postingconfig):
        '''Reduce the headline text in very long posts if needed'''
        postwords = self.posttext.replace('\n',' NEWLINE ').split()
        leeway = postingconfig.as_int('leeway')
        choplen = postingconfig.as_int('choplen')
        longpost = postingconfig.as_int('longpost')
        if len(postwords) < leeway:
            self.headline = self.posttext
        else:
            self.headline = ' '.join(postwords[:choplen]).replace('NEWLINE','')+'...'
            self.intro = '...'+' '.join(postwords[choplen:longpost])
        return
dataset/ETHPy150Open mikemaccana/imeveryone/usermessages.py/Message.makeintro/original