Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PICARD-1192: Add .txt extension in path if no extension is there #837

Closed
wants to merge 1 commit into from
Closed

PICARD-1192: Add .txt extension in path if no extension is there #837

wants to merge 1 commit into from

Conversation

vishichoudhary
Copy link
Contributor

@vishichoudhary vishichoudhary commented Feb 12, 2018

Summary

  • This is a…
    • Bug fix
    • Feature addition
    • Refactoring
    • Minor / simple change (like a typo)
    • Other
  • Describe this change in 1-2 sentences:

Problem

Currently if you click on save as option in log dialog. And if you doesn't specify .txt or .TXT format it will not save that file

Solution

I simply check the file and if there isn't any .txt or .TXT extension add '.txt' extension

Action

@vishichoudhary vishichoudhary changed the title Add .txt extension in path if no extension is there PICARD-1192: Add .txt extension in path if no extension is there Feb 12, 2018
@@ -248,6 +248,8 @@ def _save_log_as_do(self):
filter=_("Text Files (*.txt *.TXT)"),
options=QtWidgets.QFileDialog.DontConfirmOverwrite
)
if not path.endswith('.txt') and not path.endswith('.TXT'):
path = path + '.txt'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily wanted behaviour. Logs may also be stored with a different extension like picard.log or even without an extension.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I am not entirely sure the intentions with which this feature was implemented since there is a text file filter above. @zas any thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samj1912 i don't know why this happens. This was a small fix. Though what i found interesting is that write operation gives output False if you havn't specifiy any extension

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, imho we should remove filter=_("Text Files (*.txt *.TXT)"), this is why it fails if none of those extensions is set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zas removing the filter doesn't seem to have any effect on it. Let me just check the reason behind this behaviour.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I implemented a fix in #840

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants