Skip to content

Commit

Permalink
pttkview - dos_newlines hard coded to on
Browse files Browse the repository at this point in the history
Refactored so it can be configurable in the future.
  • Loading branch information
clach04 committed May 1, 2023
1 parent a420994 commit 4e82bab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions puren_tonbo/tools/pttkview.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def usage():
in_file.close()
plain_str = plain_str_bytes.decode(note_encoding) # TODO review other usage of list of encodings..
print('plain_str: %r' % plain_str)
plain_str = plain_str.replace('\r', '') # assume windows newlines
dos_newlines = True # assume windows newlines
if dos_newlines:
plain_str = plain_str.replace('\r', '')

main_window = tkinter.Tk() # TODO title (icon?)
main_window.title('pttkview - ' + os.path.basename(in_filename))
Expand All @@ -106,7 +108,7 @@ def save_file(p=None, evt=None):
#print('%r' % (buffer_plain_str == plain_str))
# reuse handler, no need to reinit
try:
puren_tonbo.note_contents_save_filename(buffer_plain_str, filename=in_filename, handler=handler, note_encoding=note_encoding)
puren_tonbo.note_contents_save_filename(buffer_plain_str, filename=in_filename, handler=handler, note_encoding=note_encoding, dos_newlines=dos_newlines)
# if save successful (no exceptions);
st.edit_modified(False)
st.edit_separator()
Expand Down

0 comments on commit 4e82bab

Please sign in to comment.