I just extended the plugin: It can now import & export!
@dreichl: I have two questions regarding logging.
The passwords need to be generated during import (PfP is a "stateless password manager") which takes a long time to complete (on my system ~1.5 s per entry). Therefore, I think it is important to show some progress to the user. Currently, the UI hangs.
Do you agree to do the password generation in another thread?
Or is there a specific design pattern in KeePass for operations like this?
Ok, I've moved your plugin to the 'Import & Export' group on the plugins page.
If the import takes a long time, I'd recommend to periodically call the method SetProgress or ContinueWork of IStatusLogger (for instance every 50 milliseconds). This causes the UI to be updated, i.e. KeePass won't appear as hanging.
Passing the IStatusLogger down into the cryptographic routines (to call SetProgress or ContinueWork there) doesn't make sense. Therefore, I think that your idea of performing the password generation in a separate thread is good. The main thread (which is executing your PfpFormatProvider.Import method) can then call SetProgress or ContinueWork periodically while the thread is performing the computation.
Calling the SetText method of IStatusLogger is ok, but not necessary here. Please don't call the StartLogging and EndLogging methods; KeePass is calling these itself.
Thanks and best regards,
Dominik
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I developed a plugin to import passwords from Wladimir Palant's Pain-free Passwords.
It will be able to export password entries soon.
The reason is that I normally use PFP in Chrome and KeePass DX on mobile. To ease the conversion, I wrote this plugin.
Source and Plugin: https://github.com/adrium/KeepassPfpConverter
Great, thanks for developing this plugin!
I've added it to the plugins page:
https://keepass.info/plugins.html#pfpconv
Best regards,
Dominik
I just extended the plugin: It can now import & export!
@dreichl: I have two questions regarding logging.
The passwords need to be generated during import (PfP is a "stateless password manager") which takes a long time to complete (on my system ~1.5 s per entry). Therefore, I think it is important to show some progress to the user. Currently, the UI hangs.
Do you agree to do the password generation in another thread?
Or is there a specific design pattern in KeePass for operations like this?
Is it correct to only use IStatusLogger.SetText() and IStatusLogger.SetProgress()?
I tried this in branch dev: https://github.com/adrium/KeepassPfpConverter/tree/dev
However, I see OnePIF also uses IStatusLogger.StartLogging() and IStatusLogger.EndLogging()...
https://github.com/juanii/OnePIF/blob/master/OnePIF/OnePIFFormatProvider.cs
I realised that the compatibility was miserable... I corrected the issue and the plugin should be usable on all platforms now.
Ok, I've moved your plugin to the 'Import & Export' group on the plugins page.
If the import takes a long time, I'd recommend to periodically call the method
SetProgressorContinueWorkofIStatusLogger(for instance every 50 milliseconds). This causes the UI to be updated, i.e. KeePass won't appear as hanging.Passing the
IStatusLoggerdown into the cryptographic routines (to callSetProgressorContinueWorkthere) doesn't make sense. Therefore, I think that your idea of performing the password generation in a separate thread is good. The main thread (which is executing yourPfpFormatProvider.Importmethod) can then callSetProgressorContinueWorkperiodically while the thread is performing the computation.Calling the
SetTextmethod ofIStatusLoggeris ok, but not necessary here. Please don't call theStartLoggingandEndLoggingmethods; KeePass is calling these itself.Thanks and best regards,
Dominik
Thanks for the hints Dominik.
I released a new version with improved logging and custom fields support.