openshot.developers team mailing list archive
-
openshot.developers team
-
Mailing list archive
-
Message #00167
Re: Lock file location and multi-user systems?
On Wed, 2009-08-26 at 12:41 -0500, Jonathan Thomas wrote:
> TJ, I think there is a simple answer to all of this. The lock file
> needs to be moved to the ~./openshot/ folder for sure. However, the
> lock file is only used for a very specific purpose. It is to prevent
> Nautilus from launching multiple copies of OpenShot when you open many
> files at once with "openshot".
Maybe I read too much into it - I'm too used to the POSIX/Linux use of
lock files :)
> Under any other circumstance, OpenShot will run as multiple
> instances just fine.
Hmmm, maybe I've got ahead of myself somewhere here. I've got it in my
mind that the relocated "~/.openshot/thumbnail/" might cause a conflict
especially if the same clips are being edited in multiple instances by
the same user - I guess it depends on the naming scheme for the
thumbnails though.
> Only 1 instance needs to write to the lock file. When the program
> starts up, it will compare the pid in the lock file to the current
> list of running pids, and replace it if it's not found running. So,
> there is no delete code.
Ahhh, this relates to lock.run() and
if os.getpid() == pid
so that makes sense.
> Other than moving the file to its new ~./openshot/ location, I don't
> think there is anything we need to do. Does that make sense?
I think it does, yes. The reason I was tackling this is I've re-factored
the launch scripts as described previously (/usr/bin/openshot which then
imports openshot.openshot.main() which is a refactored OpenShot.py) and
hit issues with the lock file creation being denied, so had to tackle it
immediately to move ahead with testing.
Thanks for baring with my learning-curve, it's a pretty steep one since
I have a strong dislike for Python and only use it grudgingly :p
References