We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Critical error! Using .mackup as directory option deletes application configs
I used the following config as `~/.mackup.cfg` 
```
[storage]
engine = file_system
path = /Users/myuser
directory = .mackup
```

And running `mackup backup` deleted all my application configs because [this step](https://github.com/lra/mackup/blob/master/mackup/application.py#L114-L116) doesn't check if `home_filepath` is equal to `mackup_filepath` therefore copying files to `.mackup` then deleting `.mackup`...

Thanks a lot :(

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mackup/config.py`
Content:
```
1 """Package used to manage the .mackup.cfg config file."""
2 
3 import os
4 import os.path
5 
6 from .constants import (MACKUP_BACKUP_PATH,
7                         MACKUP_CONFIG_FILE,
8                         ENGINE_DROPBOX,
9                         ENGINE_GDRIVE,
10                         ENGINE_COPY,
11                         ENGINE_ICLOUD,
12                         ENGINE_BOX,
13                         ENGINE_FS)
14 
15 from .utils import (error,
16                     get_dropbox_folder_location,
17                     get_copy_folder_location,
18                     get_google_drive_folder_location,
19                     get_icloud_folder_location,
20                     get_box_folder_location)
21 try:
22     import configparser
23 except ImportError:
24     import ConfigParser as configparser
25 
26 
27 class Config(object):
28 
29     """The Mackup Config class."""
30 
31     def __init__(self, filename=None):
32         """
33         Create a Config instance.
34 
35         Args:
36             filename (str): Optional filename of the config file. If empty,
37                             defaults to MACKUP_CONFIG_FILE
38         """
39         assert isinstance(filename, str) or filename is None
40 
41         # Initialize the parser
42         self._parser = self._setup_parser(filename)
43 
44         # Do we have an old config file ?
45         self._warn_on_old_config()
46 
47         # Get the storage engine
48         self._engine = self._parse_engine()
49 
50         # Get the path where the Mackup folder is
51         self._path = self._parse_path()
52 
53         # Get the directory replacing 'Mackup', if any
54         self._directory = self._parse_directory()
55 
56         # Get the list of apps to ignore
57         self._apps_to_ignore = self._parse_apps_to_ignore()
58 
59         # Get the list of apps to allow
60         self._apps_to_sync = self._parse_apps_to_sync()
61 
62     @property
63     def engine(self):
64         """
65         The engine used by the storage.
66 
67         ENGINE_DROPBOX, ENGINE_GDRIVE, ENGINE_COPY, ENGINE_ICLOUD, ENGINE_BOX
68         or ENGINE_FS.
69 
70         Returns:
71             str
72         """
73         return str(self._engine)
74 
75     @property
76     def path(self):
77         """
78         Path to the Mackup configuration files.
79 
80         The path to the directory where Mackup is gonna create and store his
81         directory.
82 
83         Returns:
84             str
85         """
86         return str(self._path)
87 
88     @property
89     def directory(self):
90         """
91         The name of the Mackup directory, named Mackup by default.
92 
93         Returns:
94             str
95         """
96         return str(self._directory)
97 
98     @property
99     def fullpath(self):
100         """
101         Full path to the Mackup configuration files.
102 
103         The full path to the directory when Mackup is storing the configuration
104         files.
105 
106         Returns:
107             str
108         """
109         return str(os.path.join(self.path, self.directory))
110 
111     @property
112     def apps_to_ignore(self):
113         """
114         Get the list of applications ignored in the config file.
115 
116         Returns:
117             set. Set of application names to ignore, lowercase
118         """
119         return set(self._apps_to_ignore)
120 
121     @property
122     def apps_to_sync(self):
123         """
124         Get the list of applications allowed in the config file.
125 
126         Returns:
127             set. Set of application names to allow, lowercase
128         """
129         return set(self._apps_to_sync)
130 
131     def _setup_parser(self, filename=None):
132         """
133         Configure the ConfigParser instance the way we want it.
134 
135         Args:
136             filename (str) or None
137 
138         Returns:
139             SafeConfigParser
140         """
141         assert isinstance(filename, str) or filename is None
142 
143         # If we are not overriding the config filename
144         if not filename:
145             filename = MACKUP_CONFIG_FILE
146 
147         parser = configparser.SafeConfigParser(allow_no_value=True)
148         parser.read(os.path.join(os.path.join(os.environ['HOME'], filename)))
149 
150         return parser
151 
152     def _warn_on_old_config(self):
153         """Warn the user if an old config format is detected."""
154         # Is an old setion is in the config file ?
155         old_sections = ['Allowed Applications', 'Ignored Applications']
156         for old_section in old_sections:
157             if self._parser.has_section(old_section):
158                 error("Old config file detected. Aborting.\n"
159                       "\n"
160                       "An old section (e.g. [Allowed Applications]"
161                       " or [Ignored Applications] has been detected"
162                       " in your {} file.\n"
163                       "I'd rather do nothing than do something you"
164                       " do not want me to do.\n"
165                       "\n"
166                       "Please read the up to date documentation on"
167                       " <https://github.com/lra/mackup> and migrate"
168                       " your configuration file."
169                       .format(MACKUP_CONFIG_FILE))
170 
171     def _parse_engine(self):
172         """
173         Parse the storage engine in the config.
174 
175         Returns:
176             str
177         """
178         if self._parser.has_option('storage', 'engine'):
179             engine = str(self._parser.get('storage', 'engine'))
180         else:
181             engine = ENGINE_DROPBOX
182 
183         assert isinstance(engine, str)
184 
185         if engine not in [ENGINE_DROPBOX,
186                           ENGINE_GDRIVE,
187                           ENGINE_COPY,
188                           ENGINE_ICLOUD,
189                           ENGINE_BOX,
190                           ENGINE_FS]:
191             raise ConfigError('Unknown storage engine: {}'.format(engine))
192 
193         return str(engine)
194 
195     def _parse_path(self):
196         """
197         Parse the storage path in the config.
198 
199         Returns:
200             str
201         """
202         if self.engine == ENGINE_DROPBOX:
203             path = get_dropbox_folder_location()
204         elif self.engine == ENGINE_GDRIVE:
205             path = get_google_drive_folder_location()
206         elif self.engine == ENGINE_COPY:
207             path = get_copy_folder_location()
208         elif self.engine == ENGINE_ICLOUD:
209             path = get_icloud_folder_location()
210         elif self.engine == ENGINE_BOX:
211             path = get_box_folder_location()
212         elif self.engine == ENGINE_FS:
213             if self._parser.has_option('storage', 'path'):
214                 cfg_path = self._parser.get('storage', 'path')
215                 path = os.path.join(os.environ['HOME'], cfg_path)
216             else:
217                 raise ConfigError("The required 'path' can't be found while"
218                                   " the 'file_system' engine is used.")
219 
220         return str(path)
221 
222     def _parse_directory(self):
223         """
224         Parse the storage directory in the config.
225 
226         Returns:
227             str
228         """
229         if self._parser.has_option('storage', 'directory'):
230             directory = self._parser.get('storage', 'directory')
231         else:
232             directory = MACKUP_BACKUP_PATH
233 
234         return str(directory)
235 
236     def _parse_apps_to_ignore(self):
237         """
238         Parse the applications to ignore in the config.
239 
240         Returns:
241             set
242         """
243         # We ignore nothing by default
244         apps_to_ignore = set()
245 
246         # Is the "[applications_to_ignore]" in the cfg file ?
247         section_title = 'applications_to_ignore'
248         if self._parser.has_section(section_title):
249             apps_to_ignore = set(self._parser.options(section_title))
250 
251         return apps_to_ignore
252 
253     def _parse_apps_to_sync(self):
254         """
255         Parse the applications to backup in the config.
256 
257         Returns:
258             set
259         """
260         # We allow nothing by default
261         apps_to_sync = set()
262 
263         # Is the "[applications_to_sync]" section in the cfg file ?
264         section_title = 'applications_to_sync'
265         if self._parser.has_section(section_title):
266             apps_to_sync = set(self._parser.options(section_title))
267 
268         return apps_to_sync
269 
270 
271 class ConfigError(Exception):
272 
273     """Exception used for handle errors in the configuration."""
274 
275     pass
276
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/mackup/config.py b/mackup/config.py
--- a/mackup/config.py
+++ b/mackup/config.py
@@ -3,7 +3,8 @@
 import os
 import os.path
 
-from .constants import (MACKUP_BACKUP_PATH,
+from .constants import (CUSTOM_APPS_DIR,
+                        MACKUP_BACKUP_PATH,
                         MACKUP_CONFIG_FILE,
                         ENGINE_DROPBOX,
                         ENGINE_GDRIVE,
@@ -228,6 +229,10 @@
         """
         if self._parser.has_option('storage', 'directory'):
             directory = self._parser.get('storage', 'directory')
+            # Don't allow CUSTOM_APPS_DIR as a storage directory
+            if directory == CUSTOM_APPS_DIR:
+                raise ConfigError("{} cannot be used as a storage directory."
+                                  .format(CUSTOM_APPS_DIR))
         else:
             directory = MACKUP_BACKUP_PATH

{"golden_diff": "diff --git a/mackup/config.py b/mackup/config.py\n--- a/mackup/config.py\n+++ b/mackup/config.py\n@@ -3,7 +3,8 @@\n import os\n import os.path\n \n-from .constants import (MACKUP_BACKUP_PATH,\n+from .constants import (CUSTOM_APPS_DIR,\n+                        MACKUP_BACKUP_PATH,\n                         MACKUP_CONFIG_FILE,\n                         ENGINE_DROPBOX,\n                         ENGINE_GDRIVE,\n@@ -228,6 +229,10 @@\n         \"\"\"\n         if self._parser.has_option('storage', 'directory'):\n             directory = self._parser.get('storage', 'directory')\n+            # Don't allow CUSTOM_APPS_DIR as a storage directory\n+            if directory == CUSTOM_APPS_DIR:\n+                raise ConfigError(\"{} cannot be used as a storage directory.\"\n+                                  .format(CUSTOM_APPS_DIR))\n         else:\n             directory = MACKUP_BACKUP_PATH\n", "issue": "Critical error! Using .mackup as directory option deletes application configs\nI used the following config as `~/.mackup.cfg` \r\n```\r\n[storage]\r\nengine = file_system\r\npath = /Users/myuser\r\ndirectory = .mackup\r\n```\r\n\r\nAnd running `mackup backup` deleted all my application configs because [this step](https://github.com/lra/mackup/blob/master/mackup/application.py#L114-L116) doesn't check if `home_filepath` is equal to `mackup_filepath` therefore copying files to `.mackup` then deleting `.mackup`...\r\n\r\nThanks a lot :(\n", "before_files": [{"content": "\"\"\"Package used to manage the .mackup.cfg config file.\"\"\"\n\nimport os\nimport os.path\n\nfrom .constants import (MACKUP_BACKUP_PATH,\n                        MACKUP_CONFIG_FILE,\n                        ENGINE_DROPBOX,\n                        ENGINE_GDRIVE,\n                        ENGINE_COPY,\n                        ENGINE_ICLOUD,\n                        ENGINE_BOX,\n                        ENGINE_FS)\n\nfrom .utils import (error,\n                    get_dropbox_folder_location,\n                    get_copy_folder_location,\n                    get_google_drive_folder_location,\n                    get_icloud_folder_location,\n                    get_box_folder_location)\ntry:\n    import configparser\nexcept ImportError:\n    import ConfigParser as configparser\n\n\nclass Config(object):\n\n    \"\"\"The Mackup Config class.\"\"\"\n\n    def __init__(self, filename=None):\n        \"\"\"\n        Create a Config instance.\n\n        Args:\n            filename (str): Optional filename of the config file. If empty,\n                            defaults to MACKUP_CONFIG_FILE\n        \"\"\"\n        assert isinstance(filename, str) or filename is None\n\n        # Initialize the parser\n        self._parser = self._setup_parser(filename)\n\n        # Do we have an old config file ?\n        self._warn_on_old_config()\n\n        # Get the storage engine\n        self._engine = self._parse_engine()\n\n        # Get the path where the Mackup folder is\n        self._path = self._parse_path()\n\n        # Get the directory replacing 'Mackup', if any\n        self._directory = self._parse_directory()\n\n        # Get the list of apps to ignore\n        self._apps_to_ignore = self._parse_apps_to_ignore()\n\n        # Get the list of apps to allow\n        self._apps_to_sync = self._parse_apps_to_sync()\n\n    @property\n    def engine(self):\n        \"\"\"\n        The engine used by the storage.\n\n        ENGINE_DROPBOX, ENGINE_GDRIVE, ENGINE_COPY, ENGINE_ICLOUD, ENGINE_BOX\n        or ENGINE_FS.\n\n        Returns:\n            str\n        \"\"\"\n        return str(self._engine)\n\n    @property\n    def path(self):\n        \"\"\"\n        Path to the Mackup configuration files.\n\n        The path to the directory where Mackup is gonna create and store his\n        directory.\n\n        Returns:\n            str\n        \"\"\"\n        return str(self._path)\n\n    @property\n    def directory(self):\n        \"\"\"\n        The name of the Mackup directory, named Mackup by default.\n\n        Returns:\n            str\n        \"\"\"\n        return str(self._directory)\n\n    @property\n    def fullpath(self):\n        \"\"\"\n        Full path to the Mackup configuration files.\n\n        The full path to the directory when Mackup is storing the configuration\n        files.\n\n        Returns:\n            str\n        \"\"\"\n        return str(os.path.join(self.path, self.directory))\n\n    @property\n    def apps_to_ignore(self):\n        \"\"\"\n        Get the list of applications ignored in the config file.\n\n        Returns:\n            set. Set of application names to ignore, lowercase\n        \"\"\"\n        return set(self._apps_to_ignore)\n\n    @property\n    def apps_to_sync(self):\n        \"\"\"\n        Get the list of applications allowed in the config file.\n\n        Returns:\n            set. Set of application names to allow, lowercase\n        \"\"\"\n        return set(self._apps_to_sync)\n\n    def _setup_parser(self, filename=None):\n        \"\"\"\n        Configure the ConfigParser instance the way we want it.\n\n        Args:\n            filename (str) or None\n\n        Returns:\n            SafeConfigParser\n        \"\"\"\n        assert isinstance(filename, str) or filename is None\n\n        # If we are not overriding the config filename\n        if not filename:\n            filename = MACKUP_CONFIG_FILE\n\n        parser = configparser.SafeConfigParser(allow_no_value=True)\n        parser.read(os.path.join(os.path.join(os.environ['HOME'], filename)))\n\n        return parser\n\n    def _warn_on_old_config(self):\n        \"\"\"Warn the user if an old config format is detected.\"\"\"\n        # Is an old setion is in the config file ?\n        old_sections = ['Allowed Applications', 'Ignored Applications']\n        for old_section in old_sections:\n            if self._parser.has_section(old_section):\n                error(\"Old config file detected. Aborting.\\n\"\n                      \"\\n\"\n                      \"An old section (e.g. [Allowed Applications]\"\n                      \" or [Ignored Applications] has been detected\"\n                      \" in your {} file.\\n\"\n                      \"I'd rather do nothing than do something you\"\n                      \" do not want me to do.\\n\"\n                      \"\\n\"\n                      \"Please read the up to date documentation on\"\n                      \" <https://github.com/lra/mackup> and migrate\"\n                      \" your configuration file.\"\n                      .format(MACKUP_CONFIG_FILE))\n\n    def _parse_engine(self):\n        \"\"\"\n        Parse the storage engine in the config.\n\n        Returns:\n            str\n        \"\"\"\n        if self._parser.has_option('storage', 'engine'):\n            engine = str(self._parser.get('storage', 'engine'))\n        else:\n            engine = ENGINE_DROPBOX\n\n        assert isinstance(engine, str)\n\n        if engine not in [ENGINE_DROPBOX,\n                          ENGINE_GDRIVE,\n                          ENGINE_COPY,\n                          ENGINE_ICLOUD,\n                          ENGINE_BOX,\n                          ENGINE_FS]:\n            raise ConfigError('Unknown storage engine: {}'.format(engine))\n\n        return str(engine)\n\n    def _parse_path(self):\n        \"\"\"\n        Parse the storage path in the config.\n\n        Returns:\n            str\n        \"\"\"\n        if self.engine == ENGINE_DROPBOX:\n            path = get_dropbox_folder_location()\n        elif self.engine == ENGINE_GDRIVE:\n            path = get_google_drive_folder_location()\n        elif self.engine == ENGINE_COPY:\n            path = get_copy_folder_location()\n        elif self.engine == ENGINE_ICLOUD:\n            path = get_icloud_folder_location()\n        elif self.engine == ENGINE_BOX:\n            path = get_box_folder_location()\n        elif self.engine == ENGINE_FS:\n            if self._parser.has_option('storage', 'path'):\n                cfg_path = self._parser.get('storage', 'path')\n                path = os.path.join(os.environ['HOME'], cfg_path)\n            else:\n                raise ConfigError(\"The required 'path' can't be found while\"\n                                  \" the 'file_system' engine is used.\")\n\n        return str(path)\n\n    def _parse_directory(self):\n        \"\"\"\n        Parse the storage directory in the config.\n\n        Returns:\n            str\n        \"\"\"\n        if self._parser.has_option('storage', 'directory'):\n            directory = self._parser.get('storage', 'directory')\n        else:\n            directory = MACKUP_BACKUP_PATH\n\n        return str(directory)\n\n    def _parse_apps_to_ignore(self):\n        \"\"\"\n        Parse the applications to ignore in the config.\n\n        Returns:\n            set\n        \"\"\"\n        # We ignore nothing by default\n        apps_to_ignore = set()\n\n        # Is the \"[applications_to_ignore]\" in the cfg file ?\n        section_title = 'applications_to_ignore'\n        if self._parser.has_section(section_title):\n            apps_to_ignore = set(self._parser.options(section_title))\n\n        return apps_to_ignore\n\n    def _parse_apps_to_sync(self):\n        \"\"\"\n        Parse the applications to backup in the config.\n\n        Returns:\n            set\n        \"\"\"\n        # We allow nothing by default\n        apps_to_sync = set()\n\n        # Is the \"[applications_to_sync]\" section in the cfg file ?\n        section_title = 'applications_to_sync'\n        if self._parser.has_section(section_title):\n            apps_to_sync = set(self._parser.options(section_title))\n\n        return apps_to_sync\n\n\nclass ConfigError(Exception):\n\n    \"\"\"Exception used for handle errors in the configuration.\"\"\"\n\n    pass\n", "path": "mackup/config.py"}], "after_files": [{"content": "\"\"\"Package used to manage the .mackup.cfg config file.\"\"\"\n\nimport os\nimport os.path\n\nfrom .constants import (CUSTOM_APPS_DIR,\n                        MACKUP_BACKUP_PATH,\n                        MACKUP_CONFIG_FILE,\n                        ENGINE_DROPBOX,\n                        ENGINE_GDRIVE,\n                        ENGINE_COPY,\n                        ENGINE_ICLOUD,\n                        ENGINE_BOX,\n                        ENGINE_FS)\n\nfrom .utils import (error,\n                    get_dropbox_folder_location,\n                    get_copy_folder_location,\n                    get_google_drive_folder_location,\n                    get_icloud_folder_location,\n                    get_box_folder_location)\ntry:\n    import configparser\nexcept ImportError:\n    import ConfigParser as configparser\n\n\nclass Config(object):\n\n    \"\"\"The Mackup Config class.\"\"\"\n\n    def __init__(self, filename=None):\n        \"\"\"\n        Create a Config instance.\n\n        Args:\n            filename (str): Optional filename of the config file. If empty,\n                            defaults to MACKUP_CONFIG_FILE\n        \"\"\"\n        assert isinstance(filename, str) or filename is None\n\n        # Initialize the parser\n        self._parser = self._setup_parser(filename)\n\n        # Do we have an old config file ?\n        self._warn_on_old_config()\n\n        # Get the storage engine\n        self._engine = self._parse_engine()\n\n        # Get the path where the Mackup folder is\n        self._path = self._parse_path()\n\n        # Get the directory replacing 'Mackup', if any\n        self._directory = self._parse_directory()\n\n        # Get the list of apps to ignore\n        self._apps_to_ignore = self._parse_apps_to_ignore()\n\n        # Get the list of apps to allow\n        self._apps_to_sync = self._parse_apps_to_sync()\n\n    @property\n    def engine(self):\n        \"\"\"\n        The engine used by the storage.\n\n        ENGINE_DROPBOX, ENGINE_GDRIVE, ENGINE_COPY, ENGINE_ICLOUD, ENGINE_BOX\n        or ENGINE_FS.\n\n        Returns:\n            str\n        \"\"\"\n        return str(self._engine)\n\n    @property\n    def path(self):\n        \"\"\"\n        Path to the Mackup configuration files.\n\n        The path to the directory where Mackup is gonna create and store his\n        directory.\n\n        Returns:\n            str\n        \"\"\"\n        return str(self._path)\n\n    @property\n    def directory(self):\n        \"\"\"\n        The name of the Mackup directory, named Mackup by default.\n\n        Returns:\n            str\n        \"\"\"\n        return str(self._directory)\n\n    @property\n    def fullpath(self):\n        \"\"\"\n        Full path to the Mackup configuration files.\n\n        The full path to the directory when Mackup is storing the configuration\n        files.\n\n        Returns:\n            str\n        \"\"\"\n        return str(os.path.join(self.path, self.directory))\n\n    @property\n    def apps_to_ignore(self):\n        \"\"\"\n        Get the list of applications ignored in the config file.\n\n        Returns:\n            set. Set of application names to ignore, lowercase\n        \"\"\"\n        return set(self._apps_to_ignore)\n\n    @property\n    def apps_to_sync(self):\n        \"\"\"\n        Get the list of applications allowed in the config file.\n\n        Returns:\n            set. Set of application names to allow, lowercase\n        \"\"\"\n        return set(self._apps_to_sync)\n\n    def _setup_parser(self, filename=None):\n        \"\"\"\n        Configure the ConfigParser instance the way we want it.\n\n        Args:\n            filename (str) or None\n\n        Returns:\n            SafeConfigParser\n        \"\"\"\n        assert isinstance(filename, str) or filename is None\n\n        # If we are not overriding the config filename\n        if not filename:\n            filename = MACKUP_CONFIG_FILE\n\n        parser = configparser.SafeConfigParser(allow_no_value=True)\n        parser.read(os.path.join(os.path.join(os.environ['HOME'], filename)))\n\n        return parser\n\n    def _warn_on_old_config(self):\n        \"\"\"Warn the user if an old config format is detected.\"\"\"\n        # Is an old setion is in the config file ?\n        old_sections = ['Allowed Applications', 'Ignored Applications']\n        for old_section in old_sections:\n            if self._parser.has_section(old_section):\n                error(\"Old config file detected. Aborting.\\n\"\n                      \"\\n\"\n                      \"An old section (e.g. [Allowed Applications]\"\n                      \" or [Ignored Applications] has been detected\"\n                      \" in your {} file.\\n\"\n                      \"I'd rather do nothing than do something you\"\n                      \" do not want me to do.\\n\"\n                      \"\\n\"\n                      \"Please read the up to date documentation on\"\n                      \" <https://github.com/lra/mackup> and migrate\"\n                      \" your configuration file.\"\n                      .format(MACKUP_CONFIG_FILE))\n\n    def _parse_engine(self):\n        \"\"\"\n        Parse the storage engine in the config.\n\n        Returns:\n            str\n        \"\"\"\n        if self._parser.has_option('storage', 'engine'):\n            engine = str(self._parser.get('storage', 'engine'))\n        else:\n            engine = ENGINE_DROPBOX\n\n        assert isinstance(engine, str)\n\n        if engine not in [ENGINE_DROPBOX,\n                          ENGINE_GDRIVE,\n                          ENGINE_COPY,\n                          ENGINE_ICLOUD,\n                          ENGINE_BOX,\n                          ENGINE_FS]:\n            raise ConfigError('Unknown storage engine: {}'.format(engine))\n\n        return str(engine)\n\n    def _parse_path(self):\n        \"\"\"\n        Parse the storage path in the config.\n\n        Returns:\n            str\n        \"\"\"\n        if self.engine == ENGINE_DROPBOX:\n            path = get_dropbox_folder_location()\n        elif self.engine == ENGINE_GDRIVE:\n            path = get_google_drive_folder_location()\n        elif self.engine == ENGINE_COPY:\n            path = get_copy_folder_location()\n        elif self.engine == ENGINE_ICLOUD:\n            path = get_icloud_folder_location()\n        elif self.engine == ENGINE_BOX:\n            path = get_box_folder_location()\n        elif self.engine == ENGINE_FS:\n            if self._parser.has_option('storage', 'path'):\n                cfg_path = self._parser.get('storage', 'path')\n                path = os.path.join(os.environ['HOME'], cfg_path)\n            else:\n                raise ConfigError(\"The required 'path' can't be found while\"\n                                  \" the 'file_system' engine is used.\")\n\n        return str(path)\n\n    def _parse_directory(self):\n        \"\"\"\n        Parse the storage directory in the config.\n\n        Returns:\n            str\n        \"\"\"\n        if self._parser.has_option('storage', 'directory'):\n            directory = self._parser.get('storage', 'directory')\n            # Don't allow CUSTOM_APPS_DIR as a storage directory\n            if directory == CUSTOM_APPS_DIR:\n                raise ConfigError(\"{} cannot be used as a storage directory.\"\n                                  .format(CUSTOM_APPS_DIR))\n        else:\n            directory = MACKUP_BACKUP_PATH\n\n        return str(directory)\n\n    def _parse_apps_to_ignore(self):\n        \"\"\"\n        Parse the applications to ignore in the config.\n\n        Returns:\n            set\n        \"\"\"\n        # We ignore nothing by default\n        apps_to_ignore = set()\n\n        # Is the \"[applications_to_ignore]\" in the cfg file ?\n        section_title = 'applications_to_ignore'\n        if self._parser.has_section(section_title):\n            apps_to_ignore = set(self._parser.options(section_title))\n\n        return apps_to_ignore\n\n    def _parse_apps_to_sync(self):\n        \"\"\"\n        Parse the applications to backup in the config.\n\n        Returns:\n            set\n        \"\"\"\n        # We allow nothing by default\n        apps_to_sync = set()\n\n        # Is the \"[applications_to_sync]\" section in the cfg file ?\n        section_title = 'applications_to_sync'\n        if self._parser.has_section(section_title):\n            apps_to_sync = set(self._parser.options(section_title))\n\n        return apps_to_sync\n\n\nclass ConfigError(Exception):\n\n    \"\"\"Exception used for handle errors in the configuration.\"\"\"\n\n    pass\n", "path": "mackup/config.py"}]}