examples: python bindings

* Fixed homedir specifying logic in several cases.
This commit is contained in:
Ben McGinnes 2018-09-27 09:57:50 +10:00
parent b625258d54
commit 7c9f49a499
5 changed files with 10 additions and 10 deletions

View File

@ -62,9 +62,9 @@ elif homedir.startswith("~"):
else:
homedir = os.path.realpath(homedir)
if os.path.exists(homedir) is False:
if homedir is not None and os.path.exists(homedir) is False:
homedir = None
else:
elif homedir is not None and os.path.exists(homedir) is True:
if os.path.isdir(homedir) is False:
homedir = None
else:

View File

@ -62,9 +62,9 @@ elif homedir.startswith("~"):
else:
homedir = os.path.realpath(homedir)
if os.path.exists(homedir) is False:
if homedir is not None and os.path.exists(homedir) is False:
homedir = None
else:
elif homedir is not None and os.path.exists(homedir) is True:
if os.path.isdir(homedir) is False:
homedir = None
else:

View File

@ -65,9 +65,9 @@ elif homedir.startswith("~"):
else:
homedir = os.path.realpath(homedir)
if os.path.exists(homedir) is False:
if homedir is not None and os.path.exists(homedir) is False:
homedir = None
else:
elif homedir is not None and os.path.exists(homedir) is True:
if os.path.isdir(homedir) is False:
homedir = None
else:

View File

@ -74,9 +74,9 @@ elif homedir.startswith("~"):
else:
homedir = os.path.realpath(homedir)
if os.path.exists(homedir) is False:
if homedir is not None and os.path.exists(homedir) is False:
homedir = None
else:
elif homedir is not None and os.path.exists(homedir) is True:
if os.path.isdir(homedir) is False:
homedir = None
else:

View File

@ -60,9 +60,9 @@ elif homedir.startswith("~"):
else:
homedir = os.path.realpath(homedir)
if os.path.exists(homedir) is False:
if homedir is not None and os.path.exists(homedir) is False:
homedir = None
else:
elif homedir is not None and os.path.exists(homedir) is True:
if os.path.isdir(homedir) is False:
homedir = None
else: