Make sure that multiple instances of ok aren't running

This commit makes sure that multiple instances of ok aren't running. Here's how it works:

- It checks for a file called .ok_lock. If it's there, then it asks the user to check if another ok is running somewhere. If it isn't, then they should type in 'Run ok anyway'. If not, they can type in anything else and it'll exit.

- If no file called .ok_lock exists, it makes it and removes it at the end of the ok run.
If people force quit OK, the .ok_lock file will remain. I'm not convinced
that this solution is a good idea. Are we sure we're solving a problem that
needs to be solved?

What's wrong with having multiple versions running simultaneously? Lots of
applications have dealt with the issue of multiple programs editing a file
simultaneously, and I think the solution is rarely to create a lock that
might not get cleaned up.

On Thu, Oct 16, 2014 at 11:15 AM, albert12132 <notifications@github.com>
wrote:

> In client/cli/ok.py:
>
> > @@ -98,6 +100,16 @@ def main():
> >      """Run all relevant aspects of ok.py."""
> >      args = parse_input()
> >
> > +    if os.path.isfile(OK_LOCK):
> > +        password = input("You might have ok running in another tab- if you are"
>
> The term "tab" is probably too specific -- this problem would occur even
> if students have multiple terminal windows open. Something like "multiple
> instances of ok running at the same time."
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Cal-CS-61A-Staff/ok/pull/265/files#r18974762>.
>