from __future__ import absolute_import
from textwrap import dedent


class UserError(Exception):
    def __init__(self, msg):
        self.msg = dedent(msg).strip()

    def __unicode__(self):
        return self.msg


class DockerNotFoundMac(UserError):
    def __init__(self):
        super(DockerNotFoundMac, self).__init__("""
Couldn't connect to Docker daemon. You might need to install docker-osx:

https://github.com/noplay/docker-osx
""")


class DockerNotFoundUbuntu(UserError):
    def __init__(self):
        super(DockerNotFoundUbuntu, self).__init__("""
Couldn't connect to Docker daemon. You might need to install Docker:

http://docs.docker.io/en/latest/installation/ubuntulinux/
""")


class DockerNotFoundGeneric(UserError):
    def __init__(self):
        super(DockerNotFoundGeneric, self).__init__("""
Couldn't connect to Docker daemon. You might need to install Docker:

http://docs.docker.io/en/latest/installation/
""")


class ConnectionErrorDockerOSX(UserError):
    def __init__(self):
        super(ConnectionErrorDockerOSX, self).__init__("""
Couldn't connect to Docker daemon - you might need to run `docker-osx shell`.
""")


class ConnectionErrorGeneric(UserError):
    def __init__(self, url):
        super(ConnectionErrorGeneric, self).__init__("""
Couldn't connect to Docker daemon at %s - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
""" % url)


class FigFileNotFound(UserError):
    def __init__(self, filename):
        super(FigFileNotFound, self).__init__("""
Can't find %s. Are you in the right directory?
""" % filename)

@@ -316,32 +316,40 @@
 f).__init__(%22%22%22%0A
+        
 Couldn't connect
@@ -406,16 +406,24 @@
 r-osx:%0A%0A
+        
 https://
@@ -451,16 +451,24 @@
 ker-osx%0A
+        
 %22%22%22)%0A%0A%0Ac
@@ -576,32 +576,40 @@
 f).__init__(%22%22%22%0A
+        
 Couldn't connect
@@ -654,32 +654,40 @@
 nstall Docker:%0A%0A
+        
 http://docs.dock
@@ -728,16 +728,24 @@
 ulinux/%0A
+        
 %22%22%22)%0A%0A%0Ac
@@ -855,32 +855,40 @@
 f).__init__(%22%22%22%0A
+        
 Couldn't connect
@@ -941,16 +941,24 @@
 ocker:%0A%0A
+        
 http://d
@@ -995,16 +995,24 @@
 lation/%0A
+        
 %22%22%22)%0A%0A%0Ac
@@ -1128,32 +1128,40 @@
 f).__init__(%22%22%22%0A
+        
 Couldn't connect
@@ -1222,16 +1222,24 @@
 shell%60.%0A
+        
 %22%22%22)%0A%0A%0Ac
@@ -1364,16 +1364,24 @@
 t__(%22%22%22%0A
+        
 Couldn't
@@ -1430,16 +1430,24 @@
 nning?%0A%0A
+        
 If it's 
@@ -1533,16 +1533,24 @@
 riable.%0A
+        
 %22%22%22 %25 ur
@@ -1672,16 +1672,24 @@
 t__(%22%22%22%0A
+        
 Can't fi
@@ -1727,16 +1727,24 @@
 ectory?%0A
+        
 %22%22%22 %25 fi

Indent string literals