Skip to content

Commit

Permalink
Remove support for Copy engine as the service has been discontinued
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnyp committed Nov 11, 2018
1 parent 4d04da1 commit 2149f67
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 83 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Add support for hstr (via @paxperscientiam)
- Add support for b-ryan/powerline-shell (via @paxperscientiam)
- Add support for kovidgoyal/kitty (via @foray1010)
- Remove support for Copy engine as the service has been discontinued (via @sonnyp)

## Mackup 0.8.20

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ in it stay put, so that any other computer also running Mackup is unaffected.

- [Dropbox](https://www.dropbox.com/)
- [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/))
Expand Down
5 changes: 0 additions & 5 deletions doc/.mackup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ engine = dropbox
# [storage]
# engine = google_drive

# If you choose the "copy" storage engine, Mackup will figure
# out where your Copy folder is and store your configuration files in it.
# [storage]
# engine = copy

# If you want to specify another directory, you can use the "file_system"
# engine and Mackup won't try to detect any path for you: it will store your
# files where you explicitly told him to, using the "path" setting.
Expand Down
7 changes: 1 addition & 6 deletions mackup/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
MACKUP_CONFIG_FILE,
ENGINE_DROPBOX,
ENGINE_GDRIVE,
ENGINE_COPY,
ENGINE_ICLOUD,
ENGINE_BOX,
ENGINE_FS)

from .utils import (error,
get_dropbox_folder_location,
get_copy_folder_location,
get_google_drive_folder_location,
get_icloud_folder_location,
get_box_folder_location)
Expand Down Expand Up @@ -64,7 +62,7 @@ def engine(self):
"""
The engine used by the storage.
ENGINE_DROPBOX, ENGINE_GDRIVE, ENGINE_COPY, ENGINE_ICLOUD, ENGINE_BOX
ENGINE_DROPBOX, ENGINE_GDRIVE, ENGINE_ICLOUD, ENGINE_BOX
or ENGINE_FS.
Returns:
Expand Down Expand Up @@ -184,7 +182,6 @@ def _parse_engine(self):

if engine not in [ENGINE_DROPBOX,
ENGINE_GDRIVE,
ENGINE_COPY,
ENGINE_ICLOUD,
ENGINE_BOX,
ENGINE_FS]:
Expand All @@ -203,8 +200,6 @@ def _parse_path(self):
path = get_dropbox_folder_location()
elif self.engine == ENGINE_GDRIVE:
path = get_google_drive_folder_location()
elif self.engine == ENGINE_COPY:
path = get_copy_folder_location()
elif self.engine == ENGINE_ICLOUD:
path = get_icloud_folder_location()
elif self.engine == ENGINE_BOX:
Expand Down
1 change: 0 additions & 1 deletion mackup/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

# Supported engines
ENGINE_BOX = 'box'
ENGINE_COPY = 'copy'
ENGINE_DROPBOX = 'dropbox'
ENGINE_FS = 'file_system'
ENGINE_GDRIVE = 'google_drive'
Expand Down
30 changes: 0 additions & 30 deletions mackup/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,36 +266,6 @@ def get_box_folder_location():
return box_home


def get_copy_folder_location():
"""
Try to locate the Copy folder.
Returns:
(str) Full path to the current Copy folder
"""
copy_settings_path = 'Library/Application Support/Copy Agent/config.db'
copy_home = None

copy_settings = os.path.join(os.environ['HOME'], copy_settings_path)

if os.path.isfile(copy_settings):
database = sqlite3.connect(copy_settings)
if database:
cur = database.cursor()
query = ("SELECT value "
"FROM config2 "
"WHERE option = 'csmRootPath';")
cur.execute(query)
data = cur.fetchone()
copy_home = str(data[0])
cur.close()

if not copy_home:
error("Unable to find your Copy install =(")

return copy_home


def get_icloud_folder_location():
"""
Try to locate the iCloud Drive folder.
Expand Down
21 changes: 0 additions & 21 deletions tests/config_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from mackup.constants import (ENGINE_DROPBOX,
ENGINE_GDRIVE,
ENGINE_COPY,
ENGINE_ICLOUD,
ENGINE_BOX,
ENGINE_FS)
Expand Down Expand Up @@ -131,26 +130,6 @@ def test_config_engine_google_drive(self):
'sabnzbd'])
assert cfg.apps_to_sync == set(['sublime-text-3', 'x11', 'sabnzbd'])

def test_config_engine_copy(self):
cfg = Config('mackup-engine-copy.cfg')

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

assert isinstance(cfg.path, str)
assert cfg.path == u'/Users/someuser/Copy'

assert isinstance(cfg.directory, str)
assert cfg.directory == u'Mackup'

assert isinstance(cfg.fullpath, str)
assert cfg.fullpath.endswith(u'/Copy/Mackup')

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_icloud(self):
cfg = Config('mackup-engine-icloud.cfg')

Expand Down
Binary file not shown.
12 changes: 0 additions & 12 deletions tests/fixtures/mackup-engine-copy.cfg

This file was deleted.

8 changes: 1 addition & 7 deletions tests/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,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 Box
"""
# Hack to make our home folder some temporary folder
temp_home = tempfile.mkdtemp()
Expand All @@ -302,12 +302,6 @@ def test_failed_backup_location(self):
"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"))
self.assertRaises(SystemExit, utils.get_copy_folder_location)

def test_is_process_running(self):
# A pgrep that has one letter and a wildcard will always return id 1
assert utils.is_process_running("a*")
Expand Down

0 comments on commit 2149f67

Please sign in to comment.