Commit 336a9011 authored by Christof Schulze's avatar Christof Schulze 😎
Browse files

added path creatin mode (permissions),

    minor cleanups
parent 58c35285
Loading
Loading
Loading
Loading
+2 −14
Original line number Diff line number Diff line
@@ -38,20 +38,8 @@ else:
        # curses returns an error (e.g. could not find terminal)
        IS_COLOR = False

# if C.IS_FORCE_COLOR:
#     IS_COLOR = True


# class BColors:
#     HEADER = '\033[95m'
#     OKBLUE = '\033[94m'
#     CHANGED = '\033[94m'
#     OKGREEN = '\033[92m'
#     WARNING = '\033[93m'
#     ERROR = '\033[91m'
#     ENDC = '\033[0m'
#     BOLD = '\033[1m'
#     UNDERLINE = '\033[4m'
if C.IS_FORCE_COLOR:
    IS_COLOR = True

# --- begin "pretty"
#
+2 −2
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ def makedirs_safe(path, mode=None):
    chance the parent directory might be world-writable (eg, /tmp) to prevent symlink hijacking and potential
    disclosure or modification of sensitive file contents.
    :param path: A byte or text string representing a directory chain to be created
    :param mode: If given, the mode to set the directory to
    :param mode: If given, the mode (permissions) to set the directory to [default mode=0o777]
    :raises AMMSMLError: If the directory cannot be created and does not already exist.
    :raises UnicodeDecodeError: if the path is not decodable in the utf-8 encoding.
    """
@@ -131,6 +131,6 @@ def cleanup_tmp_file(path, warn=False):
                    # Importing here to avoid circular import
                    from ammsml.utils.display import Display
                    display = Display()
                    display.display(u'Unable to remove temporary file {0}'.format(to_text(e)))
                    display.display('Unable to remove temporary file {0}'.format(to_text(e)))
    except Exception:
        pass