Skip to content

Commit

Permalink
blank lines now written to fill page, file handling improved
Browse files Browse the repository at this point in the history
  • Loading branch information
mpentler committed Feb 10, 2018
1 parent 95fa430 commit 5539bd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions teletext-twitter/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def write_tweet_line(file, line_num, line, config):
def write_header(file, subpage, config): # write a header for the page and pop a nice banner at the top
page_title = config["page_title"] + " " + "{:02d}".format(subpage)
logo_spacer = " " * (39 - (4 + len(page_title) + 5))
if subpage == 1:
if subpage == 1: # we only want these lines once
file.write("DE,Autogenerated by Teletext-Twitter\r\n")
file.write("SC,0000\r\n")
file.write("PS,8000\r\n")
Expand Down Expand Up @@ -73,7 +73,7 @@ def write_tweets(twitter_object, mode, count, config, query=None): # grab the la
for blankline_position in range(line_position, 25): # how many blank lines do we need?
file.write("OL,{},\r\n".format(blankline_position))
subpage += 1 # start a new page
write_header(file, subpage, config) # append mode to do subpages
write_header(file, subpage, config)
line_position = 4 # and reset our cursor
write_tweet_info(file, line_position, tweet_username, tweet_human_time, config)
line_position += 1
Expand Down

0 comments on commit 5539bd9

Please sign in to comment.