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

No "Save as" use case documentation #220

Closed
basak opened this issue Dec 15, 2020 · 4 comments
Closed

No "Save as" use case documentation #220

basak opened this issue Dec 15, 2020 · 4 comments

Comments

@basak
Copy link
Contributor

basak commented Dec 15, 2020

Hi,

Thank you for pykeepass!

I'd like to open a database, make some changes, then save it under a different filename. I could copy the file first (eg. with shutil.copyfile), but an explicit save_as() method on the PyKeePass object would be nice. Alternatively, looking at the code, I could trivially modify the filename attribute, but that might interfere with a solution to #219 so I avoided that. It'd be great to have some explicit, supported, documented way of doing this.

Thanks!

@Evidlo
Copy link
Member

Evidlo commented Dec 15, 2020 via email

@basak
Copy link
Contributor Author

basak commented Dec 16, 2020

Sorry, I forgot some of the details I had in mind when I wrote up the issue, so I wasn't clear. save() with a filename argument doesn't look like it'll change the filename attribute. So the PyKeePass instance will still be associated with the original filename. In my case, that's dangerous because I'll have removed entries and really don't want to accidentally modify the original database. So I want the PyKeePass instance to end up associated with the new filename only, with no remaining references to the old name.

Looking at the code, I could modify the filename attribute directly and this would work today, but it isn't clear if this is part of the API that this will disassociate the old name, or if it might break in future. So what I'm requesting is more a specific API-specified method to disassociate with an old filename that I no longer want to touch.

@Evidlo
Copy link
Member

Evidlo commented Dec 17, 2020

Setting kp.filename is the intended way to do this.

Writing up proper Sphinx documentation is on the todo list which should clear this up in the future.

@basak
Copy link
Contributor Author

basak commented Dec 18, 2020

Great, thanks! I guess that reduces this issue to just a documentation request then.

@basak basak changed the title No "Save as" method No "Save as" use case documentation Dec 18, 2020
@Evidlo Evidlo closed this as completed Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants