Esempio n. 1
0
 def show_top_line(self, fname, prefix='', last=0):
     htxt = UTIL.read_top_lines(fname, nlines=1, strip=1, verb=0)
     if len(htxt) == 0: htxt = 'NONE FOUND'
     else: htxt = htxt[0]
     # possibly truncate to '...' and final 'last' characters
     if last > 0 and len(htxt) > last:
         htxt = '...' + htxt[-last:]
     print('%s%s' % (prefix, htxt))
Esempio n. 2
0
 def show_top_line(self, fname, prefix='', last=0):
    htxt = UTIL.read_top_lines(fname, nlines=1, strip=1, verb=0)
    if len(htxt) == 0: htxt = 'NONE FOUND'
    else:              htxt = htxt[0]
    # possibly truncate to '...' and final 'last' characters
    if last > 0 and len(htxt) > last:
       htxt = '...' + htxt[-last:]
    print '%s%s' % (prefix, htxt)
Esempio n. 3
0
 def show_top_line(self, fname, prefix=''):
    htxt = UTIL.read_top_lines(fname, nlines=1, strip=1, verb=0)
    if len(htxt) == 0: htxt = 'NONE FOUND'
    else:              htxt = htxt[0]
    print '%s%s' % (prefix, htxt)
Esempio n. 4
0
 def show_top_line(self, fname, prefix=''):
     htxt = UTIL.read_top_lines(fname, nlines=1, strip=1, verb=0)
     if len(htxt) == 0: htxt = 'NONE FOUND'
     else: htxt = htxt[0]
     print '%s%s' % (prefix, htxt)