add latest changes from march'17
This commit is contained in:
@@ -6,18 +6,18 @@ class PBinCLIException(Exception):
|
||||
|
||||
|
||||
def check_readable(f):
|
||||
"""Checks if path exists and readable"""
|
||||
# Checks if path exists and readable
|
||||
if not os.path.exists(f) or not os.access(f, os.R_OK):
|
||||
raise PBinCLIException("Error accessing path: {}".format(f))
|
||||
|
||||
|
||||
def check_writable(f):
|
||||
"""Checks if path is writable"""
|
||||
# Checks if path is writable
|
||||
if not os.access(os.path.dirname(f) or ".", os.W_OK):
|
||||
raise PBinCLIException("Path is not writable: {}".format(f))
|
||||
|
||||
|
||||
"""http://stackoverflow.com/a/33571117"""
|
||||
# http://stackoverflow.com/a/33571117
|
||||
def json_load_byteified(file_handle):
|
||||
return _byteify(
|
||||
json.load(file_handle, object_hook=_byteify),
|
||||
|
||||
Reference in New Issue
Block a user