def get_base_dir():

    # Configured setting
    backup_dir = settings.get('backup_dir', '')
    if backup_dir != '':
        return os.path.expanduser(backup_dir)

    # Windows: <user folder>/My Documents/Sublime Text Backups
    if sublime.platform() == 'windows':
        return os.path.join(
            win32helpers.get_shell_folder('Personal'),
            'Sublime Text Backups')

    # Linux/OSX/other: ~/sublime_backups
    return os.path.expanduser('~/.sublime/backups')
def get_base_dir():
    """Returns the base dir for where we should store backups.
    If not configured in .sublime-settings, we'll take a best guess
    based on the user's OS."""

    # Configured setting
    backup_dir = settings.get("backup_dir", "")
    if backup_dir != "":
        return os.path.expanduser(backup_dir)

    # Windows: <user folder>/My Documents/Sublime Text Backups
    if sublime.platform() == "windows":
        return os.path.join(win32helpers.get_shell_folder("Personal"), "Sublime Text Backups")

    # Linux/OSX/other: ~/sublime_backups
    return os.path.expanduser("~/.sublime/backups")
Example #3
0
def get_base_dir():
    """Returns the base dir for where we should store backups.
    If not configured in .sublime-settings, we'll take a best guess
    based on the user's OS."""

    # Configured setting
    backup_dir = settings.get('backup_dir', '')
    if backup_dir != '':
        return os.path.expanduser(backup_dir)

    # Windows: <user folder>/My Documents/Sublime Text Backups
    if sublime.platform() == 'windows':
        return os.path.join(win32helpers.get_shell_folder('Personal'),
                            'Sublime Text Backups')

    # Linux/OSX/other: ~/sublime_backups
    return os.path.expanduser('~/.sublime/backups')