Skip to content

Commit

Permalink
Removed support for the Box storage (#1530)
Browse files Browse the repository at this point in the history
Fixes #807
  • Loading branch information
lra committed Feb 27, 2020
1 parent 2610147 commit e4e29f6
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 62 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Added support for Bat (via @joshmedeski)
- Vulnerability fix
- Removed support for Python 3.5
- Removed support for the Box storage

## Mackup 0.8.27

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,15 @@ in it stay put, so that any other computer also running Mackup is unaffected.
- [Google Drive](https://drive.google.com/)
- [Copy](https://www.copy.com/)
- [iCloud](http://www.apple.com/icloud/)
- [Box](https://www.box.com)
- Anything able to sync a folder (e.g. [Git](http://git-scm.com/))

See the [README](doc/README.md) file in the doc directory for more info.

## Unsupported Storages

- [Box](https://www.box.com): No longer supported is it ignores dotfiles, see
<https://github.com/lra/mackup/issues/807>.

## Supported Applications

- [1Password 4](https://agilebits.com/onepassword)
Expand Down
8 changes: 1 addition & 7 deletions mackup/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
ENGINE_GDRIVE,
ENGINE_COPY,
ENGINE_ICLOUD,
ENGINE_BOX,
ENGINE_FS,
)

Expand All @@ -21,7 +20,6 @@
get_copy_folder_location,
get_google_drive_folder_location,
get_icloud_folder_location,
get_box_folder_location,
)

try:
Expand Down Expand Up @@ -70,8 +68,7 @@ def engine(self):
"""
The engine used by the storage.
ENGINE_DROPBOX, ENGINE_GDRIVE, ENGINE_COPY, ENGINE_ICLOUD, ENGINE_BOX
or ENGINE_FS.
ENGINE_DROPBOX, ENGINE_GDRIVE, ENGINE_COPY, ENGINE_ICLOUD or ENGINE_FS.
Returns:
str
Expand Down Expand Up @@ -194,7 +191,6 @@ def _parse_engine(self):
ENGINE_GDRIVE,
ENGINE_COPY,
ENGINE_ICLOUD,
ENGINE_BOX,
ENGINE_FS,
]:
raise ConfigError("Unknown storage engine: {}".format(engine))
Expand All @@ -216,8 +212,6 @@ def _parse_path(self):
path = get_copy_folder_location()
elif self.engine == ENGINE_ICLOUD:
path = get_icloud_folder_location()
elif self.engine == ENGINE_BOX:
path = get_box_folder_location()
elif self.engine == ENGINE_FS:
if self._parser.has_option("storage", "path"):
cfg_path = self._parser.get("storage", "path")
Expand Down
1 change: 0 additions & 1 deletion mackup/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
CUSTOM_APPS_DIR = ".mackup"

# Supported engines
ENGINE_BOX = "box"
ENGINE_COPY = "copy"
ENGINE_DROPBOX = "dropbox"
ENGINE_FS = "file_system"
Expand Down
21 changes: 0 additions & 21 deletions mackup/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,27 +246,6 @@ def get_google_drive_folder_location():
return googledrive_home


def get_box_folder_location():
"""
Try to locate the Box folder.
Returns:
(str) Full path to the current Box folder
"""
box_prefs_path = "Library/Application Support/Box/Box Sync/" "sync_root_folder.txt"
box_home = None

box_prefs = os.path.join(os.environ["HOME"], box_prefs_path)
try:
with open(box_prefs, "r") as sync_path:
data = sync_path.read()
box_home = data
except IOError:
error("Unable to find your Box prefs =(")

return box_home


def get_copy_folder_location():
"""
Try to locate the Copy folder.
Expand Down
19 changes: 0 additions & 19 deletions tests/config_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
ENGINE_GDRIVE,
ENGINE_COPY,
ENGINE_ICLOUD,
ENGINE_BOX,
ENGINE_FS,
)
from mackup.config import Config, ConfigError
Expand Down Expand Up @@ -169,24 +168,6 @@ def test_config_engine_icloud(self):
assert cfg.apps_to_ignore == set(["subversion", "sequel-pro", "sabnzbd"])
assert cfg.apps_to_sync == set(["sublime-text-3", "x11", "sabnzbd"])

def test_config_engine_box(self):
cfg = Config("mackup-engine-box.cfg")

assert isinstance(cfg.engine, str)
assert cfg.engine == ENGINE_BOX

assert isinstance(cfg.path, str)
assert cfg.path == u"/Users/whatever/Box Sync"

assert isinstance(cfg.directory, str)
assert cfg.directory == u"some_weirder_name"

assert isinstance(cfg.fullpath, str)
assert cfg.fullpath == u"/Users/whatever/Box Sync/some_weirder_name"

assert cfg.apps_to_ignore == set()
assert cfg.apps_to_sync == set()

def test_config_engine_filesystem_no_path(self):
with self.assertRaises(ConfigError):
Config("mackup-engine-file_system-no_path.cfg")
Expand Down
3 changes: 0 additions & 3 deletions tests/fixtures/mackup-engine-box.cfg

This file was deleted.

11 changes: 1 addition & 10 deletions tests/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def test_error(self):
def test_failed_backup_location(self):
"""
Tests for the error that should occur if the backup folder cannot be
found for Dropbox, Google, Box and Copy
found for Dropbox, Google, and Copy
"""
# Hack to make our home folder some temporary folder
temp_home = tempfile.mkdtemp()
Expand All @@ -297,15 +297,6 @@ def test_failed_backup_location(self):
)
self.assertRaises(SystemExit, utils.get_google_drive_folder_location)

# Check for the missing Box folder
assert not os.path.exists(
os.path.join(
temp_home,
"Library/Application Support/Box/Box Sync/sync_root_folder.txt",
)
)
self.assertRaises(SystemExit, utils.get_box_folder_location)

# Check for the missing Copy Folder
assert not os.path.exists(
os.path.join(temp_home, "Library/Application Support/Copy Agent/config.db")
Expand Down

0 comments on commit e4e29f6

Please sign in to comment.